From 22322daf6f51da53740ff95ef2eaceed9a6efcae Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 25 Nov 2018 22:57:07 +0800 Subject: Develop basic functions of ScrollControl. --- src/ui/control.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/ui/control.hpp') 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 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. -- cgit v1.2.3