X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/61fa2e39da3bc54c5dd7ca5b053dd90247c3abc1..6cef0db28018fd2644ee4e38af715872e5242459:/src/mac/carbon/statbrma.cpp?ds=inline diff --git a/src/mac/carbon/statbrma.cpp b/src/mac/carbon/statbrma.cpp index ee4fddd494..926198c3b0 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,40 +55,39 @@ 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() ) - MacSetBackgroundBrush( wxNullBrush ); + SetBackgroundStyle( wxBG_STYLE_TRANSPARENT ); // 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 ) ) ; - - wxString text(GetStatusText(i)); + dc.SetTextForeground( wxColour( 0x80, 0x80, 0x80 ) ); - long x, y; + wxString text(GetStatusText( i )); + wxCoord 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 +176,6 @@ void wxStatusBarMac::MacHiliteChanged() Refresh(); Update(); } + +#endif // wxUSE_STATUSBAR +