]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/scrolbar.cpp
64 bit compilation fix for wxTextCtrl in wxMSW.
[wxWidgets.git] / src / motif / scrolbar.cpp
index 2fe66c299dc199ccd0af80644ce08dbaca814a5b..3b53a731df98cb44c38e6b507b288c48f3d36026 100644 (file)
@@ -1,5 +1,5 @@
 /////////////////////////////////////////////////////////////////////////////
-// Name:        scrolbar.cpp
+// Name:        src/motif/scrolbar.cpp
 // Purpose:     wxScrollBar
 // Author:      Julian Smart
 // Modified by:
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
-#include "wx/defs.h"
 #include "wx/scrolbar.h"
 
 #ifdef __VMS__
 #pragma message disable nosimpint
-#define XtDisplay XTDISPLAY
 #endif
 #include <Xm/Xm.h>
 #include <Xm/ScrollBar.h>
@@ -30,8 +28,6 @@
 static void wxScrollBarCallback(Widget widget, XtPointer clientData,
                         XmScaleCallbackStruct *cbs);
 
-IMPLEMENT_DYNAMIC_CLASS(wxScrollBar, wxControl)
-
 // Scrollbar
 bool wxScrollBar::Create(wxWindow *parent, wxWindowID id,
            const wxPoint& pos,
@@ -41,6 +37,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 +51,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;
 }
@@ -126,6 +123,8 @@ static void wxScrollBarCallback(Widget widget, XtPointer clientData,
                                 XmScaleCallbackStruct *cbs)
 {
     wxScrollBar *scrollBar = (wxScrollBar*)wxGetWindowFromTable(widget);
+    wxCHECK_RET( scrollBar, wxT("invalid widget in scrollbar callback") );
+
     wxOrientation orientation = (wxOrientation)wxPtrToUInt(clientData);
     wxEventType eventType = wxEVT_NULL;
 
@@ -182,5 +181,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);
 }