diff options
| author | crupest <crupest@outlook.com> | 2018-11-07 21:40:04 +0800 |
|---|---|---|
| committer | crupest <crupest@outlook.com> | 2018-11-07 21:40:04 +0800 |
| commit | efdce672123284847bd7fb6f12ac1ec96f28f3ef (patch) | |
| tree | 298e6313e9a48c5867b2355242b78d3cd23fdc61 /src/ui/controls/toggle_button.h | |
| parent | 634dab6ad2c9e4675beacfb77ac02b2d43cab132 (diff) | |
| download | cru-efdce672123284847bd7fb6f12ac1ec96f28f3ef.tar.gz cru-efdce672123284847bd7fb6f12ac1ec96f28f3ef.tar.bz2 cru-efdce672123284847bd7fb6f12ac1ec96f28f3ef.zip | |
Make all header *.hpp .
Diffstat (limited to 'src/ui/controls/toggle_button.h')
| -rw-r--r-- | src/ui/controls/toggle_button.h | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/src/ui/controls/toggle_button.h b/src/ui/controls/toggle_button.h deleted file mode 100644 index 6f3683de..00000000 --- a/src/ui/controls/toggle_button.h +++ /dev/null @@ -1,65 +0,0 @@ -#pragma once - -#include "ui/control.h" - -namespace cru::ui::controls -{ - class ToggleButton : public Control - { - 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(); - - public: - events::ToggleEvent toggle_event; - - protected: - virtual void OnToggle(events::ToggleEventArgs& args); - - protected: - void OnDrawContent(ID2D1DeviceContext* device_context) override; - - void OnMouseClickCore(events::MouseButtonEventArgs& args) override; - - Size OnMeasureContent(const Size& available_size) override; - - private: - void RaiseToggleEvent(bool new_state); - - 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_; - }; -} |
