Various fixes for wxMotif

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10906 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2001-07-09 11:07:10 +00:00
parent bf7d7ee706
commit 45f22d48cd
8 changed files with 47 additions and 72 deletions

View File

@@ -73,7 +73,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxCommandEvent)
void wxNotebook::Init()
{
m_tabView = (wxNotebookTabView*) NULL;
m_pImageList = NULL;
m_nSelection = -1;
}
@@ -129,11 +128,6 @@ wxNotebook::~wxNotebook()
// ----------------------------------------------------------------------------
// wxNotebook accessors
// ----------------------------------------------------------------------------
int wxNotebook::GetPageCount() const
{
return m_aPages.Count();
}
int wxNotebook::GetRowCount() const
{
// TODO
@@ -158,6 +152,7 @@ int wxNotebook::SetSelection(int nPage)
return 0;
}
#if 0
void wxNotebook::AdvanceSelection(bool bForward)
{
int nSel = GetSelection();
@@ -167,6 +162,7 @@ void wxNotebook::AdvanceSelection(bool bForward)
else
SetSelection(nSel == 0 ? nMax : nSel - 1);
}
#endif
bool wxNotebook::SetPageText(int nPage, const wxString& strText)
{
@@ -218,12 +214,6 @@ bool wxNotebook::SetPageImage(int nPage, int nImage)
return FALSE;
}
void wxNotebook::SetImageList(wxImageList* imageList)
{
m_pImageList = imageList;
// TODO
}
// ----------------------------------------------------------------------------
// wxNotebook operations
// ----------------------------------------------------------------------------
@@ -235,8 +225,8 @@ bool wxNotebook::DeletePage(int nPage)
if (m_nSelection != -1)
{
m_aPages[m_nSelection]->Show(FALSE);
m_aPages[m_nSelection]->Lower();
m_pages[m_nSelection]->Show(FALSE);
m_pages[m_nSelection]->Lower();
}
wxNotebookPage* pPage = GetPage(nPage);
@@ -246,10 +236,10 @@ bool wxNotebook::DeletePage(int nPage)
m_tabView->RemoveTab((int) (long) pPage);
#endif
delete m_aPages[nPage];
m_aPages.Remove(nPage);
m_pages.Remove(pPage);
delete pPage;
if (m_aPages.GetCount() == 0)
if (m_pages.GetCount() == 0)
{
m_nSelection = -1;
m_tabView->SetTabSelection(-1, FALSE);
@@ -285,8 +275,8 @@ bool wxNotebook::RemovePage(int nPage)
{
wxCHECK( IS_VALID_PAGE(nPage), FALSE );
m_aPages[nPage]->Show(FALSE);
// m_aPages[nPage]->Lower();
m_pages[nPage]->Show(FALSE);
// m_pages[nPage]->Lower();
wxNotebookPage* pPage = GetPage(nPage);
#if defined (__WIN16__)
@@ -295,9 +285,9 @@ bool wxNotebook::RemovePage(int nPage)
m_tabView->RemoveTab((int) (long) pPage);
#endif
m_aPages.Remove(nPage);
m_pages.Remove(pPage);
if (m_aPages.GetCount() == 0)
if (m_pages.GetCount() == 0)
{
m_nSelection = -1;
m_tabView->SetTabSelection(-1, TRUE);
@@ -342,7 +332,7 @@ int wxNotebook::FindPagePosition(wxNotebookPage* page) const
int nPageCount = GetPageCount();
int nPage;
for ( nPage = 0; nPage < nPageCount; nPage++ )
if (m_aPages[nPage] == page)
if (m_pages[nPage] == page)
return nPage;
return -1;
}
@@ -355,22 +345,13 @@ bool wxNotebook::DeleteAllPages()
int nPageCount = GetPageCount();
int nPage;
for ( nPage = 0; nPage < nPageCount; nPage++ )
delete m_aPages[nPage];
delete m_pages[nPage];
m_aPages.Clear();
m_pages.Clear();
return TRUE;
}
// add a page to the notebook
bool wxNotebook::AddPage(wxNotebookPage *pPage,
const wxString& strText,
bool bSelect,
int imageId)
{
return InsertPage(GetPageCount(), pPage, strText, bSelect, imageId);
}
// same as AddPage() but does it at given position
bool wxNotebook::InsertPage(int nPage,
wxNotebookPage *pPage,
@@ -391,7 +372,7 @@ bool wxNotebook::InsertPage(int nPage,
pPage->Show(FALSE);
// save the pointer to the page
m_aPages.Insert(pPage, nPage);
m_pages.Insert(pPage, nPage);
if (bSelect)
{
@@ -500,9 +481,9 @@ bool wxNotebook::RefreshLayout(bool force)
// fit the notebook page to the tab control's display area
unsigned int nCount = m_aPages.Count();
unsigned int nCount = m_pages.Count();
for ( unsigned int nPage = 0; nPage < nCount; nPage++ ) {
wxNotebookPage *pPage = m_aPages[nPage];
wxNotebookPage *pPage = m_pages[nPage];
if (pPage->IsShown())
{
wxRect clientRect = GetAvailableClientSize();
@@ -533,7 +514,7 @@ void wxNotebook::OnSetFocus(wxFocusEvent& event)
{
// set focus to the currently selected page if any
if ( m_nSelection != -1 )
m_aPages[m_nSelection]->SetFocus();
m_pages[m_nSelection]->SetFocus();
event.Skip();
}
@@ -586,11 +567,11 @@ void wxNotebook::ChangePage(int nOldSel, int nSel)
wxASSERT( nOldSel != nSel ); // impossible
if ( nOldSel != -1 ) {
m_aPages[nOldSel]->Show(FALSE);
m_aPages[nOldSel]->Lower();
m_pages[nOldSel]->Show(FALSE);
m_pages[nOldSel]->Lower();
}
wxNotebookPage *pPage = m_aPages[nSel];
wxNotebookPage *pPage = m_pages[nSel];
wxRect clientRect = GetAvailableClientSize();
pPage->SetSize(clientRect.x, clientRect.y, clientRect.width, clientRect.height);