X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/61fa2e39da3bc54c5dd7ca5b053dd90247c3abc1..b80e3a2a4fe23568edf2cc1580b330bad7ff0f51:/src/mac/carbon/statbrma.cpp diff --git a/src/mac/carbon/statbrma.cpp b/src/mac/carbon/statbrma.cpp index ee4fddd494..9bca84cca9 100644 --- a/src/mac/carbon/statbrma.cpp +++ b/src/mac/carbon/statbrma.cpp @@ -11,12 +11,17 @@ #include "wx/wxprec.h" +#if wxUSE_STATUSBAR + #include "wx/statusbr.h" -#include "wx/dc.h" -#include "wx/dcclient.h" + +#ifndef WX_PRECOMP + #include "wx/dc.h" + #include "wx/dcclient.h" + #include "wx/toplevel.h" +#endif #include "wx/mac/private.h" -#include "wx/toplevel.h" BEGIN_EVENT_TABLE(wxStatusBarMac, wxStatusBarGeneric) @@ -24,7 +29,20 @@ BEGIN_EVENT_TABLE(wxStatusBarMac, wxStatusBarGeneric) END_EVENT_TABLE() +wxStatusBarMac::wxStatusBarMac(wxWindow *parent, + wxWindowID id, + long style, + const wxString& name) + : + wxStatusBarGeneric() +{ + SetParent( NULL ); + Create( parent, id, style, name ); +} + wxStatusBarMac::wxStatusBarMac() + : + wxStatusBarGeneric() { SetParent( NULL ); } @@ -37,7 +55,7 @@ bool wxStatusBarMac::Create(wxWindow *parent, wxWindowID id, long style , const wxString& name) { - if ( !wxStatusBarGeneric::Create( parent , id , style , name ) ) + if ( !wxStatusBarGeneric::Create( parent, id, style, name ) ) return false; if ( parent->MacGetTopLevelWindow()->MacGetMetalAppearance() ) @@ -46,31 +64,31 @@ bool wxStatusBarMac::Create(wxWindow *parent, wxWindowID id, // normal system font is too tall for fitting into the standard height SetWindowVariant( wxWINDOW_VARIANT_SMALL ); - return true ; + return true; } void wxStatusBarMac::DrawFieldText(wxDC& dc, int i) { - int leftMargin = 2; - int w, h ; - GetSize( &w , &h ) ; + int w, h; + GetSize( &w , &h ); wxRect rect; - GetFieldRect(i, rect); + GetFieldRect( i, rect ); if ( !MacIsReallyHilited() ) - dc.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ; + dc.SetTextForeground( wxColour( 0x80, 0x80, 0x80 ) ); - wxString text(GetStatusText(i)); + wxString text(GetStatusText( i )); long x, y; dc.GetTextExtent(text, &x, &y); - int xpos = rect.x + leftMargin + 1 ; - int ypos = 1 ; + int leftMargin = 2; + int xpos = rect.x + leftMargin + 1; + int ypos = 1; if ( MacGetTopLevelWindow()->MacGetMetalAppearance() ) - ypos++ ; + ypos++; dc.SetClippingRegion(rect.x, 0, rect.width, h); @@ -159,3 +177,6 @@ void wxStatusBarMac::MacHiliteChanged() Refresh(); Update(); } + +#endif // wxUSE_STATUSBAR +