diff options
Diffstat (limited to 'include/cru/ui/components')
| -rw-r--r-- | include/cru/ui/components/Component.h | 2 | ||||
| -rw-r--r-- | include/cru/ui/components/Input.h | 16 | ||||
| -rw-r--r-- | include/cru/ui/components/Menu.h | 2 | ||||
| -rw-r--r-- | include/cru/ui/components/PopupButton.h | 4 | ||||
| -rw-r--r-- | include/cru/ui/components/Select.h | 4 |
5 files changed, 15 insertions, 13 deletions
diff --git a/include/cru/ui/components/Component.h b/include/cru/ui/components/Component.h index 1e002e5f..86012e59 100644 --- a/include/cru/ui/components/Component.h +++ b/include/cru/ui/components/Component.h @@ -15,7 +15,7 @@ class CRU_UI_API Component public: virtual controls::Control* GetRootControl() = 0; - bool IsDeleteByParent() const { return delete_by_parent_; } + bool IsDeleteByParent() { return delete_by_parent_; } void SetDeleteByParent(bool delete_by_parent) { delete_by_parent_ = delete_by_parent; } diff --git a/include/cru/ui/components/Input.h b/include/cru/ui/components/Input.h index 0f077983..3d56f5fa 100644 --- a/include/cru/ui/components/Input.h +++ b/include/cru/ui/components/Input.h @@ -9,7 +9,7 @@ struct CRU_UI_API InputValidateResult { }; struct CRU_UI_API IInputValidator : public virtual Interface { - virtual InputValidateResult Validate(std::string_view text) const = 0; + virtual InputValidateResult Validate(std::string_view text) = 0; }; struct CRU_UI_API InputChangeEventArgs { @@ -26,14 +26,14 @@ class CRU_UI_API Input : public Component { public: controls::Control* GetRootControl() override; - std::string GetText() const; + std::string GetText(); void SetText(std::string text); - IInputValidator* GetValidator() const; + IInputValidator* GetValidator(); void SetValidator(IInputValidator* validator); InputValidateResult Validate(); - InputValidateResult GetLastValidateResult() const; + InputValidateResult GetLastValidateResult(); IEvent<InputChangeEventArgs>* ChangeEvent() { return &change_event_; } @@ -48,7 +48,7 @@ class CRU_UI_API Input : public Component { class CRU_UI_API FloatInputValidator : public Object, public virtual IInputValidator { public: - InputValidateResult Validate(std::string_view text) const override; + InputValidateResult Validate(std::string_view text) override; std::optional<float> min; std::optional<float> max; @@ -60,13 +60,13 @@ class CRU_UI_API FloatInput : public Input { ~FloatInput() override; public: - float GetValue() const; + float GetValue(); void SetValue(float value); - std::optional<float> GetMax() const; + std::optional<float> GetMax(); void SetMax(std::optional<float> max); - std::optional<float> GetMin() const; + std::optional<float> GetMin(); void SetMin(std::optional<float> min); private: diff --git a/include/cru/ui/components/Menu.h b/include/cru/ui/components/Menu.h index a8a90ed7..aee23894 100644 --- a/include/cru/ui/components/Menu.h +++ b/include/cru/ui/components/Menu.h @@ -38,7 +38,7 @@ class CRU_UI_API Menu : public Component { public: controls::Control* GetRootControl() override { return &container_; } - Index GetItemCount() const { return static_cast<Index>(items_.size()); } + Index GetItemCount() { return static_cast<Index>(items_.size()); } void AddItem(Component* component) { AddItemAt(component, GetItemCount()); } void AddItemAt(Component* component, Index index); diff --git a/include/cru/ui/components/PopupButton.h b/include/cru/ui/components/PopupButton.h index 0e3d5314..61ac6280 100644 --- a/include/cru/ui/components/PopupButton.h +++ b/include/cru/ui/components/PopupButton.h @@ -18,7 +18,9 @@ class CRU_UI_API PopupMenuTextButton : public Component { ui::controls::Button* GetButton() { return &button_; } std::string GetButtonText() { return button_text_.GetText(); } - void SetButtonText(std::string text) { button_text_.SetText(std::move(text)); } + void SetButtonText(std::string text) { + button_text_.SetText(std::move(text)); + } void SetButtonTextColor(const Color& color) { button_text_.SetTextColor(color); diff --git a/include/cru/ui/components/Select.h b/include/cru/ui/components/Select.h index 9efe9a04..67b18383 100644 --- a/include/cru/ui/components/Select.h +++ b/include/cru/ui/components/Select.h @@ -13,10 +13,10 @@ class CRU_UI_API Select : public Component { public: ui::controls::Control* GetRootControl() override { return &button_; } - std::vector<std::string> GetItems() const { return items_; } + std::vector<std::string> GetItems() { return items_; } void SetItems(std::vector<std::string> items); - Index GetSelectedIndex() const { return selected_index_; } + Index GetSelectedIndex() { return selected_index_; } void SetSelectedIndex(Index index); IEvent<Index>* ItemSelectedEvent() { return &item_selected_event_; } |
