]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/classic/statbrma.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/mac/classic/statbar.cpp
3 // Purpose: native implementation of wxStatusBar (optional)
4 // Author: Stefan Csomor
8 // Copyright: (c) 1998 Stefan Csomor
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 #include "wx/statusbr.h"
23 #include "wx/dcclient.h"
26 BEGIN_EVENT_TABLE(wxStatusBarMac
, wxStatusBarGeneric
)
27 EVT_PAINT(wxStatusBarMac::OnPaint
)
31 #include "wx/mac/private.h"
34 // ============================================================================
36 // ============================================================================
38 // ----------------------------------------------------------------------------
39 // wxStatusBarMac class
40 // ----------------------------------------------------------------------------
42 wxStatusBarMac::wxStatusBarMac()
47 wxStatusBarMac::~wxStatusBarMac()
51 bool wxStatusBarMac::Create(wxWindow
*parent
, wxWindowID id
,
55 return wxStatusBarGeneric::Create( parent
, id
, style
, name
) ;
58 void wxStatusBarMac::DrawFieldText(wxDC
& dc
, int i
)
63 GetFieldRect(i
, rect
);
65 if ( !IsWindowHilited( MAC_WXHWND( MacGetRootWindow() ) ) )
67 dc
.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ;
70 wxString
text(GetStatusText(i
));
74 dc
.GetTextExtent(text
, &x
, &y
);
76 int xpos
= rect
.x
+ leftMargin
+ 1 ;
79 dc
.SetClippingRegion(rect
.x
, 0, rect
.width
, m_height
);
81 dc
.DrawText(text
, xpos
, ypos
);
83 dc
.DestroyClippingRegion();
86 void wxStatusBarMac::DrawField(wxDC
& dc
, int i
)
91 void wxStatusBarMac::SetStatusText(const wxString
& text
, int number
)
93 wxCHECK_RET( (number
>= 0) && (number
< m_nFields
),
94 _T("invalid status bar field index") );
96 m_statusStrings
[number
] = text
;
98 GetFieldRect(number
, rect
);
100 rect
.height
= m_height
;
101 Refresh( true , &rect
) ;
105 void wxStatusBarMac::OnPaint(wxPaintEvent
& WXUNUSED(event
) )
111 wxGetOsVersion( &major
, &minor
);
113 if ( IsWindowHilited( MAC_WXHWND( MacGetRootWindow() ) ) )
115 wxPen
white( wxWHITE
, 1 , wxSOLID
) ;
118 //Finder statusbar border color: (Project builder similar is 9B9B9B)
119 dc
.SetPen(wxPen(wxColour(0xB1,0xB1,0xB1),1,wxSOLID
));
123 wxPen
black( wxBLACK
, 1 , wxSOLID
) ;
135 //Finder statusbar border color: (Project builder similar is 9B9B9B)
136 dc
.SetPen(wxPen(wxColour(0xB1,0xB1,0xB1),1,wxSOLID
));
138 dc
.SetPen(wxPen(wxColour(0x80,0x80,0x80),1,wxSOLID
));
145 if ( GetFont().Ok() )
146 dc
.SetFont(GetFont());
147 dc
.SetBackgroundMode(wxTRANSPARENT
);
149 for ( i
= 0; i
< m_nFields
; i
++ )
153 void wxStatusBarMac::MacSuperEnabled( bool enabled
)
156 wxWindow::MacSuperEnabled( enabled
) ;