X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6c33b24c53c51b4053f898524a920eafba155ed0..bba35861478a26f5d8c756a9a7fa2bbd19a69cb1:/src/motif/scrolbar.cpp diff --git a/src/motif/scrolbar.cpp b/src/motif/scrolbar.cpp index 9025adcefc..587be3ca89 100644 --- a/src/motif/scrolbar.cpp +++ b/src/motif/scrolbar.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: scrolbar.cpp +// Name: src/motif/scrolbar.cpp // Purpose: wxScrollBar // Author: Julian Smart // Modified by: @@ -9,11 +9,9 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "scrolbar.h" -#endif +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" -#include "wx/defs.h" #include "wx/scrolbar.h" #ifdef __VMS__ @@ -41,6 +39,7 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, { if( !CreateControl( parent, id, pos, size, style, validator, name ) ) return false; + PreCreation(); wxSize newSize = ( style & wxHORIZONTAL ) ? wxSize( 140, 16 ) : wxSize( 16, 140 ); @@ -54,9 +53,9 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, (wxOrientation)(style & (wxHORIZONTAL|wxVERTICAL)), (void (*)())wxScrollBarCallback ); + PostCreation(); AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, newSize.x, newSize.y); - ChangeBackgroundColour(); return true; } @@ -103,7 +102,7 @@ void wxScrollBar::SetScrollbar(int position, int thumbSize, int range, int pageS void wxScrollBar::Command(wxCommandEvent& event) { - SetThumbPosition(event.m_commandInt); + SetThumbPosition(event.GetInt()); ProcessCommand(event); } @@ -126,7 +125,9 @@ static void wxScrollBarCallback(Widget widget, XtPointer clientData, XmScaleCallbackStruct *cbs) { wxScrollBar *scrollBar = (wxScrollBar*)wxGetWindowFromTable(widget); - wxOrientation orientation = (wxOrientation)(int)clientData; + wxCHECK_RET( scrollBar, _T("invalid widget in scrollbar callback") ); + + wxOrientation orientation = (wxOrientation)wxPtrToUInt(clientData); wxEventType eventType = wxEVT_NULL; switch (cbs->reason) @@ -182,5 +183,5 @@ static void wxScrollBarCallback(Widget widget, XtPointer clientData, wxScrollEvent event(eventType, scrollBar->GetId(), cbs->value, orientation); event.SetEventObject(scrollBar); - scrollBar->GetEventHandler()->ProcessEvent(event); + scrollBar->HandleWindowEvent(event); }