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 m_macBackgroundBrush
.MacSetTheme( kThemeBrushDialogBackgroundActive
) ;
61 void wxStatusBarMac::DrawFieldText(wxDC
& dc
, int i
)
67 GetFieldRect(i
, rect
);
69 if ( !IsWindowHilited( MAC_WXHWND( MacGetTopLevelWindowRef() ) ) )
71 dc
.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ;
74 wxString
text(GetStatusText(i
));
78 dc
.GetTextExtent(text
, &x
, &y
);
80 int xpos
= rect
.x
+ leftMargin
+ 1 ;
83 dc
.SetClippingRegion(rect
.x
, 0, rect
.width
, h
);
85 dc
.DrawText(text
, xpos
, ypos
);
87 dc
.DestroyClippingRegion();
90 void wxStatusBarMac::DrawField(wxDC
& dc
, int i
)
95 void wxStatusBarMac::SetStatusText(const wxString
& text
, int number
)
97 wxCHECK_RET( (number
>= 0) && (number
< m_nFields
),
98 _T("invalid status bar field index") );
100 m_statusStrings
[number
] = text
;
102 GetFieldRect(number
, rect
);
107 Refresh( TRUE
, &rect
) ;
111 void wxStatusBarMac::OnPaint(wxPaintEvent
& WXUNUSED(event
) )
117 wxGetOsVersion( &major
, &minor
);
121 if ( IsWindowHilited( MAC_WXHWND( MacGetTopLevelWindowRef() ) ) )
123 wxPen
white( wxWHITE
, 1 , wxSOLID
) ;
126 //Finder statusbar border color: (Project builder similar is 9B9B9B)
127 dc
.SetPen(wxPen(wxColour(0xB1,0xB1,0xB1),1,wxSOLID
));
131 wxPen
black( wxBLACK
, 1 , wxSOLID
) ;
143 //Finder statusbar border color: (Project builder similar is 9B9B9B)
144 dc
.SetPen(wxPen(wxColour(0xB1,0xB1,0xB1),1,wxSOLID
));
146 dc
.SetPen(wxPen(wxColour(0x80,0x80,0x80),1,wxSOLID
));
153 if ( GetFont().Ok() )
154 dc
.SetFont(GetFont());
155 dc
.SetBackgroundMode(wxTRANSPARENT
);
157 for ( i
= 0; i
< m_nFields
; i
++ )