]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/scrolbar.cpp
remove streams tests: they're very basic and already-existing CppUnit stream tests...
[wxWidgets.git] / src / motif / scrolbar.cpp
index 5b19681cf389a3c095d49a802c4162fb09984cef..f12accfcf817e51add05caa927a53297e218842c 100644 (file)
@@ -16,7 +16,6 @@
 
 #ifdef __VMS__
 #pragma message disable nosimpint
-#define XtDisplay XTDISPLAY
 #endif
 #include <Xm/Xm.h>
 #include <Xm/ScrollBar.h>
@@ -40,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 );
@@ -53,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;
 }
@@ -125,6 +125,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;
 
@@ -181,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);
 }