From: <ma...@us...> - 2003-11-27 13:43:46
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv1953 Modified Files: MainDlg.cpp Log Message: Create toolbar/menubar as first thing on startup, perhaps THIS fixes `toolbar missing on startup on mac` bug?! Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- MainDlg.cpp 27 Nov 2003 10:01:54 -0000 1.15 +++ MainDlg.cpp 27 Nov 2003 13:43:43 -0000 1.16 @@ -63,6 +63,12 @@ int height, width, posx, posy; start_up = true; + /** + * Create toolbar and menubar + */ + CreateMyToolBar(); + CreateMyMenuBar(); + /* Set application icon */ wxIcon icon; icon.CopyFromBitmap(img->GetImage(wxT("mule"))); @@ -112,13 +118,8 @@ /* Load dialog pages */ LoadAndShowDialogPages(); - /** - * Toolbar and Menubar must be created AFTER loading dialog pages, - * since they do calls to GetCurPage() which results in crash - * if pages haven't been loaded yet. - */ - CreateMyToolBar(); - CreateMyMenuBar(); + UpdateToolButtons(); + UpdateMenuBar(); } /* @@ -283,31 +284,8 @@ tb->Realize(); SetToolBar(tb); tb->Refresh(); - - /** - * Last, but not least, we tell the toolbar which button should - * initially toggled. - */ - if (activewnd == serverwnd) { - tb->ToggleTool(ID_BTN_SERVERS, true); - } - if (activewnd == searchwnd) { - tb->ToggleTool(ID_BTN_SEARCH, true); - } - if (activewnd == transferwnd) { - tb->ToggleTool(ID_BTN_TRANSFER, true); - } - if (activewnd == sharedfileswnd) { - tb->ToggleTool(ID_BTN_SHARED_FILES, true); - } - if (activewnd == messageswnd) { - tb->ToggleTool(ID_BTN_MESSAGES, true); - } - if (activewnd == statisticswnd) { - tb->ToggleTool(ID_BTN_STATISTICS, true); - } - Layout(); + UpdateToolButtons(); } /** @@ -468,6 +446,7 @@ menubar->Append(help_menu, _("Help")); SetMenuBar(menubar); + UpdateMenuBar(); } /** |