From: <ma...@us...> - 2003-12-30 07:51:26
|
Update of /cvsroot/sharedaemon/ui-wx/src In directory sc8-pr-cvs1:/tmp/cvs-serv15837 Modified Files: MainDlg.cpp Log Message: Well, wxMac, wxMotif, wxX11 and generic native toolbars dont support controls. Furthermore, MSW vertical toolbar doesnt support it either. Summary: Use our cool custom controls in toolbar only in wxMSW horizontal toolbar, and wxGTK hor/vert toolbar. Index: MainDlg.cpp =================================================================== RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- MainDlg.cpp 29 Dec 2003 11:24:30 -0000 1.48 +++ MainDlg.cpp 30 Dec 2003 07:51:23 -0000 1.49 @@ -327,14 +327,16 @@ ); if (start_up || gen_images) { - wxArrayString names; for (i=0;i<pages.GetCount();i++) { if (pages.IsEmpty()) { break; } names.Add(pages.Item(i)->GetKeyString()); } + names.Add(_("Connect")); + names.Add(_("Options")); img->CalcToolBitmapSize(names); + names.Clear(); } tb->SetToolBitmapSize( @@ -342,16 +344,37 @@ ); tb->SetMargins(2, 2); - names.Add(_("Connect")); - names.Add(_("Log")); - ids[1] = ID_BTN_CONNECT; - ids[1] = ID_BTN_LOG; - images.Add(wxT("connection")); - images.Add(wxT("log")); - tb->AddControl(new MMultiButton(tb, -1, 2, names, ids, images)); - images.Clear(); - names.Clear(); + if (gen_images) { + img->MakeToolImage(_("Connect"), wxT("btn_connect")); + } + +/* Neither the generic nor Motif native toolbars really support this :( */ +#if (wxUSE_TOOLBAR_NATIVE && !USE_GENERIC_TBAR) && !defined(__WXMOTIF__) && \ + !defined(__WXX11__) && !defined(__WXMAC__) + /* Doesn't work in vertical toolbar either :(((( */ + if (tool_align == wxTB_HORIZONTAL) { + names.Add(_("Connect")); + names.Add(_("Log")); + ids[1] = ID_BTN_CONNECT; + ids[1] = ID_BTN_LOG; + images.Add(wxT("connection")); + images.Add(wxT("log")); + tb->AddControl(new MMultiButton(tb, -1, 2, names, ids, images)); + images.Clear(); + names.Clear(); + } else +#endif + { + tb->AddTool( + ID_BTN_CONNECT, _("Connect"), + img->GetImage(wxT("btn_connect")), + img->GetImage(wxT("btn_connect")), + wxITEM_NORMAL, _("Connect to random server"), + _("Connect to random server") + ); + } + /* Go through list of our pages and add all of them */ for (i=0;i<pages.GetCount();i++) { if (pages.IsEmpty()){ break; @@ -373,15 +396,36 @@ ); } - names.Add(_("Options")); - names.Add(_("Help")); - ids[0] = ID_BTN_GUISETTINGS; - ids[1] = ID_BTN_HELP; - images.Add(wxT("options")); - images.Add(wxT("help")); - tb->AddControl(new MMultiButton(tb, -1, 2, names, ids, images)); - images.Clear(); - names.Clear(); + if (gen_images) { + img->MakeToolImage( + _("Options"), wxT("btn_guisettings") + ); + } +/* Neither the generic nor Motif native toolbars really support this :( */ +#if (wxUSE_TOOLBAR_NATIVE && !USE_GENERIC_TBAR) && !defined(__WXMOTIF__) && \ + !defined(__WXX11__) && !defined(__WXMAC__) + /* Doesn't work in vertical toolbar either :(((( */ + if (tool_align == wxTB_HORIZONTAL) { + names.Add(_("Options")); + names.Add(_("Help")); + ids[0] = ID_BTN_GUISETTINGS; + ids[1] = ID_BTN_HELP; + images.Add(wxT("options")); + images.Add(wxT("help")); + tb->AddControl(new MMultiButton(tb, -1, 2, names, ids, images)); + images.Clear(); + names.Clear(); + } else +#endif + { + tb->AddTool( + ID_BTN_GUISETTINGS, _("Options"), + img->GetImage(wxT("btn_guisettings")), + img->GetImage(wxT("btn_guisettings")), + wxITEM_NORMAL, wxT("Change GUI Settings"), + wxT("Change GUI Settings") + ); + } tb->Realize(); SetToolBar(tb); |