changed layout hints to proper determining aqua layout presence before

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13301 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2002-01-01 14:36:05 +00:00
parent 0888ccc71f
commit dd47b3d3f3
2 changed files with 62 additions and 32 deletions

View File

@@ -32,18 +32,12 @@
// check that the page index is valid // check that the page index is valid
#define IS_VALID_PAGE(nPage) (((nPage) >= 0) && ((nPage) < GetPageCount())) #define IS_VALID_PAGE(nPage) (((nPage) >= 0) && ((nPage) < GetPageCount()))
#ifdef __DARWIN__ static bool constantsSet = false ;
// I got these values for Mac OS X from the Appearance mgr docs. (Mark Newsam)
const short kwxMacTabLeftMargin = 20 ; short kwxMacTabLeftMargin = 0 ;
const short kwxMacTabTopMargin = 38 ; short kwxMacTabTopMargin = 0 ;
const short kwxMacTabRightMargin = 20 ; short kwxMacTabRightMargin = 0 ;
const short kwxMacTabBottomMargin = 12 ; short kwxMacTabBottomMargin = 0 ;
#else
const short kwxMacTabLeftMargin = 16 ;
const short kwxMacTabTopMargin = 30 ;
const short kwxMacTabRightMargin = 16 ;
const short kwxMacTabBottomMargin = 16 ;
#endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// event table // event table
@@ -76,10 +70,31 @@ IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxCommandEvent)
// common part of all ctors // common part of all ctors
void wxNotebook::Init() void wxNotebook::Init()
{ {
#ifdef __DARWIN__ if ( !constantsSet )
m_macHorizontalBorder = 7; {
m_macVerticalBorder = 8; if ( UMAHasAquaLayout() )
#endif {
// I got these values for Mac OS X from the Appearance mgr docs. (Mark Newsam)
kwxMacTabLeftMargin = 20 ;
kwxMacTabTopMargin = 38 ;
kwxMacTabRightMargin = 20 ;
kwxMacTabBottomMargin = 12 ;
}
else
{
kwxMacTabLeftMargin = 16 ;
kwxMacTabTopMargin = 30 ;
kwxMacTabRightMargin = 16 ;
kwxMacTabBottomMargin = 16 ;
}
constantsSet = true ;
}
if ( UMAHasAquaLayout() )
{
m_macHorizontalBorder = 7;
m_macVerticalBorder = 8;
}
m_nSelection = -1; m_nSelection = -1;
} }

View File

@@ -32,18 +32,12 @@
// check that the page index is valid // check that the page index is valid
#define IS_VALID_PAGE(nPage) (((nPage) >= 0) && ((nPage) < GetPageCount())) #define IS_VALID_PAGE(nPage) (((nPage) >= 0) && ((nPage) < GetPageCount()))
#ifdef __DARWIN__ static bool constantsSet = false ;
// I got these values for Mac OS X from the Appearance mgr docs. (Mark Newsam)
const short kwxMacTabLeftMargin = 20 ; short kwxMacTabLeftMargin = 0 ;
const short kwxMacTabTopMargin = 38 ; short kwxMacTabTopMargin = 0 ;
const short kwxMacTabRightMargin = 20 ; short kwxMacTabRightMargin = 0 ;
const short kwxMacTabBottomMargin = 12 ; short kwxMacTabBottomMargin = 0 ;
#else
const short kwxMacTabLeftMargin = 16 ;
const short kwxMacTabTopMargin = 30 ;
const short kwxMacTabRightMargin = 16 ;
const short kwxMacTabBottomMargin = 16 ;
#endif
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// event table // event table
@@ -76,10 +70,31 @@ IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxCommandEvent)
// common part of all ctors // common part of all ctors
void wxNotebook::Init() void wxNotebook::Init()
{ {
#ifdef __DARWIN__ if ( !constantsSet )
m_macHorizontalBorder = 7; {
m_macVerticalBorder = 8; if ( UMAHasAquaLayout() )
#endif {
// I got these values for Mac OS X from the Appearance mgr docs. (Mark Newsam)
kwxMacTabLeftMargin = 20 ;
kwxMacTabTopMargin = 38 ;
kwxMacTabRightMargin = 20 ;
kwxMacTabBottomMargin = 12 ;
}
else
{
kwxMacTabLeftMargin = 16 ;
kwxMacTabTopMargin = 30 ;
kwxMacTabRightMargin = 16 ;
kwxMacTabBottomMargin = 16 ;
}
constantsSet = true ;
}
if ( UMAHasAquaLayout() )
{
m_macHorizontalBorder = 7;
m_macVerticalBorder = 8;
}
m_nSelection = -1; m_nSelection = -1;
} }