|
From: <ma...@us...> - 2003-12-30 08:18:19
|
Update of /cvsroot/sharedaemon/ui-wx/src
In directory sc8-pr-cvs1:/tmp/cvs-serv19614
Modified Files:
MainDlg.cpp
Log Message:
Gotta be the ugliest #ifdefing I have ever done, but - now toolbar controls work correctly in wxGTK
Index: MainDlg.cpp
===================================================================
RCS file: /cvsroot/sharedaemon/ui-wx/src/MainDlg.cpp,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- MainDlg.cpp 30 Dec 2003 07:51:23 -0000 1.49
+++ MainDlg.cpp 30 Dec 2003 08:18:15 -0000 1.50
@@ -351,8 +351,9 @@
/* 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 :(((( */
+ #ifdef __WXMSW__ /* Doesn't work in vertical MSW toolbar either :(((( */
if (tool_align == wxTB_HORIZONTAL) {
+ #endif
names.Add(_("Connect"));
names.Add(_("Log"));
ids[1] = ID_BTN_CONNECT;
@@ -362,17 +363,20 @@
tb->AddControl(new MMultiButton(tb, -1, 2, names, ids, images));
images.Clear();
names.Clear();
- } else
-#endif
+ #ifdef __WXMSW__
+ } else
+ #endif
+#elif !defined(__WXGTK__)
{
tb->AddTool(
- ID_BTN_CONNECT, _("Connect"),
+ ID_BTN_CONNECT, _("Connect"),
img->GetImage(wxT("btn_connect")),
img->GetImage(wxT("btn_connect")),
wxITEM_NORMAL, _("Connect to random server"),
_("Connect to random server")
);
}
+#endif
/* Go through list of our pages and add all of them */
for (i=0;i<pages.GetCount();i++) {
@@ -404,8 +408,9 @@
/* 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 :(((( */
+ #ifdef __WXMSW__ /* Doesn't work in vertical MSW toolbar either :(((( */
if (tool_align == wxTB_HORIZONTAL) {
+ #endif
names.Add(_("Options"));
names.Add(_("Help"));
ids[0] = ID_BTN_GUISETTINGS;
@@ -415,17 +420,20 @@
tb->AddControl(new MMultiButton(tb, -1, 2, names, ids, images));
images.Clear();
names.Clear();
- } else
-#endif
+ #ifdef __WXMSW__
+ } else
+ #endif
+#elif !defined(__WXGTK__)
{
tb->AddTool(
- ID_BTN_GUISETTINGS, _("Options"),
+ ID_BTN_GUISETTINGS, _("Options"),
img->GetImage(wxT("btn_guisettings")),
img->GetImage(wxT("btn_guisettings")),
wxITEM_NORMAL, wxT("Change GUI Settings"),
wxT("Change GUI Settings")
);
}
+#endif
tb->Realize();
SetToolBar(tb);
|