#pragma once #include "include.h" #include "_MessageBoxType.h" #include #include #include #include "begin_code.h" class WindowMessageBoxButton { public: WindowMessageBoxButton(); WindowMessageBoxButton(const std::string& ButtonText,const std::function& CallbackFunc=[]() {}); std::string text; std::function callback; /// Default: no hit option set. void setHitAsReturn(bool); void setHitAsEscape(bool); bool isHitAsReturn() const; bool isHitAsEscape() const; private: int _hitoption; }; class WindowMessageBox { public: WindowMessageBox(); WindowMessageBox(const std::string& Title,const std::string& Text,MessageBoxType BoxType=MessageBoxType::Information,const std::function& DefaultCallback=[]() {}); MessageBoxType boxtype; std::string title; std::string text; std::function defaultcallback; void addButton(const WindowMessageBoxButton& button); int getButtonNum() const; WindowMessageBoxButton& getButton(int index); const WindowMessageBoxButton& getButtonConst(int index) const; private: std::vector _vec; }; #include "end_code.h"