fixed AdvanceSelection() wrapping
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5833 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -365,11 +365,17 @@ void wxNotebook::AdvanceSelection( bool forward )
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid notebook") );
|
||||
|
||||
int sel = GetSelection();
|
||||
int max = GetPageCount();
|
||||
if ( !max )
|
||||
{
|
||||
// nothing to do with empty notebook
|
||||
return;
|
||||
}
|
||||
|
||||
int sel = GetSelection();
|
||||
|
||||
if (forward)
|
||||
SetSelection( sel == max ? 0 : sel + 1 );
|
||||
SetSelection( sel == max - 1 ? 0 : sel + 1 );
|
||||
else
|
||||
SetSelection( sel == 0 ? max - 1 : sel - 1 );
|
||||
}
|
||||
|
@@ -365,11 +365,17 @@ void wxNotebook::AdvanceSelection( bool forward )
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid notebook") );
|
||||
|
||||
int sel = GetSelection();
|
||||
int max = GetPageCount();
|
||||
if ( !max )
|
||||
{
|
||||
// nothing to do with empty notebook
|
||||
return;
|
||||
}
|
||||
|
||||
int sel = GetSelection();
|
||||
|
||||
if (forward)
|
||||
SetSelection( sel == max ? 0 : sel + 1 );
|
||||
SetSelection( sel == max - 1 ? 0 : sel + 1 );
|
||||
else
|
||||
SetSelection( sel == 0 ? max - 1 : sel - 1 );
|
||||
}
|
||||
|
Reference in New Issue
Block a user