aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/controls
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/ui/controls')
-rw-r--r--include/cru/ui/controls/Button.h4
-rw-r--r--include/cru/ui/controls/CheckBox.h4
-rw-r--r--include/cru/ui/controls/Container.h4
-rw-r--r--include/cru/ui/controls/Control.h2
-rw-r--r--include/cru/ui/controls/FlexLayout.h4
-rw-r--r--include/cru/ui/controls/IconButton.h4
-rw-r--r--include/cru/ui/controls/Popup.h4
-rw-r--r--include/cru/ui/controls/ScrollView.h4
-rw-r--r--include/cru/ui/controls/StackLayout.h4
-rw-r--r--include/cru/ui/controls/TextBlock.h4
-rw-r--r--include/cru/ui/controls/TextBox.h4
-rw-r--r--include/cru/ui/controls/TreeView.h6
-rw-r--r--include/cru/ui/controls/Window.h5
13 files changed, 27 insertions, 26 deletions
diff --git a/include/cru/ui/controls/Button.h b/include/cru/ui/controls/Button.h
index 717710e8..3c01be32 100644
--- a/include/cru/ui/controls/Button.h
+++ b/include/cru/ui/controls/Button.h
@@ -12,7 +12,7 @@ class CRU_UI_API Button : public SingleChildControl<render::BorderRenderObject>,
public virtual IClickableControl,
public virtual IBorderControl {
public:
- static constexpr StringView kControlType = u"Button";
+ static constexpr std::string_view kControlType = "Button";
public:
Button();
@@ -22,7 +22,7 @@ class CRU_UI_API Button : public SingleChildControl<render::BorderRenderObject>,
Button& operator=(Button&& other) = delete;
~Button() override;
- String GetControlType() const final { return kControlType.ToString(); }
+ std::string GetControlType() const final { return std::string(kControlType); }
public:
helper::ClickState GetClickState() override {
diff --git a/include/cru/ui/controls/CheckBox.h b/include/cru/ui/controls/CheckBox.h
index 19908389..8a2c84a0 100644
--- a/include/cru/ui/controls/CheckBox.h
+++ b/include/cru/ui/controls/CheckBox.h
@@ -12,12 +12,12 @@ class CRU_UI_API CheckBox : public NoChildControl,
public virtual ICheckableControl,
public virtual IClickableControl {
public:
- static constexpr StringView kControlType = u"CheckBox";
+ static constexpr std::string_view kControlType = "CheckBox";
CheckBox();
~CheckBox() override;
- String GetControlType() const override { return kControlType.ToString(); }
+ std::string GetControlType() const override { return std::string(kControlType); }
render::RenderObject* GetRenderObject() const override {
return container_render_object_.get();
diff --git a/include/cru/ui/controls/Container.h b/include/cru/ui/controls/Container.h
index c8bf3f32..4fee178d 100644
--- a/include/cru/ui/controls/Container.h
+++ b/include/cru/ui/controls/Container.h
@@ -8,7 +8,7 @@ namespace cru::ui::controls {
class CRU_UI_API Container
: public SingleChildControl<render::BorderRenderObject>,
public virtual IBorderControl {
- static constexpr StringView kControlType = u"Container";
+ static constexpr std::string_view kControlType = "Container";
public:
Container();
@@ -46,6 +46,6 @@ class CRU_UI_API Container
}
public:
- String GetControlType() const final { return kControlType.ToString(); }
+ std::string GetControlType() const final { return std::string(kControlType); }
};
} // namespace cru::ui::controls
diff --git a/include/cru/ui/controls/Control.h b/include/cru/ui/controls/Control.h
index f6603bbc..7301ecd8 100644
--- a/include/cru/ui/controls/Control.h
+++ b/include/cru/ui/controls/Control.h
@@ -36,7 +36,7 @@ class CRU_UI_API Control : public Object,
~Control() override;
public:
- virtual String GetControlType() const = 0;
+ virtual std::string GetControlType() const = 0;
//*************** region: tree ***************
public:
diff --git a/include/cru/ui/controls/FlexLayout.h b/include/cru/ui/controls/FlexLayout.h
index 148586c0..8940e38e 100644
--- a/include/cru/ui/controls/FlexLayout.h
+++ b/include/cru/ui/controls/FlexLayout.h
@@ -13,7 +13,7 @@ using render::FlexMainAlignment;
class CRU_UI_API FlexLayout
: public LayoutControl<render::FlexLayoutRenderObject> {
public:
- static constexpr StringView kControlType = u"FlexLayout";
+ static constexpr std::string_view kControlType = "FlexLayout";
public:
FlexLayout();
@@ -23,7 +23,7 @@ class CRU_UI_API FlexLayout
FlexLayout& operator=(FlexLayout&& other) = delete;
~FlexLayout() override;
- String GetControlType() const final { return kControlType.ToString(); }
+ std::string GetControlType() const final { return std::string(kControlType); }
FlexMainAlignment GetContentMainAlign() const;
void SetContentMainAlign(FlexMainAlignment value);
diff --git a/include/cru/ui/controls/IconButton.h b/include/cru/ui/controls/IconButton.h
index 9dbb3a3d..9e7572e0 100644
--- a/include/cru/ui/controls/IconButton.h
+++ b/include/cru/ui/controls/IconButton.h
@@ -17,14 +17,14 @@ class CRU_UI_API IconButton : public NoChildControl,
public virtual IBorderControl,
public virtual IContentBrushControl {
public:
- static constexpr StringView kControlType = u"IconButton";
+ static constexpr std::string_view kControlType = "IconButton";
public:
IconButton();
IconButton(std::string_view icon_svg_path_data_string, const Rect& view_port);
~IconButton() override;
- String GetControlType() const final { return kControlType.ToString(); }
+ std::string GetControlType() const final { return std::string(kControlType); }
render::RenderObject* GetRenderObject() const override {
return container_render_object_.get();
diff --git a/include/cru/ui/controls/Popup.h b/include/cru/ui/controls/Popup.h
index 464e7278..7c57d257 100644
--- a/include/cru/ui/controls/Popup.h
+++ b/include/cru/ui/controls/Popup.h
@@ -8,7 +8,7 @@
namespace cru::ui::controls {
class CRU_UI_API Popup : public RootControl {
public:
- static constexpr StringView kControlType = u"Popup";
+ static constexpr std::string_view kControlType = "Popup";
explicit Popup(Control* attached_control = nullptr);
@@ -17,6 +17,6 @@ class CRU_UI_API Popup : public RootControl {
~Popup() override;
- String GetControlType() const override { return kControlType.ToString(); }
+ std::string GetControlType() const override { return std::string(kControlType); }
};
} // namespace cru::ui::controls
diff --git a/include/cru/ui/controls/ScrollView.h b/include/cru/ui/controls/ScrollView.h
index 244977d5..cefda747 100644
--- a/include/cru/ui/controls/ScrollView.h
+++ b/include/cru/ui/controls/ScrollView.h
@@ -7,7 +7,7 @@ namespace cru::ui::controls {
class CRU_UI_API ScrollView
: public SingleChildControl<render::ScrollRenderObject> {
public:
- static constexpr StringView kControlType = u"ScrollView";
+ static constexpr std::string_view kControlType = "ScrollView";
ScrollView();
CRU_DELETE_COPY(ScrollView)
@@ -15,6 +15,6 @@ class CRU_UI_API ScrollView
~ScrollView() override;
public:
- String GetControlType() const override { return kControlType.ToString(); }
+ std::string GetControlType() const override { return std::string(kControlType); }
};
} // namespace cru::ui::controls
diff --git a/include/cru/ui/controls/StackLayout.h b/include/cru/ui/controls/StackLayout.h
index cbf35cbe..db646807 100644
--- a/include/cru/ui/controls/StackLayout.h
+++ b/include/cru/ui/controls/StackLayout.h
@@ -9,13 +9,13 @@ using render::StackChildLayoutData;
class CRU_UI_API StackLayout
: public LayoutControl<render::StackLayoutRenderObject> {
public:
- static constexpr StringView kControlType = u"StackLayout";
+ static constexpr std::string_view kControlType = "StackLayout";
StackLayout();
CRU_DELETE_COPY(StackLayout)
CRU_DELETE_MOVE(StackLayout)
~StackLayout() override;
- String GetControlType() const final { return kControlType.ToString(); }
+ std::string GetControlType() const final { return std::string(kControlType); }
};
} // namespace cru::ui::controls
diff --git a/include/cru/ui/controls/TextBlock.h b/include/cru/ui/controls/TextBlock.h
index 66330b23..a3b6407f 100644
--- a/include/cru/ui/controls/TextBlock.h
+++ b/include/cru/ui/controls/TextBlock.h
@@ -14,7 +14,7 @@ class CRU_UI_API TextBlock : public NoChildControl,
public virtual IFontControl,
public virtual IContentBrushControl {
public:
- static constexpr StringView kControlType = u"TextBlock";
+ static constexpr std::string_view kControlType = "TextBlock";
static std::unique_ptr<TextBlock> Create(std::string text,
bool selectable = false) {
@@ -32,7 +32,7 @@ class CRU_UI_API TextBlock : public NoChildControl,
TextBlock& operator=(TextBlock&& other) = delete;
~TextBlock() override;
- String GetControlType() const final { return kControlType.ToString(); }
+ std::string GetControlType() const final { return std::string(kControlType); }
render::RenderObject* GetRenderObject() const override;
diff --git a/include/cru/ui/controls/TextBox.h b/include/cru/ui/controls/TextBox.h
index 13f5d356..adb9895e 100644
--- a/include/cru/ui/controls/TextBox.h
+++ b/include/cru/ui/controls/TextBox.h
@@ -18,14 +18,14 @@ class CRU_UI_API TextBox : public NoChildControl,
public virtual IContentBrushControl,
public virtual IFontControl {
public:
- static constexpr StringView control_type = u"TextBox";
+ static constexpr std::string_view control_type = "TextBox";
TextBox();
CRU_DELETE_COPY(TextBox)
CRU_DELETE_MOVE(TextBox)
~TextBox() override;
- String GetControlType() const final { return control_type.ToString(); }
+ std::string GetControlType() const final { return std::string(control_type); }
render::RenderObject* GetRenderObject() const override;
diff --git a/include/cru/ui/controls/TreeView.h b/include/cru/ui/controls/TreeView.h
index 6c3c360b..dc74750a 100644
--- a/include/cru/ui/controls/TreeView.h
+++ b/include/cru/ui/controls/TreeView.h
@@ -52,14 +52,16 @@ class CRU_UI_API TreeViewItem : public Object {
class CRU_UI_API TreeView : public Control {
public:
- constexpr static StringView kControlType = u"TreeView";
+ constexpr static std::string_view kControlType = "TreeView";
TreeView();
CRU_DELETE_COPY(TreeView)
CRU_DELETE_MOVE(TreeView)
~TreeView() override;
- String GetControlType() const override { return kControlType.ToString(); }
+ std::string GetControlType() const override {
+ return std::string(kControlType);
+ }
render::TreeRenderObject* GetRenderObject() { return &render_object_; }
void ForEachChild(const std::function<void(Control*)>& predicate) override;
diff --git a/include/cru/ui/controls/Window.h b/include/cru/ui/controls/Window.h
index 656a96dd..c4ba94d9 100644
--- a/include/cru/ui/controls/Window.h
+++ b/include/cru/ui/controls/Window.h
@@ -1,5 +1,4 @@
#pragma once
-#include "cru/platform/gui/Base.h"
#include "cru/ui/controls/RootControl.h"
#include "cru/base/Base.h"
@@ -7,7 +6,7 @@
namespace cru::ui::controls {
class CRU_UI_API Window final : public RootControl {
public:
- static constexpr StringView control_type = u"Window";
+ static constexpr std::string_view control_type = "Window";
public:
explicit Window(Control* attached_control = nullptr);
@@ -16,6 +15,6 @@ class CRU_UI_API Window final : public RootControl {
~Window() override;
public:
- String GetControlType() const final { return control_type.ToString(); }
+ std::string GetControlType() const final { return std::string(control_type); }
};
} // namespace cru::ui::controls