replace m_nSelection by m_selection
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66000 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -113,7 +113,7 @@ static int GetPageId(wxTabView *tabview, wxNotebookPage *page)
|
|||||||
void wxNotebook::Init()
|
void wxNotebook::Init()
|
||||||
{
|
{
|
||||||
m_tabView = NULL;
|
m_tabView = NULL;
|
||||||
m_nSelection = -1;
|
m_selection = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// default for dynamic class
|
// default for dynamic class
|
||||||
@@ -274,10 +274,10 @@ bool wxNotebook::DeletePage(size_t nPage)
|
|||||||
{
|
{
|
||||||
wxCHECK( IS_VALID_PAGE(nPage), false );
|
wxCHECK( IS_VALID_PAGE(nPage), false );
|
||||||
|
|
||||||
if (m_nSelection != -1)
|
if (m_selection != -1)
|
||||||
{
|
{
|
||||||
m_pages[m_nSelection]->Show(false);
|
m_pages[m_selection]->Show(false);
|
||||||
m_pages[m_nSelection]->Lower();
|
m_pages[m_selection]->Lower();
|
||||||
}
|
}
|
||||||
|
|
||||||
wxNotebookPage* pPage = GetPage(nPage);
|
wxNotebookPage* pPage = GetPage(nPage);
|
||||||
@@ -289,16 +289,16 @@ bool wxNotebook::DeletePage(size_t nPage)
|
|||||||
|
|
||||||
if (m_pages.GetCount() == 0)
|
if (m_pages.GetCount() == 0)
|
||||||
{
|
{
|
||||||
m_nSelection = -1;
|
m_selection = -1;
|
||||||
m_tabView->SetTabSelection(-1, false);
|
m_tabView->SetTabSelection(-1, false);
|
||||||
}
|
}
|
||||||
else if (m_nSelection > -1)
|
else if (m_selection > -1)
|
||||||
{
|
{
|
||||||
m_nSelection = -1;
|
m_selection = -1;
|
||||||
|
|
||||||
m_tabView->SetTabSelection(GetPageId(m_tabView, GetPage(0)), false);
|
m_tabView->SetTabSelection(GetPageId(m_tabView, GetPage(0)), false);
|
||||||
|
|
||||||
if (m_nSelection != 0)
|
if (m_selection != 0)
|
||||||
ChangePage(-1, 0);
|
ChangePage(-1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -337,16 +337,16 @@ wxWindow* wxNotebook::DoRemovePage(size_t nPage)
|
|||||||
|
|
||||||
if (m_pages.GetCount() == 0)
|
if (m_pages.GetCount() == 0)
|
||||||
{
|
{
|
||||||
m_nSelection = -1;
|
m_selection = -1;
|
||||||
m_tabView->SetTabSelection(-1, true);
|
m_tabView->SetTabSelection(-1, true);
|
||||||
}
|
}
|
||||||
else if (m_nSelection > -1)
|
else if (m_selection > -1)
|
||||||
{
|
{
|
||||||
// Only change the selection if the page we
|
// Only change the selection if the page we
|
||||||
// deleted was the selection.
|
// deleted was the selection.
|
||||||
if (nPage == (size_t)m_nSelection)
|
if (nPage == (size_t)m_selection)
|
||||||
{
|
{
|
||||||
m_nSelection = -1;
|
m_selection = -1;
|
||||||
// Select the first tab. Generates a ChangePage.
|
// Select the first tab. Generates a ChangePage.
|
||||||
m_tabView->SetTabSelection(0, true);
|
m_tabView->SetTabSelection(0, true);
|
||||||
}
|
}
|
||||||
@@ -355,8 +355,8 @@ wxWindow* wxNotebook::DoRemovePage(size_t nPage)
|
|||||||
// We must adjust which tab we think is selected.
|
// We must adjust which tab we think is selected.
|
||||||
// If greater than the page we deleted, it must be moved down
|
// If greater than the page we deleted, it must be moved down
|
||||||
// a notch.
|
// a notch.
|
||||||
if (size_t(m_nSelection) > nPage)
|
if (size_t(m_selection) > nPage)
|
||||||
m_nSelection -- ;
|
m_selection -- ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -427,7 +427,7 @@ bool wxNotebook::InsertPage(size_t nPage,
|
|||||||
|
|
||||||
// some page must be selected: either this one or the first one if there is
|
// some page must be selected: either this one or the first one if there is
|
||||||
// still no selection
|
// still no selection
|
||||||
if ( m_nSelection == -1 )
|
if ( m_selection == -1 )
|
||||||
ChangePage(-1, 0);
|
ChangePage(-1, 0);
|
||||||
|
|
||||||
RefreshLayout(false);
|
RefreshLayout(false);
|
||||||
@@ -546,7 +546,7 @@ void wxNotebook::OnSelChange(wxBookCtrlEvent& event)
|
|||||||
// is it our tab control?
|
// is it our tab control?
|
||||||
if ( event.GetEventObject() == this )
|
if ( event.GetEventObject() == this )
|
||||||
{
|
{
|
||||||
if (event.GetSelection() != m_nSelection)
|
if (event.GetSelection() != m_selection)
|
||||||
ChangePage(event.GetOldSelection(), event.GetSelection());
|
ChangePage(event.GetOldSelection(), event.GetSelection());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -557,8 +557,8 @@ void wxNotebook::OnSelChange(wxBookCtrlEvent& event)
|
|||||||
void wxNotebook::OnSetFocus(wxFocusEvent& event)
|
void wxNotebook::OnSetFocus(wxFocusEvent& event)
|
||||||
{
|
{
|
||||||
// set focus to the currently selected page if any
|
// set focus to the currently selected page if any
|
||||||
if ( m_nSelection != -1 )
|
if ( m_selection != -1 )
|
||||||
m_pages[m_nSelection]->SetFocus();
|
m_pages[m_selection]->SetFocus();
|
||||||
|
|
||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
@@ -628,7 +628,7 @@ void wxNotebook::ChangePage(int nOldSel, int nSel)
|
|||||||
pPage->Raise();
|
pPage->Raise();
|
||||||
pPage->SetFocus();
|
pPage->SetFocus();
|
||||||
|
|
||||||
m_nSelection = nSel;
|
m_selection = nSel;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxNotebook::OnMouseEvent(wxMouseEvent& event)
|
void wxNotebook::OnMouseEvent(wxMouseEvent& event)
|
||||||
|
Reference in New Issue
Block a user