X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/15aad3b9386e52524eefbd2619571a038070419b..b1f50e652c0e105c0ed8ab627be837c45f7a1a00:/src/generic/notebook.cpp diff --git a/src/generic/notebook.cpp b/src/generic/notebook.cpp index 5db9b18603..756369436e 100644 --- a/src/generic/notebook.cpp +++ b/src/generic/notebook.cpp @@ -20,6 +20,10 @@ #pragma implementation "notebook.h" #endif +#ifdef __VMS +#pragma message disable unscomzer +#endif + // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -129,8 +133,7 @@ bool wxNotebook::Create(wxWindow *parent, m_windowId = id == -1 ? NewControlId() : id; - // It's like a normal window... - if (!wxWindow::Create(parent, id, pos, size, style|wxNO_BORDER, name)) + if (!wxControl::Create(parent, id, pos, size, style|wxNO_BORDER, wxDefaultValidator, name)) return FALSE; SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); @@ -157,9 +160,6 @@ int wxNotebook::GetRowCount() const int wxNotebook::SetSelection(size_t nPage) { - if (nPage == -1) - return 0; - wxASSERT( IS_VALID_PAGE(nPage) ); #if defined (__WIN16__) @@ -309,8 +309,13 @@ bool wxNotebook::DeletePage(wxNotebookPage* page) return FALSE; } -// remove one page from the notebook bool wxNotebook::RemovePage(size_t nPage) +{ + return DoRemovePage(nPage) != NULL; +} + +// remove one page from the notebook +wxWindow* wxNotebook::DoRemovePage(size_t nPage) { wxCHECK( IS_VALID_PAGE(nPage), FALSE ); @@ -335,25 +340,25 @@ bool wxNotebook::RemovePage(size_t nPage) { // Only change the selection if the page we // deleted was the selection. - if (nPage == m_nSelection) + if (nPage == (size_t)m_nSelection) { m_nSelection = -1; // Select the first tab. Generates a ChangePage. - m_tabView->SetTabSelection((int) (long) GetPage(0), TRUE); + m_tabView->SetTabSelection(0, TRUE); } else { // We must adjust which tab we think is selected. // If greater than the page we deleted, it must be moved down // a notch. - if (m_nSelection > nPage) + if (size_t(m_nSelection) > nPage) m_nSelection -- ; } } RefreshLayout(FALSE); - return TRUE; + return pPage; } bool wxNotebook::RemovePage(wxNotebookPage* page) @@ -595,7 +600,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")); } // ----------------------------------------------------------------------------