Tabs&Spaces

This commit is contained in:
Areloch 2018-02-08 16:04:50 -06:00
parent f237caff5e
commit 937ef6c33d

View file

@ -134,7 +134,7 @@ GuiCanvas::GuiCanvas(): GuiControl(),
mPlatformWindow(NULL), mPlatformWindow(NULL),
mDisplayWindow(true), mDisplayWindow(true),
mMenuBarCtrl(nullptr), mMenuBarCtrl(nullptr),
mMenuBackground(nullptr) mMenuBackground(nullptr)
{ {
setBounds(0, 0, 640, 480); setBounds(0, 0, 640, 480);
mAwake = true; mAwake = true;
@ -297,11 +297,11 @@ void GuiCanvas::setMenuBar(SimObject *obj)
mMenuBarCtrl = dynamic_cast<GuiControl*>(obj); mMenuBarCtrl = dynamic_cast<GuiControl*>(obj);
//remove old menubar //remove old menubar
if (oldMenuBar) if (oldMenuBar)
{ {
Parent::removeObject(oldMenuBar); Parent::removeObject(oldMenuBar);
Parent::removeObject(mMenuBackground); //also remove the modeless wrapper Parent::removeObject(mMenuBackground); //also remove the modeless wrapper
} }
// set new menubar // set new menubar
if (mMenuBarCtrl) if (mMenuBarCtrl)
@ -316,15 +316,15 @@ void GuiCanvas::setMenuBar(SimObject *obj)
return; return;
} }
if (mMenuBackground == nullptr) if (mMenuBackground == nullptr)
{ {
mMenuBackground = new GuiControl(); mMenuBackground = new GuiControl();
mMenuBackground->registerObject(); mMenuBackground->registerObject();
mMenuBackground->setControlProfile(profile); mMenuBackground->setControlProfile(profile);
} }
mMenuBackground->addObject(mMenuBarCtrl); mMenuBackground->addObject(mMenuBarCtrl);
Parent::addObject(mMenuBackground); Parent::addObject(mMenuBackground);
} }