X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/af111fc33841cc8bdc4d6cf027702805333bdd2a..ee3510132b8b4160f848bd4f502a6f5315f90dbc:/src/motif/scrolbar.cpp diff --git a/src/motif/scrolbar.cpp b/src/motif/scrolbar.cpp index 143eb3823d..e0a15b4a4c 100644 --- a/src/motif/scrolbar.cpp +++ b/src/motif/scrolbar.cpp @@ -13,21 +13,27 @@ #pragma implementation "scrolbar.h" #endif +#include "wx/defs.h" + #include "wx/scrolbar.h" +#ifdef __VMS__ +#pragma message disable nosimpint +#endif #include #include #include #include +#ifdef __VMS__ +#pragma message enable nosimpint +#endif -#include +#include "wx/motif/private.h" static void wxScrollBarCallback(Widget widget, XtPointer clientData, XmScaleCallbackStruct *cbs); -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxScrollBar, wxControl) -#endif // Scrollbar bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, @@ -81,8 +87,7 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, m_mainWidget = (Widget) scrollBarWidget; - // This will duplicate other events - // XtAddCallback(scrollBarWidget, XmNvalueChangedCallback, (XtCallbackProc)wxScrollBarCallback, (XtPointer)this); + XtAddCallback(scrollBarWidget, XmNvalueChangedCallback, (XtCallbackProc)wxScrollBarCallback, (XtPointer)this); XtAddCallback(scrollBarWidget, XmNdragCallback, (XtCallbackProc)wxScrollBarCallback, (XtPointer)this); XtAddCallback(scrollBarWidget, XmNdecrementCallback, (XtCallbackProc)wxScrollBarCallback, (XtPointer)this); XtAddCallback(scrollBarWidget, XmNincrementCallback, (XtCallbackProc)wxScrollBarCallback, (XtPointer)this); @@ -176,8 +181,8 @@ static void wxScrollBarCallback(Widget WXUNUSED(widget), XtPointer clientData, XmScaleCallbackStruct *cbs) { wxScrollBar *scrollBar = (wxScrollBar *)clientData; - wxEventType eventType = wxEVT_NULL; + switch (cbs->reason) { case XmCR_INCREMENT: @@ -197,9 +202,7 @@ static void wxScrollBarCallback(Widget WXUNUSED(widget), XtPointer clientData, } case XmCR_VALUE_CHANGED: { - // TODO: Should this be intercepted too, or will it cause - // duplicate events? - eventType = wxEVT_SCROLL_THUMBTRACK; + eventType = wxEVT_SCROLL_THUMBRELEASE; break; } case XmCR_PAGE_INCREMENT: