]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/slider.cpp
made wxFFile a bit more safe: don't crash when Tell() and Length() are called on...
[wxWidgets.git] / src / mac / slider.cpp
index 94c90786e5d2ee98359b61e433f4987cf28b12d4..4bd4bab5325fa0f31f5847b5ff6e3bcc0ad4e429 100644 (file)
@@ -57,6 +57,9 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id,
                       const wxValidator& validator,
                       const wxString& name)
 {
+    if ( !wxControl::Create(parent, id, pos, size, style, validator, name) )
+        return false;
+
     Rect bounds ;
     Str255 title ;
     SInt16 procID;
@@ -238,13 +241,20 @@ void wxSlider::Command (wxCommandEvent & event)
     ProcessCommand (event);
 }
 
-void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart, bool WXUNUSED(mouseStillDown) ) 
+void wxSlider::MacHandleControlClick( WXWidget control , wxInt16 controlpart, bool mouseStillDown ) 
 {
     SInt16 value = ::GetControl32BitValue( (ControlHandle) m_macControl ) ;
     
     SetValue( value ) ;        
     
-    wxScrollEvent event(wxEVT_SCROLL_THUMBTRACK, m_windowId);
+    wxEventType scrollEvent = wxEVT_NULL ;
+    
+   if ( mouseStillDown )
+        scrollEvent = wxEVT_SCROLL_THUMBTRACK;
+    else
+        scrollEvent = wxEVT_SCROLL_THUMBRELEASE;
+    
+    wxScrollEvent event(scrollEvent, m_windowId);
     event.SetPosition(value);
     event.SetEventObject( this );
     GetEventHandler()->ProcessEvent(event);