diff options
Diffstat (limited to 'source/Asura.Editor/controls')
28 files changed, 107 insertions, 236 deletions
diff --git a/source/Asura.Editor/controls/binding/_button.cpp b/source/Asura.Editor/controls/binding/_button.cpp deleted file mode 100644 index 9e6a6bb..0000000 --- a/source/Asura.Editor/controls/binding/_button.cpp +++ /dev/null @@ -1,74 +0,0 @@ -#include "../button.h" - -using namespace std; -using namespace Luax; - -namespace AsuraEditor -{ - namespace Controls - { - - LUAX_REGISTRY(Button) - { - LUAX_REGISTER_METHODS(state, - { "Connect", _Connect }, - { "Disconnect", _Disconnect }, - { "SetImage", _SetImage } - ); - } - - LUAX_POSTPROCESS(Button) - { - LUAX_REGISTER_ENUM(state, "EButtonStatus", - { "NORMAL", BUTTON_STATUS_NORMAL }, - { "0", 0 }, - { "PUSHED", BUTTON_STATUS_PUSHED }, - { "1", 1 }, - { "HOVER", BUTTON_STATUS_HOVER }, - { "2", 2 }, - { "DISABLED", BUTTON_STATUS_DISABLED }, - { "3", 3 }, - { "FOCUSED", BUTTON_STATUS_FOCUSED }, - { "4", 4 }, - { "STATUS_COUNT", _BUTTON_STATUS_COUNT }, - { "5", 5 } - ); - LUAX_REGISTER_ENUM(state, "EButtonMessage", - { "CLICK", BUTTON_MSG_CLICK }, - { "0", 0 }, - { "HOVER", BUTTON_MSG_HOVER }, - { "1", 1 }, - { "KILLFOCUS", BUTTON_MSG_KILLFOCUS }, - { "2", 2 }, - { "MSG_COUNT", _BUTTON_MSG_COUNT }, - { "3", 3 } - ); - - } - - // button:Connect() - LUAX_IMPL_METHOD(Button, _Connect) - { - LUAX_PREPARE(L, Button); - - return 0; - } - - // button:Disconnect() - LUAX_IMPL_METHOD(Button, _Disconnect) - { - LUAX_PREPARE(L, Button); - - return 0; - } - - // button:SetImage() - LUAX_IMPL_METHOD(Button, _SetImage) - { - LUAX_PREPARE(L, Button); - - return 0; - } - - } -} diff --git a/source/Asura.Editor/controls/button.cpp b/source/Asura.Editor/controls/button.cpp index 9910df4..c5741c1 100644 --- a/source/Asura.Editor/controls/button.cpp +++ b/source/Asura.Editor/controls/button.cpp @@ -1,6 +1,8 @@ -#include "button.h" +#include "gui_button.h" -namespace AsuraEditor -{ +namespace_begin(AsuraEditor) -}
\ No newline at end of file + + + +namespace_end 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 diff --git a/source/Asura.Editor/controls/checkbox.cpp b/source/Asura.Editor/controls/checkbox.cpp deleted file mode 100644 index e69de29..0000000 --- a/source/Asura.Editor/controls/checkbox.cpp +++ /dev/null diff --git a/source/Asura.Editor/controls/checkbox.h b/source/Asura.Editor/controls/checkbox.h deleted file mode 100644 index e69de29..0000000 --- a/source/Asura.Editor/controls/checkbox.h +++ /dev/null diff --git a/source/Asura.Editor/controls/content.cpp b/source/Asura.Editor/controls/content.cpp new file mode 100644 index 0000000..c5741c1 --- /dev/null +++ b/source/Asura.Editor/controls/content.cpp @@ -0,0 +1,8 @@ +#include "gui_button.h" + +namespace_begin(AsuraEditor) + + + + +namespace_end diff --git a/source/Asura.Editor/controls/content.h b/source/Asura.Editor/controls/content.h new file mode 100644 index 0000000..230bfa9 --- /dev/null +++ b/source/Asura.Editor/controls/content.h @@ -0,0 +1,17 @@ +#ifndef __ASURA_EDITOR_GUI_BUTTON_H__ +#define __ASURA_EDITOR_GUI_BUTTON_H__ + +#include <asura-utils/classes.h> + +namespace_begin(AsuraEditor) + +/// IMGUI content +class Content +{ + +}; + + +namespace_end + +#endif diff --git a/source/Asura.Editor/controls/hslider.cpp b/source/Asura.Editor/controls/hslider.cpp deleted file mode 100644 index e69de29..0000000 --- a/source/Asura.Editor/controls/hslider.cpp +++ /dev/null diff --git a/source/Asura.Editor/controls/hslider.h b/source/Asura.Editor/controls/hslider.h deleted file mode 100644 index e69de29..0000000 --- a/source/Asura.Editor/controls/hslider.h +++ /dev/null diff --git a/source/Asura.Editor/controls/hvslider.cpp b/source/Asura.Editor/controls/hvslider.cpp deleted file mode 100644 index e69de29..0000000 --- a/source/Asura.Editor/controls/hvslider.cpp +++ /dev/null diff --git a/source/Asura.Editor/controls/hvslider.h b/source/Asura.Editor/controls/hvslider.h deleted file mode 100644 index e69de29..0000000 --- a/source/Asura.Editor/controls/hvslider.h +++ /dev/null diff --git a/source/Asura.Editor/controls/label.cpp b/source/Asura.Editor/controls/label.cpp index e69de29..c5741c1 100644 --- a/source/Asura.Editor/controls/label.cpp +++ b/source/Asura.Editor/controls/label.cpp @@ -0,0 +1,8 @@ +#include "gui_button.h" + +namespace_begin(AsuraEditor) + + + + +namespace_end diff --git a/source/Asura.Editor/controls/label.h b/source/Asura.Editor/controls/label.h index 32b61d4..7cc6e3d 100644 --- a/source/Asura.Editor/controls/label.h +++ b/source/Asura.Editor/controls/label.h @@ -1,25 +1,14 @@ -#ifndef __ASURA_EDITOR_LABEL_H__ -#define __ASURA_EDITOR_LABEL_H__ +#ifndef __ASURA_EDITOR_GUI_BUTTON_H__ +#define __ASURA_EDITOR_GUI_BUTTON_H__ -#include <asura-utils/scripting/portable.hpp> -#include <asura-core/graphics/image.h> +#include <asura-utils/classes.h> -#include "widget.h" +namespace_begin(AsuraEditor) -namespace AsuraEditor -{ +bool Label(); - class Label - : public Widget - , public AEScripting::Portable<Label> - { - public: - void OnEvent(AEInput::Event& e) override; - void OnPaint() override; - }; +namespace_end -} - -#endif
\ No newline at end of file +#endif diff --git a/source/Asura.Editor/controls/menu_item.cpp b/source/Asura.Editor/controls/menu_item.cpp deleted file mode 100644 index e69de29..0000000 --- a/source/Asura.Editor/controls/menu_item.cpp +++ /dev/null diff --git a/source/Asura.Editor/controls/menu_item.h b/source/Asura.Editor/controls/menu_item.h deleted file mode 100644 index e69de29..0000000 --- a/source/Asura.Editor/controls/menu_item.h +++ /dev/null diff --git a/source/Asura.Editor/controls/panel.cpp b/source/Asura.Editor/controls/panel.cpp index e69de29..2e6e2cc 100644 --- a/source/Asura.Editor/controls/panel.cpp +++ b/source/Asura.Editor/controls/panel.cpp @@ -0,0 +1,16 @@ +#include "gui_button.h" + +namespace_begin(AsuraEditor) + +class GUIWindow +{ +public: + + GUIWindow(); + ~GUIWindow(); + +}; + + + +namespace_end diff --git a/source/Asura.Editor/controls/panel.h b/source/Asura.Editor/controls/panel.h index e69de29..b485635 100644 --- a/source/Asura.Editor/controls/panel.h +++ b/source/Asura.Editor/controls/panel.h @@ -0,0 +1,16 @@ +#ifndef __ASURA_EDITOR_GUI_BUTTON_H__ +#define __ASURA_EDITOR_GUI_BUTTON_H__ + +#include <asura-utils/classes.h> + +namespace_begin(AsuraEditor) + +/// IMGUI panel +class Panel +{ + +}; + +namespace_end + +#endif diff --git a/source/Asura.Editor/controls/progress.cpp b/source/Asura.Editor/controls/progress.cpp deleted file mode 100644 index e69de29..0000000 --- a/source/Asura.Editor/controls/progress.cpp +++ /dev/null diff --git a/source/Asura.Editor/controls/progress.h b/source/Asura.Editor/controls/progress.h deleted file mode 100644 index e69de29..0000000 --- a/source/Asura.Editor/controls/progress.h +++ /dev/null diff --git a/source/Asura.Editor/controls/radio_button.cpp b/source/Asura.Editor/controls/radio_button.cpp deleted file mode 100644 index e69de29..0000000 --- a/source/Asura.Editor/controls/radio_button.cpp +++ /dev/null diff --git a/source/Asura.Editor/controls/radio_button.h b/source/Asura.Editor/controls/radio_button.h deleted file mode 100644 index a9fc765..0000000 --- a/source/Asura.Editor/controls/radio_button.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef __ASURA_EDITOR_RADIO_BUTTON_H__ -#define __ASURA_EDITOR_RADIO_BUTTON_H__ - -namespace AsuraEditor -{ - namespace Controls - { - - class RadioButton - { - public: - - RadioButton(); - ~RadioButton(); - - - - }; - - } -} - -#endif diff --git a/source/Asura.Editor/controls/textbox.cpp b/source/Asura.Editor/controls/textbox.cpp deleted file mode 100644 index e69de29..0000000 --- a/source/Asura.Editor/controls/textbox.cpp +++ /dev/null diff --git a/source/Asura.Editor/controls/textbox.h b/source/Asura.Editor/controls/textbox.h deleted file mode 100644 index e69de29..0000000 --- a/source/Asura.Editor/controls/textbox.h +++ /dev/null diff --git a/source/Asura.Editor/controls/toggle.cpp b/source/Asura.Editor/controls/toggle.cpp new file mode 100644 index 0000000..40d2043 --- /dev/null +++ b/source/Asura.Editor/controls/toggle.cpp @@ -0,0 +1,8 @@ +#include "gui_button.h" + +namespace_begin(AsuraEditor) + +bool GUIToggle(); + + +namespace_end diff --git a/source/Asura.Editor/controls/toggle.h b/source/Asura.Editor/controls/toggle.h new file mode 100644 index 0000000..19e9379 --- /dev/null +++ b/source/Asura.Editor/controls/toggle.h @@ -0,0 +1,14 @@ +#ifndef __ASURA_EDITOR_GUI_BUTTON_H__ +#define __ASURA_EDITOR_GUI_BUTTON_H__ + +#include <asura-utils/classes.h> + +namespace_begin(AsuraEditor) + +bool Toggle(); + + + +namespace_end + +#endif diff --git a/source/Asura.Editor/controls/vslider.cpp b/source/Asura.Editor/controls/vslider.cpp deleted file mode 100644 index e69de29..0000000 --- a/source/Asura.Editor/controls/vslider.cpp +++ /dev/null diff --git a/source/Asura.Editor/controls/vslider.h b/source/Asura.Editor/controls/vslider.h deleted file mode 100644 index e69de29..0000000 --- a/source/Asura.Editor/controls/vslider.h +++ /dev/null diff --git a/source/Asura.Editor/controls/widget.h b/source/Asura.Editor/controls/widget.h deleted file mode 100644 index df914bf..0000000 --- a/source/Asura.Editor/controls/widget.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef __ASURA_EDITOR_WIDGET_H__ -#define __ASURA_EDITOR_WIDGET_H__ - -#include <list> - -#include <asura-utils/scripting/portable.hpp> -#include <asura-utils/type.h> -#include <asura-utils/math/rect.hpp> -#include <asura-utils/math/vector2.hpp> -#include <asura-core/input/event.h> - -namespace AsuraEditor -{ - - /// - /// Asura EditorĿؼȾں¼ѯֻ¼Ӧӿڡ - /// - ASURA_ABSTRACT class Widget : public AEScripting::Object - { - - 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 |