]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/classic/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 ///////////////////////////////////////////////////////////////////////////////
12 // ----------------------------------------------------------------------------
14 // ----------------------------------------------------------------------------
16 #include "wx/statusbr.h"
18 #include "wx/dcclient.h"
20 BEGIN_EVENT_TABLE(wxStatusBarMac
, wxStatusBarGeneric
)
21 EVT_PAINT(wxStatusBarMac::OnPaint
)
25 #include "wx/mac/private.h"
28 // ============================================================================
30 // ============================================================================
32 // ----------------------------------------------------------------------------
33 // wxStatusBarMac class
34 // ----------------------------------------------------------------------------
36 wxStatusBarMac::wxStatusBarMac()
41 wxStatusBarMac::~wxStatusBarMac()
45 bool wxStatusBarMac::Create(wxWindow
*parent
, wxWindowID id
,
49 return wxStatusBarGeneric::Create( parent
, id
, style
, name
) ;
52 void wxStatusBarMac::DrawFieldText(wxDC
& dc
, int i
)
57 GetFieldRect(i
, rect
);
59 if ( !IsWindowHilited( MAC_WXHWND( MacGetRootWindow() ) ) )
61 dc
.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ;
64 wxString
text(GetStatusText(i
));
68 dc
.GetTextExtent(text
, &x
, &y
);
70 int xpos
= rect
.x
+ leftMargin
+ 1 ;
73 dc
.SetClippingRegion(rect
.x
, 0, rect
.width
, m_height
);
75 dc
.DrawText(text
, xpos
, ypos
);
77 dc
.DestroyClippingRegion();
80 void wxStatusBarMac::DrawField(wxDC
& dc
, int i
)
85 void wxStatusBarMac::SetStatusText(const wxString
& text
, int number
)
87 wxCHECK_RET( (number
>= 0) && (number
< m_nFields
),
88 _T("invalid status bar field index") );
90 m_statusStrings
[number
] = text
;
92 GetFieldRect(number
, rect
);
94 rect
.height
= m_height
;
95 Refresh( TRUE
, &rect
) ;
99 void wxStatusBarMac::OnPaint(wxPaintEvent
& WXUNUSED(event
) )
105 wxGetOsVersion( &major
, &minor
);
107 if ( IsWindowHilited( MAC_WXHWND( MacGetRootWindow() ) ) )
109 wxPen
white( wxWHITE
, 1 , wxSOLID
) ;
112 //Finder statusbar border color: (Project builder similar is 9B9B9B)
113 dc
.SetPen(wxPen(wxColour(0xB1,0xB1,0xB1),1,wxSOLID
));
117 wxPen
black( wxBLACK
, 1 , wxSOLID
) ;
129 //Finder statusbar border color: (Project builder similar is 9B9B9B)
130 dc
.SetPen(wxPen(wxColour(0xB1,0xB1,0xB1),1,wxSOLID
));
132 dc
.SetPen(wxPen(wxColour(0x80,0x80,0x80),1,wxSOLID
));
139 if ( GetFont().Ok() )
140 dc
.SetFont(GetFont());
141 dc
.SetBackgroundMode(wxTRANSPARENT
);
143 for ( i
= 0; i
< m_nFields
; i
++ )
147 void wxStatusBarMac::MacSuperEnabled( bool enabled
)
150 wxWindow::MacSuperEnabled( enabled
) ;