123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- //
- // RUBasePopup.h
- // red_utils
- //
- // Created by ZhengSong on 2023/6/9.
- //
- #ifndef RUBasePopup_h
- #define RUBasePopup_h
- #include "RUDefine.h"
- NS_RU_BEGIN
- class BasePopup : public Node
- {
- friend class PopupMgr;
- public:
- BasePopup();
- virtual ~BasePopup();
-
- /*
- 作用:立即打开弹窗
- */
- void popup();
-
- /*
- 作用:按队列弹窗,如果当前没有弹窗,根据窗口优先级排序,优先级越小优先弹窗
- 参数:priority: 弹窗等级
- */
- void popupByQueue(int priority = 1);
- #pragma mark - PopupMgr用到的 [函数]
- protected:
- void _execCloseCb();
- virtual void _open() = 0;
- virtual void _close() = 0;
- int _getPriority() const;
- const std::string& _getWindowName() const;
- protected:
- int _priority = 0; //按队列弹窗的优先级
- std::string _windowName; //弹窗名,可根据弹窗名做不同的逻辑
- std::function<void(void)> _closeCb = nullptr; //窗口关闭的回调
- };
- NS_RU_END
- #endif /* RUBasePopup_h */
|