AViewContainer#
A trivial modifiable view that represents a set of views.
Header: | #include <AUI/View/AViewContainer.h> |
CMake: | aui_link(my_target PUBLIC aui::views) |
Detailed Description#
AViewContainer can store, render, resize, provide events to and handle the child views.
AViewContainer does not control the position and size of the child views by itself; instead, it delegates that responsibility to it's layout manager.
Since AViewContainer is an instance of AView, AViewContainer can handle AViewContainers recursively, thus, making possible complex UI by nested AViewContainers with different layout managers.
Consider using AViewContainerBase as a base class when possible. Use AViewContainer if you want to expose view modifying methods such as addView, removeView, setContents, setLayout, etc. Use AViewContainerBase if these methods might cause unwanted interference with implementation details of your view.
Examples#
examples/app/minesweeper/src/MinesweeperWindow.cpp
Minesweeper Game - Minesweeper game implementation driven by ass.
},
},
_container<AStackedLayout>(
{ // also assign ".frame" ASS class in place
mGrid = _new<AViewContainer>() << ".frame" }) });
beginGame(10, 10, 20);
}
void MinesweeperWindow::openCell(int x, int y, bool doGameLoseIfBomb) {
examples/app/minesweeper/src/MinesweeperWindow.h
Minesweeper Game - Minesweeper game implementation driven by ass.