diff options
author | crupest <crupest@outlook.com> | 2019-03-20 19:26:55 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-03-20 19:26:55 +0800 |
commit | 616ebd78b543876388cb3d64f108abea041d4983 (patch) | |
tree | 8cae90f29695a3bd534b3ae5e32218d79719ba91 /src/ui/controls/toggle_button.hpp | |
parent | d518396a7fcdb2add413a9a37bb34515ff4f4cc4 (diff) | |
download | cru-616ebd78b543876388cb3d64f108abea041d4983.tar.gz cru-616ebd78b543876388cb3d64f108abea041d4983.tar.bz2 cru-616ebd78b543876388cb3d64f108abea041d4983.zip |
...
Diffstat (limited to 'src/ui/controls/toggle_button.hpp')
-rw-r--r-- | src/ui/controls/toggle_button.hpp | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/src/ui/controls/toggle_button.hpp b/src/ui/controls/toggle_button.hpp deleted file mode 100644 index dee655d4..00000000 --- a/src/ui/controls/toggle_button.hpp +++ /dev/null @@ -1,57 +0,0 @@ -#pragma once - -// ReSharper disable once CppUnusedIncludeDirective -#include "pre.hpp" - -#include "ui/control.hpp" - -namespace cru::ui::controls -{ - class ToggleButton : public NoChildControl - { - public: - static constexpr auto control_type = L"ToggleButton"; - - static ToggleButton* Create() - { - return new ToggleButton(); - } - - protected: - ToggleButton(); - - public: - ToggleButton(const ToggleButton& other) = delete; - ToggleButton(ToggleButton&& other) = delete; - ToggleButton& operator=(const ToggleButton& other) = delete; - ToggleButton& operator=(ToggleButton&& other) = delete; - ~ToggleButton() override = default; - - StringView GetControlType() const override final; - - bool IsPointInside(const Point& point) override; - - bool GetState() const - { - return state_; - } - - void SetState(bool state); - - void Toggle(); - - Event<events::ToggleEventArgs> toggle_event; - - protected: - Size OnMeasureContent(const Size& available_size, const AdditionalMeasureInfo&) override; - - private: - bool state_ = false; - - float current_circle_position_; - - Microsoft::WRL::ComPtr<ID2D1RoundedRectangleGeometry> frame_path_; - Microsoft::WRL::ComPtr<ID2D1Brush> on_brush_; - Microsoft::WRL::ComPtr<ID2D1Brush> off_brush_; - }; -} |