#pragma once #include "TipNode.h" #include "Singleton.h" USING_NS_CC; using namespace cocos2d::ui; class PopScene : public TipNode, public Singleton { public: PopScene(); ~PopScene(); public: CREATE_FUNC(PopScene); virtual bool init(); virtual void onEnter(); virtual void onEnterTransitionDidFinish(); virtual void onExit(); void pushScene(); void popScene(); public: void show(std::string strContent, const std::function& fnOKHander = nullptr); void show(std::string strContent, const std::function& fnOKHander, const std::function& fnCancelHander); void onClickCancel(Ref*); void onClickOK(Ref*); private: std::function m_fnOKHander; std::function m_fnCancelHander; Text* m_txtContent; //文本内容显示 Button* m_btnOK; //确定按钮 Button* m_btnCancel; //取消按钮 float m_fWndWidth; //窗口宽度 ImageView* m_ImgBg; };