]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/slider.cpp
thread fixes for MSW (samples doesn't compile currently under !MSW, will
[wxWidgets.git] / src / motif / slider.cpp
index a270c48241e6ff1e2d6291723afcf25e48789b8a..34aafd4a61a4972663f328983f940ec61d5df183 100644 (file)
@@ -99,10 +99,12 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
 
     XtAddCallback (sliderWidget, XmNdragCallback, (XtCallbackProc) wxSliderCallback, (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());
     ChangeBackgroundColour();
 
     return TRUE;
@@ -247,9 +249,9 @@ void wxSlider::Command (wxCommandEvent & event)
   ProcessCommand (event);
 }
 
-void wxSlider::ChangeFont()
+void wxSlider::ChangeFont(bool keepOriginalSize)
 {
-    wxWindow::ChangeFont();
+    wxWindow::ChangeFont(keepOriginalSize);
 }
 
 void wxSlider::ChangeBackgroundColour()
@@ -279,6 +281,11 @@ void wxSliderCallback (Widget widget, XtPointer clientData, XmScaleCallbackStruc
             XtVaGetValues (widget, XmNvalue, &event.m_commandInt, NULL);
             event.SetEventObject(slider);
             slider->ProcessCommand(event);
+
+            // Also send a wxCommandEvent for compatibility.
+            wxCommandEvent event2(wxEVT_COMMAND_SLIDER_UPDATED, slider->GetId());
+            event2.SetEventObject(slider);
+            slider->ProcessCommand(event2);
             break;
         }
     }