X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1248b41f9f71110347659db8c54c75786eba23c6..1e9bafca0f56de34638d4c3fef8cf74fe9351193:/src/motif/slider.cpp?ds=sidebyside diff --git a/src/motif/slider.cpp b/src/motif/slider.cpp index e11f1bb9ce..d82e67f19c 100644 --- a/src/motif/slider.cpp +++ b/src/motif/slider.cpp @@ -6,16 +6,16 @@ // Created: 17/09/98 // RCS-ID: $Id$ // Copyright: (c) Julian Smart -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) -#pragma implementation "slider.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" +#include "wx/defs.h" + +#if wxUSE_SLIDER + #include "wx/slider.h" #include "wx/utils.h" @@ -33,7 +33,7 @@ #include "wx/motif/private.h" -void wxSliderCallback (Widget widget, XtPointer clientData, XmScaleCallbackStruct * cbs); +static void wxSliderCallback (Widget widget, XtPointer clientData, XmScaleCallbackStruct * cbs); IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl) @@ -89,29 +89,15 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id, m_mainWidget = (WXWidget) sliderWidget; -#ifdef __VMS__ -#pragma message disable codcauunr - // VMS gives here the compiler warning : - // statement either is unreachable or causes unreachable code -#endif - if(style & wxSL_NOTIFY_DRAG) - XtAddCallback (sliderWidget, XmNdragCallback, - (XtCallbackProc) wxSliderCallback, (XtPointer) this); - else - XtAddCallback (sliderWidget, XmNvalueChangedCallback, - (XtCallbackProc) wxSliderCallback, (XtPointer) this); -#ifdef __VMS__ -#pragma message enable codcauunr -#endif - + XtAddCallback (sliderWidget, XmNvalueChangedCallback, (XtCallbackProc) wxSliderCallback, (XtPointer) this); XtAddCallback (sliderWidget, XmNdragCallback, (XtCallbackProc) wxSliderCallback, (XtPointer) this); - ChangeFont(FALSE); + ChangeFont(false); AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y); ChangeBackgroundColour(); - return TRUE; + return true; } wxSlider::~wxSlider() @@ -231,7 +217,9 @@ void wxSliderCallback (Widget widget, XtPointer clientData, } wxScrollEvent event(scrollEvent, slider->GetId()); - XtVaGetValues (widget, XmNvalue, &event.m_commandInt, NULL); + int commandInt = event.GetInt(); + XtVaGetValues (widget, XmNvalue, &commandInt, NULL); + event.SetInt(commandInt); event.SetEventObject(slider); slider->GetEventHandler()->ProcessEvent(event); @@ -242,3 +230,4 @@ void wxSliderCallback (Widget widget, XtPointer clientData, slider->GetEventHandler()->ProcessEvent(event2); } +#endif // wxUSE_SLIDER