diff options
author | crupest <crupest@outlook.com> | 2018-11-25 22:57:07 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2018-11-25 22:57:07 +0800 |
commit | 22322daf6f51da53740ff95ef2eaceed9a6efcae (patch) | |
tree | 06b17b482e2e15cb0692d05b279c61cbd6923b4d /src/ui/control.hpp | |
parent | 5391e781e4682731721c841462904809bc618870 (diff) | |
download | cru-22322daf6f51da53740ff95ef2eaceed9a6efcae.tar.gz cru-22322daf6f51da53740ff95ef2eaceed9a6efcae.tar.bz2 cru-22322daf6f51da53740ff95ef2eaceed9a6efcae.zip |
Develop basic functions of ScrollControl.
Diffstat (limited to 'src/ui/control.hpp')
-rw-r--r-- | src/ui/control.hpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/ui/control.hpp b/src/ui/control.hpp index 6c5b0ea5..1ce4afe3 100644 --- a/src/ui/control.hpp +++ b/src/ui/control.hpp @@ -32,7 +32,7 @@ namespace cru::ui friend class Window; friend class LayoutManager; - private: + protected: struct GeometryInfo { Microsoft::WRL::ComPtr<ID2D1Geometry> border_geometry = nullptr; @@ -309,7 +309,12 @@ namespace cru::ui void RaisePositionChangedEvent(events::PositionChangedEventArgs& args); void RaiseSizeChangedEvent(events::SizeChangedEventArgs& args); - void RegenerateGeometries(); + void RegenerateGeometryInfo(); + + const GeometryInfo& GetGeometryInfo() const + { + return geometry_info_; + } //*************** region: mouse event *************** virtual void OnMouseEnter(events::MouseEventArgs& args); @@ -366,6 +371,9 @@ namespace cru::ui virtual Size OnMeasureContent(const Size& available_size); virtual void OnLayoutContent(const Rect& rect); + // Called by Layout after set position and size. + virtual void AfterLayoutSelf(); + private: // Only for layout manager to use. // Check if the old position is updated to current position. |