X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b4f8693cb887677cc8ed0f113a8b57e5f9520a3c..13f6e9e8e158fc74cb8f13227fb3e15adbeff7c5:/src/generic/notebook.cpp diff --git a/src/generic/notebook.cpp b/src/generic/notebook.cpp index f6462ae8a4..719d8bba0d 100644 --- a/src/generic/notebook.cpp +++ b/src/generic/notebook.cpp @@ -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 @@ -600,7 +574,7 @@ bool wxNotebook::DoPhase(int /* nPhase */) void wxNotebook::Command(wxCommandEvent& WXUNUSED(event)) { - wxFAIL_MSG("wxNotebook::Command not implemented"); + wxFAIL_MSG(wxT("wxNotebook::Command not implemented")); } // ---------------------------------------------------------------------------- @@ -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);