#endif
#define USE_DEFERRED_SIZING 1
-#define USE_DEFER_BUG_WORKAROUND 0
// ----------------------------------------------------------------------------
// constants
IMPLEMENT_DYNAMIC_CLASS_XTI(wxSlider, wxControl,"wx/scrolbar.h")
wxBEGIN_PROPERTIES_TABLE(wxSlider)
- wxEVENT_RANGE_PROPERTY( Scroll , wxEVT_SCROLL_TOP , wxEVT_SCROLL_ENDSCROLL , wxScrollEvent )
+ wxEVENT_RANGE_PROPERTY( Scroll , wxEVT_SCROLL_TOP , wxEVT_SCROLL_CHANGED , wxScrollEvent )
wxEVENT_PROPERTY( Updated , wxEVT_COMMAND_SLIDER_UPDATED , wxCommandEvent )
wxPROPERTY( Value , int , SetValue, GetValue , 0, 0 /*flags*/ , wxT("Helpstring") , wxT("group"))
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:
- scrollEvent = wxEVT_SCROLL_ENDSCROLL;
+ scrollEvent = wxEVT_SCROLL_CHANGED;
break;
default:
width,
height - hLabel);
}
- if ( hdwp )
- {
- // Store the size so we can report it accurately
- wxExtraWindowData* extraData = (wxExtraWindowData*) m_windowReserved;
- if (!extraData)
- {
- extraData = new wxExtraWindowData;
- m_windowReserved = (void*) extraData;
- }
- extraData->m_pos = wxPoint(x, y);
- extraData->m_size = wxSize(width, height);
- extraData->m_deferring = true;
+#if USE_DEFERRED_SIZING
+ if ( parent )
+ {
// hdwp must be updated as it may have been changed
parent->m_hDWP = (WXHANDLE)hdwp;
}
+#endif
}
wxSize wxSlider::DoGetBestSize() const
int wxSlider::GetSelEnd() const
{
- return (int)::SendMessage(GetHwnd(), TBM_SETSELEND, 0, 0);
+ return (int)::SendMessage(GetHwnd(), TBM_GETSELEND, 0, 0);
}
int wxSlider::GetSelStart() const