]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/button.cpp
items without children couldn't be expanded even after a call to
[wxWidgets.git] / src / motif / button.cpp
index 8a8ae59c49965a69647dc69d2b681c4f032a60b8..c3f5be3ec4287d530eb782280b58d8fffa739b27 100644 (file)
@@ -38,6 +38,8 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label,
     SetName(name);
     SetValidator(validator);
     m_windowStyle = style;
+    m_backgroundColour = parent->GetBackgroundColour();
+    m_foregroundColour = parent->GetForegroundColour();
 
     parent->AddChild((wxButton *)this);
 
@@ -72,12 +74,13 @@ bool wxButton::Create(wxWindow *parent, wxWindowID id, const wxString& label,
     XtAddCallback ((Widget) m_mainWidget, XmNactivateCallback, (XtCallbackProc) wxButtonCallback,
             (XtPointer) this);
 
+    m_windowFont = parent->GetFont();
+    ChangeFont(FALSE);
 
     SetCanAddEventHandler(TRUE);
     AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);
 
-    SetFont(* parent->GetFont());
-    ChangeColour(m_mainWidget);
+    ChangeBackgroundColour();
 
     return TRUE;
 }
@@ -132,3 +135,19 @@ void wxButtonCallback (Widget w, XtPointer clientData, XtPointer ptr)
   event.SetEventObject(item);
   item->ProcessCommand (event);
 }
+
+void wxButton::ChangeFont(bool keepOriginalSize)
+{
+    wxWindow::ChangeFont(keepOriginalSize);
+}
+
+void wxButton::ChangeBackgroundColour()
+{
+    DoChangeBackgroundColour(m_mainWidget, m_backgroundColour, TRUE);
+}
+
+void wxButton::ChangeForegroundColour()
+{
+    wxWindow::ChangeForegroundColour();
+}
+