X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fc0daf84009784af053fa265d8ad8e9e446388f4..594f0f5bf1355fb8d58f403d3ebacc1c1767c429:/src/mac/notebmac.cpp diff --git a/src/mac/notebmac.cpp b/src/mac/notebmac.cpp index 9d0b2c4593..17b89bde2e 100644 --- a/src/mac/notebmac.cpp +++ b/src/mac/notebmac.cpp @@ -17,14 +17,14 @@ // headers // ---------------------------------------------------------------------------- #ifdef __GNUG__ -#pragma implementation "notebook.h" + #pragma implementation "notebook.h" #endif -#include -#include -#include -#include -#include +#include "wx/string.h" +#include "wx/log.h" +#include "wx/imaglist.h" +#include "wx/notebook.h" +#include "wx/mac/uma.h" // ---------------------------------------------------------------------------- // macros // ---------------------------------------------------------------------------- @@ -32,7 +32,7 @@ // check that the page index is valid #define IS_VALID_PAGE(nPage) (((nPage) >= 0) && ((nPage) < GetPageCount())) -#ifdef __WXMAC_X__ +#ifdef __DARWIN__ // I got these values for Mac OS X from the Appearance mgr docs. (Mark Newsam) const short kwxMacTabLeftMargin = 20 ; const short kwxMacTabTopMargin = 38 ; @@ -76,7 +76,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxCommandEvent) // common part of all ctors void wxNotebook::Init() { -#ifdef __WXMAC_X__ +#ifdef __DARWIN__ m_macHorizontalBorder = 7; m_macVerticalBorder = 8; #endif @@ -149,7 +149,8 @@ void wxNotebook::SetPageSize(const wxSize& size) int wxNotebook::SetSelection(int nPage) { - wxASSERT( IS_VALID_PAGE(nPage) ); + if( !IS_VALID_PAGE(nPage) ) + return m_nSelection ; ChangePage(m_nSelection, nPage); SetControlValue( m_macControl , m_nSelection + 1 ) ; @@ -202,7 +203,7 @@ wxNotebookPage* wxNotebook::DoRemovePage(int nPage) { wxCHECK( IS_VALID_PAGE(nPage), NULL ); wxNotebookPage* page = m_pages[nPage] ; - m_pages.Remove(nPage); + m_pages.RemoveAt(nPage); MacSetupTabs();