From 157530b8b6e11efc5573d5a0db8987a440197aa1 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 29 Mar 2019 22:28:40 +0800 Subject: *misc --- source/Asura.Editor/controls/widget.h | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 source/Asura.Editor/controls/widget.h (limited to 'source/Asura.Editor/controls/widget.h') diff --git a/source/Asura.Editor/controls/widget.h b/source/Asura.Editor/controls/widget.h new file mode 100644 index 0000000..9ffd1fb --- /dev/null +++ b/source/Asura.Editor/controls/widget.h @@ -0,0 +1,43 @@ +#ifndef __ASURA_EDITOR_WIDGET_H__ +#define __ASURA_EDITOR_WIDGET_H__ + +#include + +#include +#include +#include +#include +#include + +namespace AsuraEditor +{ + + /// + /// Asura Editor的控件逻辑,不包含渲染、窗口和事件轮询,只包含对事件的响应和逻辑处理接口。 + /// + ASURA_ABSTRACT class Widget + : public virtual AEScripting::NativeAccessor + { + + public: + + /// + /// 控件只有被父节点选中为focus时才会处理输入,所以很高效。 + /// + virtual void OnEvent(AEInput::Event& e) = 0; + + /// + /// + /// + virtual void OnPaint() = 0; + + protected: + + AEMath::Vector2i mPos; + AEMath::Recti mBBox; + + }; + +} + +#endif \ No newline at end of file -- cgit v1.1-26-g67d0