X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/90b959aee428b26304ee0056864af48775051496..6443de026310552cacd68a6d0318e73d14929680:/src/mac/carbon/notebmac.cpp diff --git a/src/mac/carbon/notebmac.cpp b/src/mac/carbon/notebmac.cpp index 6e94d28049..6f555d06c9 100644 --- a/src/mac/carbon/notebmac.cpp +++ b/src/mac/carbon/notebmac.cpp @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- #ifdef __GNUG__ -#pragma implementation "notebook.h" + #pragma implementation "notebook.h" #endif #include @@ -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 @@ -134,19 +134,23 @@ wxNotebook::~wxNotebook() void wxNotebook::SetPadding(const wxSize& padding) { + wxFAIL_MSG( wxT("wxNotebook::SetPadding not implemented") ); } void wxNotebook::SetTabSize(const wxSize& sz) { + wxFAIL_MSG( wxT("wxNotebook::SetTabSize not implemented") ); } void wxNotebook::SetPageSize(const wxSize& size) { + wxFAIL_MSG( wxT("wxNotebook::SetPageSize not implemented") ); } 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 ) ; @@ -175,17 +179,18 @@ wxString wxNotebook::GetPageText(int nPage) const int wxNotebook::GetPageImage(int nPage) const { - wxASSERT( IS_VALID_PAGE(nPage) ); + wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, _T("invalid notebook page") ); - // TODO - return 0; + return 0 ; } bool wxNotebook::SetPageImage(int nPage, int nImage) { - wxASSERT( IS_VALID_PAGE(nPage) ); + wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, _T("invalid notebook page") ); + + wxCHECK_MSG( m_imageList && nImage < m_imageList->GetImageCount(), FALSE, + _T("invalid image index in SetPageImage()") ); - // TODO return FALSE; } @@ -198,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(); @@ -305,14 +310,6 @@ void wxNotebook::MacSetupTabs() // time because doing it in ::Create() doesn't work (for unknown reasons) void wxNotebook::OnSize(wxSizeEvent& event) { - static bool s_bFirstTime = TRUE; - if ( s_bFirstTime ) { - // TODO: any first-time-size processing. - s_bFirstTime = FALSE; - } - - // TODO: all this may or may not be necessary for your platform - // emulate page change (it's esp. important to do it first time because // otherwise our page would stay invisible) int nSel = m_nSelection;