diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/controls/border_control.cpp | 34 | ||||
-rw-r--r-- | src/ui/controls/border_control.h | 61 |
2 files changed, 95 insertions, 0 deletions
diff --git a/src/ui/controls/border_control.cpp b/src/ui/controls/border_control.cpp new file mode 100644 index 00000000..9f33079c --- /dev/null +++ b/src/ui/controls/border_control.cpp @@ -0,0 +1,34 @@ +#include "border_control.h" + +namespace cru::ui::controls +{ + void BorderProperty::SetBrush(Microsoft::WRL::ComPtr<ID2D1Brush> brush) + { + brush_ = std::move(brush); + RaisePropertyChangedEvent(L"Brush"); + } + + void BorderProperty::SetWidth(const float width) + { + width_ = width; + RaisePropertyChangedEvent(L"Width"); + } + + void BorderProperty::SetStrokeStyle(Microsoft::WRL::ComPtr<ID2D1StrokeStyle> stroke_style) + { + stroke_style_ = std::move(stroke_style); + RaisePropertyChangedEvent(L"StrokeStyle"); + } + + void BorderProperty::SetRadiusX(const float radius_x) + { + radius_x_ = radius_x; + RaisePropertyChangedEvent(L"RadiusX"); + } + + void BorderProperty::SetRadiusY(const float radius_y) + { + radius_y_ = radius_y; + RaisePropertyChangedEvent(L"RadiusY"); + } +} diff --git a/src/ui/controls/border_control.h b/src/ui/controls/border_control.h new file mode 100644 index 00000000..582d2436 --- /dev/null +++ b/src/ui/controls/border_control.h @@ -0,0 +1,61 @@ +#pragma once + +#include "ui/control.h" + +namespace cru::ui::controls +{ + class BorderProperty : public PropertyChangedNotifyObject + { + public: + BorderProperty() = default; + BorderProperty(const BorderProperty& other) = delete; + BorderProperty(BorderProperty&& other) = delete; + BorderProperty& operator=(const BorderProperty& other) = delete; + BorderProperty& operator=(BorderProperty&& other) = delete; + ~BorderProperty() override = default; + + + Microsoft::WRL::ComPtr<ID2D1Brush> GetBrush() const + { + return brush_; + } + + float GetWidth() const + { + return width_; + } + + Microsoft::WRL::ComPtr<ID2D1StrokeStyle> GetStrokeStyle() const + { + return stroke_style_; + } + + float GetRadiusX() const + { + return radius_x_; + } + + float GetRadiusY() const + { + return radius_y_; + } + + void SetBrush(Microsoft::WRL::ComPtr<ID2D1Brush> brush); + void SetWidth(float width); + void SetStrokeStyle(Microsoft::WRL::ComPtr<ID2D1StrokeStyle> stroke_style); + void SetRadiusX(float radius_x); + void SetRadiusY(float radius_y); + + private: + Microsoft::WRL::ComPtr<ID2D1Brush> brush_ = nullptr; + float width_ = 1.0f; + Microsoft::WRL::ComPtr<ID2D1StrokeStyle> stroke_style_ = nullptr; + float radius_x_ = 0.0f; + float radius_y_ = 0.0f; + }; + + class BorderControl : public Control + { + + }; +} |