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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user