aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-03-24 19:06:17 +0800
committercrupest <crupest@outlook.com>2019-03-24 19:06:17 +0800
commit79d1d76509dbf6cf9c79f8eb55968535982975aa (patch)
tree322ed87621506f2e56f4887c73370db769843a29 /src/ui/controls
parente8be3841457853daefc26d0ca00256ad8c44f593 (diff)
downloadcru-79d1d76509dbf6cf9c79f8eb55968535982975aa.tar.gz
cru-79d1d76509dbf6cf9c79f8eb55968535982975aa.tar.bz2
cru-79d1d76509dbf6cf9c79f8eb55968535982975aa.zip
...
Diffstat (limited to 'src/ui/controls')
-rw-r--r--src/ui/controls/button.cpp13
-rw-r--r--src/ui/controls/button.hpp31
-rw-r--r--src/ui/controls/text_block.cpp2
3 files changed, 42 insertions, 4 deletions
diff --git a/src/ui/controls/button.cpp b/src/ui/controls/button.cpp
index e69de29b..5d4e15cc 100644
--- a/src/ui/controls/button.cpp
+++ b/src/ui/controls/button.cpp
@@ -0,0 +1,13 @@
+#include "button.hpp"
+
+#include "ui/ui_manager.hpp"
+#include "ui/render/border_render_object.hpp"
+
+namespace cru::ui::controls {
+Button::Button() {
+ const auto predefined_resource =
+ UiManager::GetInstance()->GetPredefineResources();
+ render_object_ = new render::BorderRenderObject(); }
+
+void Button::OnChildChanged(Control* old_child, Control* new_child) {}
+} // namespace cru::ui::controls
diff --git a/src/ui/controls/button.hpp b/src/ui/controls/button.hpp
index 010c3f5b..27e7fc7b 100644
--- a/src/ui/controls/button.hpp
+++ b/src/ui/controls/button.hpp
@@ -1,8 +1,35 @@
#pragma once
#include "pre.hpp"
-#include "ui/control.hpp"
+#include "ui/content_control.hpp"
+
+namespace cru::ui::render {
+class BorderRenderObject;
+}
namespace cru::ui::controls {
+class Button : public ContentControl {
+ public:
+ static constexpr auto control_type = L"Button";
-}
+ static Button* Create();
+
+ protected:
+ Button();
+
+ public:
+ Button(const Button& other) = delete;
+ Button(Button&& other) = delete;
+ Button& operator=(const Button& other) = delete;
+ Button& operator=(Button&& other) = delete;
+ ~Button();
+
+ render::RenderObject* GetRenderObject() const override;
+
+ protected:
+ void OnChildChanged(Control* old_child, Control* new_child) override;
+
+ private:
+ render::BorderRenderObject* render_object_;
+};
+} // namespace cru::ui::controls
diff --git a/src/ui/controls/text_block.cpp b/src/ui/controls/text_block.cpp
index 85116910..c891b832 100644
--- a/src/ui/controls/text_block.cpp
+++ b/src/ui/controls/text_block.cpp
@@ -1,7 +1,5 @@
#include "text_block.hpp"
-#include <dwrite.h>
-
#include "ui/render/text_render_object.hpp"
#include "ui/ui_manager.hpp"