removed Win16 code (patch 905241), last version with remains of Win16 support tagged with BEFORE_WIN16_REMOVAL
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26423 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -162,13 +162,10 @@ int wxNotebook::SetSelection(size_t nPage)
|
||||
{
|
||||
wxASSERT( IS_VALID_PAGE(nPage) );
|
||||
|
||||
#if defined (__WIN16__)
|
||||
m_tabView->SetTabSelection(nPage);
|
||||
#else
|
||||
wxNotebookPage* pPage = GetPage(nPage);
|
||||
|
||||
m_tabView->SetTabSelection((int) (long) pPage);
|
||||
#endif
|
||||
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
@@ -188,11 +185,7 @@ void wxNotebook::AdvanceSelection(bool bForward)
|
||||
bool wxNotebook::SetPageText(size_t nPage, const wxString& strText)
|
||||
{
|
||||
wxASSERT( IS_VALID_PAGE(nPage) );
|
||||
#if defined (__WIN16__)
|
||||
m_tabView->SetTabText(nPage, strText);
|
||||
Refresh();
|
||||
return TRUE;
|
||||
#else
|
||||
|
||||
wxNotebookPage* page = GetPage(nPage);
|
||||
if (page)
|
||||
{
|
||||
@@ -200,7 +193,7 @@ bool wxNotebook::SetPageText(size_t nPage, const wxString& strText)
|
||||
Refresh();
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -208,15 +201,11 @@ wxString wxNotebook::GetPageText(size_t nPage) const
|
||||
{
|
||||
wxASSERT( IS_VALID_PAGE(nPage) );
|
||||
|
||||
#if defined (__WIN16__)
|
||||
return m_tabView->GetTabText(nPage);
|
||||
#else
|
||||
wxNotebookPage* page = ((wxNotebook*)this)->GetPage(nPage);
|
||||
if (page)
|
||||
return m_tabView->GetTabText((int) (long) page);
|
||||
else
|
||||
return wxEmptyString;
|
||||
#endif
|
||||
}
|
||||
|
||||
int wxNotebook::GetPageImage(size_t nPage) const
|
||||
@@ -269,11 +258,8 @@ bool wxNotebook::DeletePage(size_t nPage)
|
||||
}
|
||||
|
||||
wxNotebookPage* pPage = GetPage(nPage);
|
||||
#if defined (__WIN16__)
|
||||
m_tabView->RemoveTab(nPage);
|
||||
#else
|
||||
|
||||
m_tabView->RemoveTab((int) (long) pPage);
|
||||
#endif
|
||||
|
||||
m_pages.Remove(pPage);
|
||||
delete pPage;
|
||||
@@ -286,11 +272,9 @@ bool wxNotebook::DeletePage(size_t nPage)
|
||||
else if (m_nSelection > -1)
|
||||
{
|
||||
m_nSelection = -1;
|
||||
#if defined (__WIN16__)
|
||||
m_tabView->SetTabSelection(0, FALSE);
|
||||
#else
|
||||
|
||||
m_tabView->SetTabSelection((int) (long) GetPage(0), FALSE);
|
||||
#endif
|
||||
|
||||
if (m_nSelection != 0)
|
||||
ChangePage(-1, 0);
|
||||
}
|
||||
@@ -323,11 +307,8 @@ wxWindow* wxNotebook::DoRemovePage(size_t nPage)
|
||||
// m_pages[nPage]->Lower();
|
||||
|
||||
wxNotebookPage* pPage = GetPage(nPage);
|
||||
#if defined (__WIN16__)
|
||||
m_tabView->RemoveTab(nPage);
|
||||
#else
|
||||
|
||||
m_tabView->RemoveTab((int) (long) pPage);
|
||||
#endif
|
||||
|
||||
m_pages.Remove(pPage);
|
||||
|
||||
@@ -406,12 +387,8 @@ bool wxNotebook::InsertPage(size_t nPage,
|
||||
wxASSERT( pPage != NULL );
|
||||
wxCHECK( IS_VALID_PAGE(nPage) || nPage == GetPageCount(), FALSE );
|
||||
|
||||
// For 16 bit integers (tabs limited to 32768)
|
||||
#if defined (__WIN16__)
|
||||
m_tabView->AddTab(nPage, strText);
|
||||
#else
|
||||
m_tabView->AddTab((int) (long) pPage, strText);
|
||||
#endif
|
||||
|
||||
if (!bSelect)
|
||||
pPage->Show(FALSE);
|
||||
|
||||
@@ -421,11 +398,8 @@ bool wxNotebook::InsertPage(size_t nPage,
|
||||
if (bSelect)
|
||||
{
|
||||
// This will cause ChangePage to be called, via OnSelPage
|
||||
#if defined (__WIN16__)
|
||||
m_tabView->SetTabSelection(nPage, TRUE);
|
||||
#else
|
||||
|
||||
m_tabView->SetTabSelection((int) (long) pPage, TRUE);
|
||||
#endif
|
||||
}
|
||||
|
||||
// some page must be selected: either this one or the first one if there is
|
||||
@@ -689,10 +663,6 @@ void wxNotebookTabView::OnTabActivate(int activateId, int deactivateId)
|
||||
|
||||
wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_notebook->GetId());
|
||||
|
||||
#if defined (__WIN16__)
|
||||
int activatePos = activateId;
|
||||
int deactivatePos = deactivateId;
|
||||
#else
|
||||
// Translate from wxTabView's ids (which aren't position-dependent)
|
||||
// to wxNotebook's (which are).
|
||||
wxNotebookPage* pActive = (wxNotebookPage*) activateId;
|
||||
@@ -701,7 +671,6 @@ void wxNotebookTabView::OnTabActivate(int activateId, int deactivateId)
|
||||
int activatePos = m_notebook->FindPagePosition(pActive);
|
||||
int deactivatePos = m_notebook->FindPagePosition(pDeactive);
|
||||
|
||||
#endif
|
||||
event.SetEventObject(m_notebook);
|
||||
event.SetSelection(activatePos);
|
||||
event.SetOldSelection(deactivatePos);
|
||||
@@ -717,10 +686,6 @@ bool wxNotebookTabView::OnTabPreActivate(int activateId, int deactivateId)
|
||||
{
|
||||
wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_notebook->GetId());
|
||||
|
||||
#if defined (__WIN16__)
|
||||
int activatePos = activateId;
|
||||
int deactivatePos = deactivateId;
|
||||
#else
|
||||
// Translate from wxTabView's ids (which aren't position-dependent)
|
||||
// to wxNotebook's (which are).
|
||||
wxNotebookPage* pActive = (wxNotebookPage*) activateId;
|
||||
@@ -729,7 +694,6 @@ bool wxNotebookTabView::OnTabPreActivate(int activateId, int deactivateId)
|
||||
int activatePos = m_notebook->FindPagePosition(pActive);
|
||||
int deactivatePos = m_notebook->FindPagePosition(pDeactive);
|
||||
|
||||
#endif
|
||||
event.SetEventObject(m_notebook);
|
||||
event.SetSelection(activatePos);
|
||||
event.SetOldSelection(deactivatePos);
|
||||
|
Reference in New Issue
Block a user