X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fc0daf84009784af053fa265d8ad8e9e446388f4..33754c4d83c59b7523a6da0c4fb21079cb60301c:/src/mac/carbon/notebmac.cpp diff --git a/src/mac/carbon/notebmac.cpp b/src/mac/carbon/notebmac.cpp index 9d0b2c4593..88e098ac96 100644 --- a/src/mac/carbon/notebmac.cpp +++ b/src/mac/carbon/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 @@ -115,7 +115,7 @@ bool wxNotebook::Create(wxWindow *parent, MacPreControlCreate( parent , id , "" , pos , size ,style, wxDefaultValidator , name , &bounds , title ) ; - m_macControl = UMANewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1, + m_macControl = ::NewControl( parent->GetMacRootWindow() , &bounds , title , false , 0 , 0 , 1, kControlTabSmallProc , (long) this ) ; MacPostControlCreate() ; @@ -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();