Use wxVector<> for wxBookCtrlBase::m_pages array
Get rid of another macro-based array in favour of wxVector<>. No real changes.
This commit is contained in:
@@ -309,9 +309,9 @@ wxNotebook::~wxNotebook()
|
||||
size_t wxNotebook::GetPageCount() const
|
||||
{
|
||||
// consistency check
|
||||
wxASSERT( (int)m_pages.Count() == TabCtrl_GetItemCount(GetHwnd()) );
|
||||
wxASSERT( (int)m_pages.size() == TabCtrl_GetItemCount(GetHwnd()) );
|
||||
|
||||
return m_pages.Count();
|
||||
return m_pages.size();
|
||||
}
|
||||
|
||||
int wxNotebook::GetRowCount() const
|
||||
@@ -404,7 +404,7 @@ bool wxNotebook::SetPageText(size_t nPage, const wxString& strText)
|
||||
if ( ret && rows != GetRowCount() )
|
||||
{
|
||||
const wxRect r = GetPageSize();
|
||||
const size_t count = m_pages.Count();
|
||||
const size_t count = m_pages.size();
|
||||
for ( size_t page = 0; page < count; page++ )
|
||||
m_pages[page]->SetSize(r);
|
||||
}
|
||||
@@ -578,7 +578,7 @@ wxNotebookPage *wxNotebook::DoRemovePage(size_t nPage)
|
||||
if ( !TabCtrl_DeleteItem(GetHwnd(), nPage) )
|
||||
wxLogLastError(wxS("TabCtrl_DeleteItem()"));
|
||||
|
||||
if ( m_pages.IsEmpty() )
|
||||
if ( m_pages.empty() )
|
||||
{
|
||||
// no selection any more, the notebook becamse empty
|
||||
m_selection = wxNOT_FOUND;
|
||||
@@ -693,13 +693,13 @@ bool wxNotebook::InsertPage(size_t nPage,
|
||||
}
|
||||
|
||||
// succeeded: save the pointer to the page
|
||||
m_pages.Insert(pPage, nPage);
|
||||
m_pages.insert(m_pages.begin() + nPage, pPage);
|
||||
|
||||
// we may need to adjust the size again if the notebook size changed:
|
||||
// normally this only happens for the first page we add (the tabs which
|
||||
// hadn't been there before are now shown) but for a multiline notebook it
|
||||
// can happen for any page at all as a new row could have been started
|
||||
if ( m_pages.GetCount() == 1 || HasFlag(wxNB_MULTILINE) )
|
||||
if ( m_pages.size() == 1 || HasFlag(wxNB_MULTILINE) )
|
||||
{
|
||||
AdjustPageSize(pPage);
|
||||
|
||||
@@ -959,7 +959,7 @@ void wxNotebook::OnSize(wxSizeEvent& event)
|
||||
|
||||
int width = rc.right - rc.left,
|
||||
height = rc.bottom - rc.top;
|
||||
size_t nCount = m_pages.Count();
|
||||
size_t nCount = m_pages.size();
|
||||
for ( size_t nPage = 0; nPage < nCount; nPage++ ) {
|
||||
wxNotebookPage *pPage = m_pages[nPage];
|
||||
pPage->SetSize(rc.left, rc.top, width, height);
|
||||
|
||||
Reference in New Issue
Block a user