Update of /cvsroot/sharedaemon/ui-wx/src
In directory sc8-pr-cvs1:/tmp/cvs-serv23175
Modified Files:
Images.cpp MBitmapButton.cpp
Log Message:
Fixed toolbar/multibutton text problems on wxGTK2 and wxMac
Index: Images.cpp
===================================================================
RCS file: /cvsroot/sharedaemon/ui-wx/src/Images.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- Images.cpp 30 Dec 2003 13:33:36 -0000 1.51
+++ Images.cpp 30 Dec 2003 15:47:23 -0000 1.52
@@ -325,7 +325,7 @@
#ifdef __WXMSW__ /* This gives transparent image on wxMSW */
mdc.SetBrush(wxBrush(*wxLIGHT_GREY, wxSOLID));
#else /* Elsewhere, it will be done with wxMask later */
- mdc.SetBrush(wxBrush(wxColour(0, 0, 0), wxSOLID));
+ mdc.SetBrush(wxBrush(wxColour(255, 255, 255), wxSOLID));
#endif
mdc.DrawRectangle(
0, 0, tmp_new.GetWidth(), tmp_new.GetHeight()
@@ -338,14 +338,14 @@
mdc.SetTextForeground(
wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT)
);
-#else /* However, it doesn't work anywhere else, so use 50,50,50 instead */
- mdc.SetTextForeground(wxColour(50, 50, 50));
+#else /* However, it doesn't work anywhere else, so use 0, 0, 0 instead */
+ mdc.SetTextForeground(wxColour(0, 0, 0));
#endif
mdc.GetTextExtent(name, &x, &y);
mdc.DrawText(name, (tmp_new.GetWidth()-x)/2, 36);
#ifndef __WXMSW__ /* Use wxMask for transparency */
wxMask *tmp_mask;
- tmp_mask = new wxMask(tmp_new, wxColour(0,0,0));
+ tmp_mask = new wxMask(tmp_new, wxColour(255, 255, 255));
tmp_new.SetMask(tmp_mask);
#endif
mdc.EndDrawing();
Index: MBitmapButton.cpp
===================================================================
RCS file: /cvsroot/sharedaemon/ui-wx/src/MBitmapButton.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- MBitmapButton.cpp 30 Dec 2003 13:33:36 -0000 1.11
+++ MBitmapButton.cpp 30 Dec 2003 15:47:23 -0000 1.12
@@ -135,17 +135,21 @@
);
mdc.SelectObject(tmp);
-#ifdef __WXMSW__ /* This gives transparent image on wxMSW */
mdc.SetPen(*wxTRANSPARENT_PEN);
+
+#ifdef __WXMSW__ /* This gives transparent image on wxMSW */
mdc.SetBrush(wxBrush(*wxLIGHT_GREY, wxSOLID));
#else /* Elsewhere, it will be done with wxMask later */
- mdc.SetBrush(wxBrush(wxColour(0, 0, 0), wxSOLID));
+ mdc.SetBrush(wxBrush(wxColour(255, 255, 255), wxSOLID));
#endif
+
mdc.DrawRectangle(0, 0, tmp.GetWidth(), tmp.GetHeight());
mdc.DrawBitmap(orig_img, 0, 0, true);
+
#ifndef __WXMSW__
- tmp.SetMask(new wxMask(tmp, wxColour(0, 0, 0)));
+ tmp.SetMask(new wxMask(tmp, wxColour(255, 255, 255)));
#endif
+
SetBitmapLabel(tmp);
event.Skip();
@@ -179,7 +183,7 @@
#ifdef __WXMSW__ /* This gives transparent image on wxMSW */
mdc.SetBrush(wxBrush(*wxLIGHT_GREY, wxSOLID));
#else /* Elsewhere, it will be done with wxMask later */
- mdc.SetBrush(wxBrush(wxColour(0, 0, 0), wxSOLID));
+ mdc.SetBrush(wxBrush(wxColour(255, 255, 255), wxSOLID));
#endif
mdc.DrawRectangle(0, 0, tmp->GetWidth(), tmp->GetHeight());
@@ -187,14 +191,21 @@
bitmap, 5, ((y-bitmap.GetHeight())/2)+BITMAP_Y_POS_OFFSET, true
);
- mdc.SetTextForeground(wxColour(50, 50, 50));
+#ifdef __WXMSW__ /* Well, this gives correct colour on MSW */
+ mdc.SetTextForeground(
+ wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT)
+ );
+#else /* However, it doesn't work anywhere else, so use 0, 0, 0 instead */
+ mdc.SetTextForeground(wxColour(0, 0, 0));
+#endif
+
mdc.DrawText(
m_name, bitmap.GetWidth()+10,
((tmp->GetHeight()-GetCharHeight())/2)+TEXT_Y_POS_OFFSET
);
#ifndef __WXMSW__
- tmp->SetMask(new wxMask(*tmp, wxColour(0, 0, 0)));
+ tmp->SetMask(new wxMask(*tmp, wxColour(255, 255, 255)));
#endif
SetBitmapLabel(*tmp);
orig_img = *tmp;
|