X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/655719367ac5e131d9642e5783f3ecf64d1a3385..cd7e925abb316e7f15632d486e4e51d46f893c66:/src/motif/slider.cpp diff --git a/src/motif/slider.cpp b/src/motif/slider.cpp index e11f1bb9ce..8e52931335 100644 --- a/src/motif/slider.cpp +++ b/src/motif/slider.cpp @@ -1,23 +1,24 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: slider.cpp +// Name: src/motif/slider.cpp // Purpose: wxSlider // Author: Julian Smart // Modified by: // 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" +#if wxUSE_SLIDER + #include "wx/slider.h" -#include "wx/utils.h" + +#ifndef WX_PRECOMP + #include "wx/utils.h" +#endif #ifdef __VMS__ #pragma message disable nosimpint @@ -33,7 +34,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 +90,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 +218,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 +231,4 @@ void wxSliderCallback (Widget widget, XtPointer clientData, slider->GetEventHandler()->ProcessEvent(event2); } +#endif // wxUSE_SLIDER