// // MySwitchBtn.h // CandyCpp // // Created by 杜家兑macbook on 16/8/23. // // #ifndef RUSwitchBtn_h #define RUSwitchBtn_h #include "RUQCoreBtn.h" NS_RU_BEGIN class SwitchBtn: public redutils::QCoreBtn { public: RED_STATIC_NEW_AUTORELEASE_OBJECT_WITH_INIT_METHOD(SwitchBtn, create); SwitchBtn(); ~SwitchBtn(); void setQueryFunc(std::function); void setCallbackWhileSwitched(std::function); virtual void onEnter() override; protected: void onClicked(redutils::QCoreBtn* cl, int tag); std::function _query = nullptr; std::function _cbWhileSwitched = nullptr; }; class SwitchBtnLoader : public redream::LayerLoader { public: RED_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(SwitchBtnLoader, loader); protected: RED_VIRTUAL_NEW_AUTORELEASE_CREATECCNODE_METHOD(SwitchBtn); }; NS_RU_END #endif /* defined(RUSwitchBtn_h) */