Rework parentage and naming of dialog controls.

All controls now store a reference to their direct parent,
whether it be the dialog itself or a container control.

Every dialog control now has a guaranteed parent, which abstracts away
the three possible types of parents (dialog, container, and plain window).

The control name is now stored in the control from the moment it is parsed from the XML.
This means that it's set before the parseContent function, though after parseAttribute.
This commit is contained in:
2025-03-01 00:15:32 -05:00
committed by Celtic Minstrel
parent 5861268e8c
commit 9b05c23d15
30 changed files with 351 additions and 323 deletions

View File

@@ -215,7 +215,8 @@ int main(int argc, char* argv[]) {
}
static void init_sbar(std::shared_ptr<cScrollbar>& sbar, const std::string& name, rectangle rect, rectangle events_rect, int pgSz) {
sbar.reset(new cScrollbar(mainPtr));
static cParentless mainWin(mainPtr);
sbar.reset(new cScrollbar(mainWin));
sbar->setBounds(rect);
sbar->set_wheel_event_rect(events_rect);
sbar->setPageSize(pgSz);