- Winelib compilation now works.
- When converting a wxIcon to a bitmap check if the icon has an alpha
channel and set the bitmap to use it.
+- wxSlider now also sends wxEVT_SCROLL_CHANGED when using mouse wheel
wxGTK:
cases the {\tt EVT\_SCROLL\_THUMBRELEASE} event does not happen).
In short, the {\tt EVT\_SCROLL\_CHANGED} event is triggered when scrolling/
-moving has finished. The only exception (unfortunately) is that changing the
-thumb position using the mousewheel does give a {\tt EVT\_SCROLL\_THUMBRELEASE}
-event but NOT an {\tt EVT\_SCROLL\_CHANGED} event.
-
-Please see the widgets sample ("Slider" page) to see the difference
-between {\tt EVT\_SCROLL\_THUMBRELEASE} and {\tt EVT\_SCROLL\_CHANGED} in action.
+moving has finished independently of the way it had started. Please see the
+widgets sample ("Slider" page) to see the difference between {\tt
+EVT\_SCROLL\_THUMBRELEASE} and {\tt EVT\_SCROLL\_CHANGED} in action.
int m_lineSize;
int m_tickFreq;
+ // flag needed to detect whether we're getting THUMBRELEASE event because
+ // of dragging the thumb or scrolling the mouse wheel
+ bool m_isDragging;
DECLARE_DYNAMIC_CLASS_NO_COPY(wxSlider)
};
m_rangeMax = 0;
m_rangeMin = 0;
m_tickFreq = 0;
+
+ m_isDragging = false;
}
bool
case SB_THUMBTRACK:
scrollEvent = wxEVT_SCROLL_THUMBTRACK;
+ m_isDragging = true;
break;
case SB_THUMBPOSITION:
- scrollEvent = wxEVT_SCROLL_THUMBRELEASE;
+ if ( m_isDragging )
+ {
+ scrollEvent = wxEVT_SCROLL_THUMBRELEASE;
+ m_isDragging = false;
+ }
+ else
+ {
+ // this seems to only happen when the mouse wheel is used: in
+ // this case, as it might be unexpected to get THUMBRELEASE
+ // without preceding THUMBTRACKs, we don't generate it at all
+ // but generate CHANGED event because the control itself does
+ // not send us SB_ENDSCROLL for whatever reason when mouse
+ // wheel is used
+ scrollEvent = wxEVT_SCROLL_CHANGED;
+ }
break;
case SB_ENDSCROLL: