support wxSP_WRAP in generic implementation (closes #10557)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59410 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2009-03-07 14:27:06 +00:00
parent 9be5555cde
commit 42af6685ae
2 changed files with 6 additions and 3 deletions

View File

@ -497,6 +497,7 @@ All (GUI):
Added also wxEventLoopBase::IsYielding to help cure re-entrancy problems with Yield().
- Render <th> element contents in bold in wxHTML.
- Added wxGrid::{Set,Get}{Row,Col}Sizes() methods (Andrey Putrin).
- Add support for wxSP_WRAP in the generic version of wxSpinCtrlDouble.
wxGTK:

View File

@ -339,9 +339,11 @@ void wxSpinCtrlGenericBase::OnSpinButton(wxSpinEvent& event)
double value = m_value + step*m_increment;
// we can always reach the ends using the spinbutton
if (value < m_min) value = m_min;
if (value > m_max) value = m_max;
// Check for over/underflow wrapping around if necessary
if (value < m_min)
value = HasFlag(wxSP_WRAP) ? m_max : m_min;
if (value > m_max)
value = HasFlag(wxSP_WRAP) ? m_min : m_max;
// Ignore the edges when it wraps since the up/down event may be opposite
// They are in GTK and Mac