X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6c1635b598d12c8605ae98b306763fa6613653e5..2b1d737b3e9413217302cde932cbc3af91d79024:/src/common/sizer.cpp diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index 27b781cf16..703882151e 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -36,10 +36,6 @@ #include "wx/notebook.h" #endif -#ifdef __WXMAC__ -# include "wx/mac/uma.h" -#endif - //--------------------------------------------------------------------------- IMPLEMENT_CLASS(wxSizerItem, wxObject) @@ -99,7 +95,7 @@ void wxSizerItem::Init() m_sizer = NULL; m_show = true; m_userData = NULL; - m_zoneRect = wxRect( 0, 0, 0, 0 ); + m_zoneRect = wxRect(0,0,0,0); } void wxSizerItem::Init(const wxSizerFlags& flags) @@ -119,7 +115,7 @@ wxSizerItem::wxSizerItem( int width, int height, int proportion, int flag, int b , m_proportion( proportion ) , m_border( border ) , m_flag( flag ) - , m_zoneRect( 0, 0, 0, 0 ) + , m_zoneRect() , m_show( true ) , m_userData( userData ) { @@ -132,7 +128,7 @@ wxSizerItem::wxSizerItem( wxWindow *window, int proportion, int flag, int border , m_proportion( proportion ) , m_border( border ) , m_flag( flag ) - , m_zoneRect( 0, 0, 0, 0 ) + , m_zoneRect() , m_show( true ) , m_userData( userData ) { @@ -152,7 +148,7 @@ wxSizerItem::wxSizerItem( wxSizer *sizer, int proportion, int flag, int border, , m_proportion( proportion ) , m_border( border ) , m_flag( flag ) - , m_zoneRect( 0, 0, 0, 0 ) + , m_zoneRect() , m_show( true ) , m_ratio( 0.0 ) , m_userData( userData ) @@ -363,7 +359,7 @@ int wxSizerItem::GetOption() const //--------------------------------------------------------------------------- wxSizer::wxSizer() - : m_minSize( wxSize( 0, 0 ) ) + :m_minSize() { } @@ -1582,43 +1578,7 @@ static void GetStaticBoxBorders( wxStaticBox *box, { // this has to be done platform by platform as there is no way to // guess the thickness of a wxStaticBox border -#ifdef __WXCOCOA__ - box->GetBordersForSizer(borderTop,borderOther); -#elif defined(__WXMAC__) - - static int extraTop = -1; // Uninitted - static int other = 5; - - if ( extraTop == -1 ) - { - // The minimal border used for the top. Later on the staticbox' - // font height is added to this. - extraTop = 0; - - if ( UMAGetSystemVersion() >= 0x1030 /*Panther*/ ) - { - // As indicated by the HIG, Panther needs an extra border of 11 - // pixels (otherwise overlapping occurs at the top). The "other" - // border has to be 11. - extraTop = 11; - other = 11; - } - - } - - *borderTop = extraTop + box->GetCharHeight(); - *borderOther = other; - -#else -#ifdef __WXGTK__ - if ( box->GetLabel().empty() ) - *borderTop = 5; - else -#endif // __WXGTK__ - *borderTop = box->GetCharHeight(); - - *borderOther = 5; -#endif // __WXCOCOA__ + box->GetBordersForSizer(borderTop, borderOther); } void wxStaticBoxSizer::RecalcSizes() @@ -1666,12 +1626,18 @@ void wxStaticBoxSizer::ShowItems( bool show ) wxStdDialogButtonSizer::wxStdDialogButtonSizer() : wxBoxSizer(wxHORIZONTAL) { + // Vertical buttons with lots of space on either side + // looks rubbish on WinCE, so let's not do this for now. + // If we are going to use vertical buttons, we should + // put the sizer to the right of other controls in the dialog, + // and that's beyond the scope of this sizer. +#ifndef __WXWINCE__ bool is_pda = (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA); - // If we have a PDA screen, put yes/no button over // all other buttons, otherwise on the left side. if (is_pda) m_orient = wxVERTICAL; +#endif m_buttonAffirmative = NULL; m_buttonApply = NULL; @@ -1699,6 +1665,7 @@ void wxStdDialogButtonSizer::AddButton(wxButton *mybutton) m_buttonCancel = mybutton; break; case wxID_HELP: + case wxID_CONTEXT_HELP: m_buttonHelp = mybutton; break; default: @@ -1721,7 +1688,7 @@ void wxStdDialogButtonSizer::SetCancelButton( wxButton *button ) m_buttonCancel = button; } -void wxStdDialogButtonSizer::Finalise() +void wxStdDialogButtonSizer::Realize() { #ifdef __WXMAC__ Add(0, 0, 0, wxLEFT, 6); @@ -1844,7 +1811,7 @@ void wxBookCtrlSizer::RecalcSizes() wxSize wxBookCtrlSizer::CalcMin() { - wxSize sizeBorder = m_bookctrl->CalcSizeFromPage(wxSize(0, 0)); + wxSize sizeBorder = m_bookctrl->CalcSizeFromPage(wxSize(0,0)); sizeBorder.x += 5; sizeBorder.y += 5;