X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a4294b7832a5aed3c1cccc06aecd227d43da8830..a5e13868ca700aa39bae26b8fb13c640f466d9f0:/src/motif/checkbox.cpp?ds=inline diff --git a/src/motif/checkbox.cpp b/src/motif/checkbox.cpp index c71ed1a5ab..7d40ee4330 100644 --- a/src/motif/checkbox.cpp +++ b/src/motif/checkbox.cpp @@ -40,6 +40,8 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, SetName(name); SetValidator(validator); m_windowStyle = style; + m_backgroundColour = parent->GetBackgroundColour(); + m_foregroundColour = parent->GetForegroundColour(); if (parent) parent->AddChild(this); @@ -64,12 +66,13 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, XmToggleButtonSetState ((Widget) m_mainWidget, FALSE, TRUE); + m_windowFont = parent->GetFont(); + ChangeFont(FALSE); + SetCanAddEventHandler(TRUE); AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y); - ChangeColour(m_mainWidget); - SetFont(* parent->GetFont()); - + ChangeBackgroundColour(); return TRUE; } @@ -148,3 +151,30 @@ void wxCheckBoxCallback (Widget w, XtPointer clientData, event.SetEventObject(item); item->ProcessCommand (event); } + +void wxCheckBox::ChangeFont(bool keepOriginalSize) +{ + wxWindow::ChangeFont(keepOriginalSize); +} + +void wxCheckBox::ChangeBackgroundColour() +{ + wxComputeColours (XtDisplay((Widget) m_mainWidget), & m_backgroundColour, + (wxColour*) NULL); + + XtVaSetValues ((Widget) m_mainWidget, + XmNbackground, g_itemColors[wxBACK_INDEX].pixel, + XmNtopShadowColor, g_itemColors[wxTOPS_INDEX].pixel, + XmNbottomShadowColor, g_itemColors[wxBOTS_INDEX].pixel, + XmNforeground, g_itemColors[wxFORE_INDEX].pixel, + NULL); + + XtVaSetValues ((Widget) m_mainWidget, + XmNselectColor, g_itemColors[wxSELE_INDEX].pixel, + NULL); +} + +void wxCheckBox::ChangeForegroundColour() +{ + wxWindow::ChangeForegroundColour(); +}