diff options
Diffstat (limited to 'source/Asura.Editor/controls/button.h')
| -rw-r--r-- | source/Asura.Editor/controls/button.h | 82 | 
1 files changed, 7 insertions, 75 deletions
| diff --git a/source/Asura.Editor/controls/button.h b/source/Asura.Editor/controls/button.h index 656d7d8..edfa7b7 100644 --- a/source/Asura.Editor/controls/button.h +++ b/source/Asura.Editor/controls/button.h @@ -1,82 +1,14 @@ -#ifndef __ASURA_EDITOR_BUTTON_H__ -#define __ASURA_EDITOR_BUTTON_H__ +#ifndef __ASURA_EDITOR_GUI_BUTTON_H__ +#define __ASURA_EDITOR_GUI_BUTTON_H__ -#include <vector> +#include <asura-utils/classes.h> -#include <asura-utils/scripting/portable.hpp> -#include <asura-core/graphics/image.h> +namespace_begin(AsuraEditor) -#include "../core/signal.h" -#include "widget.h" +bool Button(); -namespace AsuraEditor -{ -	namespace Controls -	{ -		enum ButtonStatus -		{ -			BUTTON_STATUS_NORMAL = 0, -			BUTTON_STATUS_PUSHED = 1, -			BUTTON_STATUS_HOVER = 2, -			BUTTON_STATUS_DISABLED = 3, -			BUTTON_STATUS_FOCUSED = 4, -			_BUTTON_STATUS_COUNT = 5, -		}; -		enum ButtonMessage -		{ -			BUTTON_MSG_CLICK = 0, -			BUTTON_MSG_HOVER = 1, -			BUTTON_MSG_KILLFOCUS = 2, -			_BUTTON_MSG_COUNT = 3, -		}; +namespace_end -		class Button -			: public Widget -			, public AEScripting::Portable<Button> -		{ -		public: - -			LUAX_DECL_FACTORY(Button); - -			Button(); -			~Button(); - -			void OnEvent(AEInput::Event& e) override; -			void OnPaint() override; - -			void Connect(int msg, Slot callback); -			void Disconnect(int msg); -			void DisconnectAll(int msg); -			void DisconnectAllMsg(); - -			int GetStatus(); -			void SetImage(int status, AEGraphics::Image* image); - -		private: - -			//------------------------------------------------------------------------------// - -			LUAX_DECL_ENUM(ButtonStatus, 1); -			LUAX_DECL_ENUM(ButtonMessage, 1); - -			LUAX_DECL_METHOD(_Connect); -			LUAX_DECL_METHOD(_Disconnect); -			LUAX_DECL_METHOD(_SetImage); - -			//------------------------------------------------------------------------------// - -			int                              mStatus;                        // ǰ״̬ -			Signal                           mSignals[_BUTTON_MSG_COUNT];    // 3Ϣsignal -			AEGraphics::Image*               mImage[_BUTTON_STATUS_COUNT];   // 5״̬ͼ - -			Luax::LuaxMemberRef              mImageRef[_BUTTON_STATUS_COUNT];// ͼ -			std::vector<Luax::LuaxMemberRef> mCallbacksRef;                  // ص - -		}; - -	} -} - -#endif
\ No newline at end of file +#endif | 
