+ /*
+ This array takes the EXACT order of the declarations in
+ include/wx/event.h
+ (section "wxScrollBar and wxSlider event identifiers")
+ */
+ static const wxChar *eventNames[] =
+ {
+ wxT("wxEVT_SCROLL_TOP"),
+ wxT("wxEVT_SCROLL_BOTTOM"),
+ wxT("wxEVT_SCROLL_LINEUP"),
+ wxT("wxEVT_SCROLL_LINEDOWN"),
+ wxT("wxEVT_SCROLL_PAGEUP"),
+ wxT("wxEVT_SCROLL_PAGEDOWN"),
+ wxT("wxEVT_SCROLL_THUMBTRACK"),
+ wxT("wxEVT_SCROLL_THUMBRELEASE"),
+ wxT("wxEVT_SCROLL_CHANGED")
+ };
+
+ int index = eventType - wxEVT_SCROLL_TOP;
+
+ /*
+ If this assert is triggered, there is an unknown slider event which
+ should be added to the above eventNames array.
+ */
+ wxASSERT_MSG(index >= 0 && (size_t)index < WXSIZEOF(eventNames),
+ wxT("Unknown slider event") );
+
+
+ static int s_numSliderEvents = 0;
+
+ wxLogMessage(wxT("Slider event #%d: %s (pos = %d, int value = %ld)"),
+ s_numSliderEvents++,
+ eventNames[index],
+ event.GetPosition(),
+ event.GetInt());