aboutsummaryrefslogtreecommitdiff
path: root/src/ui/control.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/control.hpp')
-rw-r--r--src/ui/control.hpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/ui/control.hpp b/src/ui/control.hpp
index 2ca5fa9e..4374983b 100644
--- a/src/ui/control.hpp
+++ b/src/ui/control.hpp
@@ -124,6 +124,13 @@ namespace cru::ui
//*************** region: graphic ***************
+ bool IsClipToPadding() const
+ {
+ return clip_to_padding_;
+ }
+
+ void SetClipToPadding(bool clip);
+
//Draw this control and its child controls.
void Draw(ID2D1DeviceContext* device_context);
@@ -264,12 +271,11 @@ namespace cru::ui
//Invoked when the control is detached to a window. Overrides should invoke base.
virtual void OnDetachToWindow(Window* window);
+ //*************** region: graphic events ***************
private:
+ void OnDrawDecoration(ID2D1DeviceContext* device_context);
void OnDrawCore(ID2D1DeviceContext* device_context);
-
protected:
-
- //*************** region: graphic events ***************
virtual void OnDrawContent(ID2D1DeviceContext* device_context);
virtual void OnDrawForeground(ID2D1DeviceContext* device_context);
virtual void OnDrawBackground(ID2D1DeviceContext* device_context);
@@ -364,10 +370,8 @@ namespace cru::ui
private:
bool is_container_;
- protected:
- Window * window_ = nullptr; // protected for Window class to write it as itself in constructor.
+ Window * window_ = nullptr;
- private:
Control * parent_ = nullptr;
std::vector<Control*> children_{};
@@ -397,6 +401,8 @@ namespace cru::ui
bool is_bordered_ = false;
BorderProperty border_property_;
+ bool clip_to_padding_ = false;
+
Microsoft::WRL::ComPtr<ID2D1Geometry> border_geometry_ = nullptr;
Microsoft::WRL::ComPtr<ID2D1Geometry> in_border_geometry_ = nullptr; //used for foreground and background brush.