示例#1
0
void wxSpinCtrl::OnSpinChange(wxSpinEvent& eventSpin)
{
    const int value = eventSpin.GetPosition();
    if ( value != m_oldValue )
    {
        SendSpinUpdate(value);
    }
}
示例#2
0
void wxSpinCtrl::NormalizeValue()
{
    const int value = GetValue();
    const bool changed = value != m_oldValue;

    // notice that we have to call SetValue() even if the value didn't change
    // because otherwise we could be left with empty buddy control when value
    // is 0, see comment in SetValue()
    SetValue(value);

    if ( changed )
    {
        SendSpinUpdate(value);
    }
}
示例#3
0
bool wxSpinCtrl::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
                               WXWORD pos, WXHWND control)
{
    wxCHECK_MSG( control, false, wxT("scrolling what?") );

    if ( wParam != SB_THUMBPOSITION )
    {
        // probable SB_ENDSCROLL - we don't react to it
        return false;
    }

    int new_value = (short) pos;
    if (m_oldValue != new_value)
       SendSpinUpdate( new_value );

    return TRUE;
}
示例#4
0
bool wxSpinCtrl::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam,
                             WXWORD WXUNUSED(pos), WXHWND control)
{
    wxCHECK_MSG( control, false, wxT("scrolling what?") );

    if ( wParam != SB_THUMBPOSITION )
    {
        // probable SB_ENDSCROLL - we don't react to it
        return false;
    }

    // Notice that we can't use "pos" from WM_VSCROLL as it is 16 bit and we
    // might be using 32 bit range.
    int new_value = GetValue();
    if (m_oldValue != new_value)
       SendSpinUpdate( new_value );

    return true;
}