From ccf6abe8994020af1bd96b21314a83e05250e892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Hansen?= Date: Sat, 13 Apr 2024 12:01:18 +0200 Subject: [PATCH] Add some documentation for AutoLayout --- vstgui/lib/crowcolumnview.cpp | 11 ++++++++++- vstgui/lib/crowcolumnview.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/vstgui/lib/crowcolumnview.cpp b/vstgui/lib/crowcolumnview.cpp index 5fa4c0953..a795892f6 100644 --- a/vstgui/lib/crowcolumnview.cpp +++ b/vstgui/lib/crowcolumnview.cpp @@ -181,7 +181,15 @@ CRect computeGroupRect (const CViewContainer& parent, const Alignment alignment, } //-------------------------------------------------------------------------------- -// AutoLayout +// AutoLayout Declaration +/// @brief An auto layout feature for the CRowColumnView +/// +/// The AutoLayout flexibly layouts the children of a CRowColumnView. The children are grouped and +/// aligned among themselves depending on whether the style is a row (left to right) or a +/// column (top to bottom). The group is moved inside the parent to either of the nine +/// positions (top-left, top-center, top-right, middle-left, middle-center, middle-right, +/// bottom-left, bottom-center or bottom-right). If the size of the parent is changed, the layout +/// and alignment of the group is always retained. //-------------------------------------------------------------------------------- class AutoLayout { @@ -194,6 +202,7 @@ class AutoLayout groupRect = Layouting::computeGroupRect (parent, alignment, style, spacing); } + /** moves the child rect to the calculated position (inside the group and inside the parent) */ auto moveRect (CRect& viewSize) -> CRect& { // Offset the viewSize inside the groupRect... diff --git a/vstgui/lib/crowcolumnview.h b/vstgui/lib/crowcolumnview.h index 427f98e98..8658cb299 100644 --- a/vstgui/lib/crowcolumnview.h +++ b/vstgui/lib/crowcolumnview.h @@ -56,6 +56,7 @@ class CRowColumnView : public CAutoLayoutContainerView /** stretch subviews to the same width and height */ kStretchEqualy, + /** options for the auto layout feature */ kTopLeft, kTopCenter, kTopRight,