X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/93e73c740e6cdd6d498439aeb731fe5f3e75ea8d..d989875a52208e35afbcbd04de7758089e06b985:/src/motif/slider.cpp diff --git a/src/motif/slider.cpp b/src/motif/slider.cpp index 0cf3134f88..6b012f2964 100644 --- a/src/motif/slider.cpp +++ b/src/motif/slider.cpp @@ -1,20 +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 ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#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 @@ -30,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) @@ -60,6 +64,7 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id, if( !CreateControl( parent, id, pos, size, style, validator, name ) ) return false; + PreCreation(); m_lineSize = 1; m_windowStyle = style; @@ -86,30 +91,13 @@ 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); - SetCanAddEventHandler(TRUE); + PostCreation(); AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y); - ChangeBackgroundColour(); - - return TRUE; + return true; } wxSlider::~wxSlider() @@ -229,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); @@ -240,3 +230,4 @@ void wxSliderCallback (Widget widget, XtPointer clientData, slider->GetEventHandler()->ProcessEvent(event2); } +#endif // wxUSE_SLIDER