X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2d120f8391920145647ec10e84629bc21fa9f1bb..f92722960b2a15f813cc62a23ecb321bc0555099:/src/motif/checkbox.cpp?ds=sidebyside diff --git a/src/motif/checkbox.cpp b/src/motif/checkbox.cpp index b9215f9d6a..160e3a6c81 100644 --- a/src/motif/checkbox.cpp +++ b/src/motif/checkbox.cpp @@ -14,6 +14,7 @@ #endif #include "wx/checkbox.h" +#include "wx/utils.h" #include #include @@ -42,7 +43,7 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, m_windowStyle = style; m_backgroundColour = parent->GetBackgroundColour(); m_foregroundColour = parent->GetForegroundColour(); - m_windowFont = parent->GetFont(); + m_font = parent->GetFont(); if (parent) parent->AddChild(this); @@ -55,7 +56,7 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, XmString text = XmStringCreateSimple (label1); Widget parentWidget = (Widget) parent->GetClientWidget(); - XmFontList fontList = (XmFontList) m_windowFont.GetFontList(1.0, XtDisplay(parentWidget)); + XmFontList fontList = (XmFontList) m_font.GetFontList(1.0, XtDisplay(parentWidget)); m_mainWidget = (WXWidget) XtVaCreateManagedWidget ("toggle", xmToggleButtonWidgetClass, parentWidget, @@ -117,12 +118,12 @@ bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, const wxBitmap *l return FALSE; } -void wxBitmapCheckBox::SetLabel(const wxBitmap *bitmap) +void wxBitmapCheckBox::SetLabel(const wxBitmap& bitmap) { // TODO } -void wxBitmapCheckBox::SetSize(int x, int y, int width, int height, int sizeFlags) +void wxBitmapCheckBox::DoSetSize(int x, int y, int width, int height, int sizeFlags) { // TODO } @@ -169,8 +170,13 @@ void wxCheckBox::ChangeBackgroundColour() XmNforeground, g_itemColors[wxFORE_INDEX].pixel, NULL); + int selectPixel = wxBLACK->AllocColour(wxGetDisplay()); + + // Better to have the checkbox selection in black, or it's + // hard to determine what state it is in. XtVaSetValues ((Widget) m_mainWidget, - XmNselectColor, g_itemColors[wxSELE_INDEX].pixel, + // XmNselectColor, g_itemColors[wxSELE_INDEX].pixel, + XmNselectColor, selectPixel, NULL); }