X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/312ebad4cd1fad97a79aaed7102611df88806410..cc4d5638c66a409e421420ed7110917755a66788:/src/motif/slider.cpp diff --git a/src/motif/slider.cpp b/src/motif/slider.cpp index fdd2ff7358..1475196058 100644 --- a/src/motif/slider.cpp +++ b/src/motif/slider.cpp @@ -1,27 +1,23 @@ ///////////////////////////////////////////////////////////////////////////// -// 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 ///////////////////////////////////////////////////////////////////////////// -#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" + +#ifndef WX_PRECOMP + #include "wx/utils.h" +#endif #ifdef __VMS__ #pragma message disable nosimpint @@ -37,9 +33,7 @@ #include "wx/motif/private.h" -void wxSliderCallback (Widget widget, XtPointer clientData, XmScaleCallbackStruct * cbs); - -IMPLEMENT_DYNAMIC_CLASS(wxSlider, wxControl) +static void wxSliderCallback (Widget widget, XtPointer clientData, XmScaleCallbackStruct * cbs); BEGIN_EVENT_TABLE(wxSlider, wxControl) END_EVENT_TABLE() @@ -67,6 +61,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; @@ -93,28 +88,12 @@ 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); + PostCreation(); AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y); - ChangeBackgroundColour(); - return true; } @@ -235,15 +214,17 @@ 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); + slider->HandleWindowEvent(event); // Also send a wxCommandEvent for compatibility. - wxCommandEvent event2(wxEVT_COMMAND_SLIDER_UPDATED, slider->GetId()); + wxCommandEvent event2(wxEVT_SLIDER, slider->GetId()); event2.SetEventObject(slider); event2.SetInt( event.GetInt() ); - slider->GetEventHandler()->ProcessEvent(event2); + slider->HandleWindowEvent(event2); } #endif // wxUSE_SLIDER