44 lines
908 B
C++
44 lines
908 B
C++
#pragma once
|
|
#include "TipNode.h"
|
|
#include "Singleton.h"
|
|
|
|
USING_NS_CC;
|
|
using namespace cocos2d::ui;
|
|
|
|
class PopScene : public TipNode, public Singleton<PopScene>
|
|
{
|
|
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<void()>& fnOKHander = nullptr);
|
|
void show(std::string strContent, const std::function<void()>& fnOKHander, const std::function<void()>& fnCancelHander);
|
|
void onClickCancel(Ref*);
|
|
void onClickOK(Ref*);
|
|
|
|
private:
|
|
std::function<void()> m_fnOKHander;
|
|
std::function<void()> m_fnCancelHander;
|
|
|
|
Text* m_txtContent; //文本内容显示
|
|
Button* m_btnOK; //确定按钮
|
|
Button* m_btnCancel; //取消按钮
|
|
float m_fWndWidth; //窗口宽度
|
|
ImageView* m_ImgBg;
|
|
}; |