]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/statbrma.cpp
8220559531ab79855966c3752e5bf4a5e0a9e73d
1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: native implementation of wxStatusBar (optional)
4 // Author: Stefan Csomor
8 // Copyright: (c) 1998 Stefan Csomor
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "statbrma.h"
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 #include "wx/statusbr.h"
22 #include "wx/dcclient.h"
24 BEGIN_EVENT_TABLE(wxStatusBarMac
, wxStatusBarGeneric
)
25 EVT_PAINT(wxStatusBarMac::OnPaint
)
29 #include "wx/mac/private.h"
30 #include "wx/toplevel.h"
33 // ============================================================================
35 // ============================================================================
37 // ----------------------------------------------------------------------------
38 // wxStatusBarMac class
39 // ----------------------------------------------------------------------------
41 wxStatusBarMac::wxStatusBarMac()
46 wxStatusBarMac::~wxStatusBarMac()
50 bool wxStatusBarMac::Create(wxWindow
*parent
, wxWindowID id
,
54 if( !wxStatusBarGeneric::Create( parent
, id
, style
, name
) )
57 if ( parent
->MacGetTopLevelWindow()->MacGetMetalAppearance() )
58 MacSetBackgroundBrush( wxNullBrush
) ;
63 void wxStatusBarMac::DrawFieldText(wxDC
& dc
, int i
)
69 GetFieldRect(i
, rect
);
71 if ( !MacIsReallyHilited() )
73 dc
.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ;
76 wxString
text(GetStatusText(i
));
80 dc
.GetTextExtent(text
, &x
, &y
);
82 int xpos
= rect
.x
+ leftMargin
+ 1 ;
85 if ( MacGetTopLevelWindow()->MacGetMetalAppearance() )
88 dc
.SetClippingRegion(rect
.x
, 0, rect
.width
, h
);
90 dc
.DrawText(text
, xpos
, ypos
);
92 dc
.DestroyClippingRegion();
95 void wxStatusBarMac::DrawField(wxDC
& dc
, int i
)
100 void wxStatusBarMac::SetStatusText(const wxString
& text
, int number
)
102 wxCHECK_RET( (number
>= 0) && (number
< m_nFields
),
103 _T("invalid status bar field index") );
105 m_statusStrings
[number
] = text
;
107 GetFieldRect(number
, rect
);
112 Refresh( TRUE
, &rect
) ;
116 void wxStatusBarMac::OnPaint(wxPaintEvent
& WXUNUSED(event
) )
122 wxGetOsVersion( &major
, &minor
);
126 if ( MacIsReallyHilited() )
128 wxPen
white( wxWHITE
, 1 , wxSOLID
) ;
131 //Finder statusbar border color: (Project builder similar is 9B9B9B)
132 if ( MacGetTopLevelWindow()->MacGetMetalAppearance() )
133 dc
.SetPen(wxPen(wxColour(0x40,40,40) ,1,wxSOLID
)) ;
135 dc
.SetPen(wxPen(wxColour(0xB1,0xB1,0xB1),1,wxSOLID
));
139 wxPen
black( wxBLACK
, 1 , wxSOLID
) ;
151 //Finder statusbar border color: (Project builder similar is 9B9B9B)
152 dc
.SetPen(wxPen(wxColour(0xB1,0xB1,0xB1),1,wxSOLID
));
154 dc
.SetPen(wxPen(wxColour(0x80,0x80,0x80),1,wxSOLID
));
161 if ( GetFont().Ok() )
162 dc
.SetFont(GetFont());
163 dc
.SetBackgroundMode(wxTRANSPARENT
);
165 for ( i
= 0; i
< m_nFields
; i
++ )
169 void wxStatusBarMac::MacHiliteChanged()