Skip to content

Commit

Permalink
Add some documentation for AutoLayout
Browse files Browse the repository at this point in the history
  • Loading branch information
rehans committed Apr 13, 2024
1 parent b011bd3 commit ccf6abe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion vstgui/lib/crowcolumnview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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...
Expand Down
1 change: 1 addition & 0 deletions vstgui/lib/crowcolumnview.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ccf6abe

Please sign in to comment.