#pragma implementation "notebook.h"
#endif
-#include <wx/string.h>
-#include <wx/log.h>
-#include <wx/imaglist.h>
-#include <wx/notebook.h>
-#include <wx/mac/uma.h>
+#include "wx/string.h"
+#include "wx/log.h"
+#include "wx/imaglist.h"
+#include "wx/notebook.h"
+#include "wx/mac/uma.h"
// ----------------------------------------------------------------------------
// macros
// ----------------------------------------------------------------------------
// 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 ;
// common part of all ctors
void wxNotebook::Init()
{
-#ifdef __WXMAC_X__
+#ifdef __DARWIN__
m_macHorizontalBorder = 7;
m_macVerticalBorder = 8;
#endif
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->MacGetRootWindow() , &bounds , title , false , 0 , 0 , 1,
kControlTabSmallProc , (long) this ) ;
MacPostControlCreate() ;
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 ) ;
}
Rect bounds;
GetControlBounds(m_macControl, &bounds);
- InvalWindowRect(GetMacRootWindow(), &bounds);
+ InvalWindowRect(MacGetRootWindow(), &bounds);
}
// ----------------------------------------------------------------------------