]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/statbrma.cpp
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"
32 // ============================================================================
34 // ============================================================================
36 // ----------------------------------------------------------------------------
37 // wxStatusBarMac class
38 // ----------------------------------------------------------------------------
40 wxStatusBarMac::wxStatusBarMac()
45 wxStatusBarMac::~wxStatusBarMac()
49 bool wxStatusBarMac::Create(wxWindow
*parent
, wxWindowID id
,
53 if( !wxStatusBarGeneric::Create( parent
, id
, style
, name
) )
56 if ( parent
->MacGetTopLevelWindow()->MacGetMetalAppearance() )
57 MacSetBackgroundBrush( wxNullBrush
) ;
62 void wxStatusBarMac::DrawFieldText(wxDC
& dc
, int i
)
68 GetFieldRect(i
, rect
);
70 if ( !MacIsReallyHilited() )
72 dc
.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ;
75 wxString
text(GetStatusText(i
));
79 dc
.GetTextExtent(text
, &x
, &y
);
81 int xpos
= rect
.x
+ leftMargin
+ 1 ;
84 if ( MacGetTopLevelWindow()->MacGetMetalAppearance() )
87 dc
.SetClippingRegion(rect
.x
, 0, rect
.width
, h
);
89 dc
.DrawText(text
, xpos
, ypos
);
91 dc
.DestroyClippingRegion();
94 void wxStatusBarMac::DrawField(wxDC
& dc
, int i
)
99 void wxStatusBarMac::SetStatusText(const wxString
& text
, int number
)
101 wxCHECK_RET( (number
>= 0) && (number
< m_nFields
),
102 _T("invalid status bar field index") );
104 m_statusStrings
[number
] = text
;
106 GetFieldRect(number
, rect
);
111 Refresh( TRUE
, &rect
) ;
115 void wxStatusBarMac::OnPaint(wxPaintEvent
& WXUNUSED(event
) )
121 wxGetOsVersion( &major
, &minor
);
125 if ( MacIsReallyHilited() )
127 wxPen
white( wxWHITE
, 1 , wxSOLID
) ;
130 //Finder statusbar border color: (Project builder similar is 9B9B9B)
131 if ( MacGetTopLevelWindow()->MacGetMetalAppearance() )
132 dc
.SetPen(wxPen(wxColour(0x40,40,40) ,1,wxSOLID
)) ;
134 dc
.SetPen(wxPen(wxColour(0xB1,0xB1,0xB1),1,wxSOLID
));
138 wxPen
black( wxBLACK
, 1 , wxSOLID
) ;
150 //Finder statusbar border color: (Project builder similar is 9B9B9B)
151 dc
.SetPen(wxPen(wxColour(0xB1,0xB1,0xB1),1,wxSOLID
));
153 dc
.SetPen(wxPen(wxColour(0x80,0x80,0x80),1,wxSOLID
));
160 if ( GetFont().Ok() )
161 dc
.SetFont(GetFont());
162 dc
.SetBackgroundMode(wxTRANSPARENT
);
164 for ( i
= 0; i
< m_nFields
; i
++ )
168 void wxStatusBarMac::MacHiliteChanged()