]>
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 // ----------------------------------------------------------------------------
14 // ----------------------------------------------------------------------------
16 #include "wx/statusbr.h"
20 #include "wx/dcclient.h"
23 BEGIN_EVENT_TABLE(wxStatusBarMac
, wxStatusBarGeneric
)
24 EVT_PAINT(wxStatusBarMac::OnPaint
)
28 #include "wx/mac/private.h"
31 // ============================================================================
33 // ============================================================================
35 // ----------------------------------------------------------------------------
36 // wxStatusBarMac class
37 // ----------------------------------------------------------------------------
39 wxStatusBarMac::wxStatusBarMac()
44 wxStatusBarMac::~wxStatusBarMac()
48 bool wxStatusBarMac::Create(wxWindow
*parent
, wxWindowID id
,
52 return wxStatusBarGeneric::Create( parent
, id
, style
, name
) ;
55 void wxStatusBarMac::DrawFieldText(wxDC
& dc
, int i
)
60 GetFieldRect(i
, rect
);
62 if ( !IsWindowHilited( MAC_WXHWND( MacGetRootWindow() ) ) )
64 dc
.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ;
67 wxString
text(GetStatusText(i
));
71 dc
.GetTextExtent(text
, &x
, &y
);
73 int xpos
= rect
.x
+ leftMargin
+ 1 ;
76 dc
.SetClippingRegion(rect
.x
, 0, rect
.width
, m_height
);
78 dc
.DrawText(text
, xpos
, ypos
);
80 dc
.DestroyClippingRegion();
83 void wxStatusBarMac::DrawField(wxDC
& dc
, int i
)
88 void wxStatusBarMac::SetStatusText(const wxString
& text
, int number
)
90 wxCHECK_RET( (number
>= 0) && (number
< m_nFields
),
91 _T("invalid status bar field index") );
93 m_statusStrings
[number
] = text
;
95 GetFieldRect(number
, rect
);
97 rect
.height
= m_height
;
98 Refresh( TRUE
, &rect
) ;
102 void wxStatusBarMac::OnPaint(wxPaintEvent
& WXUNUSED(event
) )
108 wxGetOsVersion( &major
, &minor
);
110 if ( IsWindowHilited( MAC_WXHWND( MacGetRootWindow() ) ) )
112 wxPen
white( wxWHITE
, 1 , wxSOLID
) ;
115 //Finder statusbar border color: (Project builder similar is 9B9B9B)
116 dc
.SetPen(wxPen(wxColour(0xB1,0xB1,0xB1),1,wxSOLID
));
120 wxPen
black( wxBLACK
, 1 , wxSOLID
) ;
132 //Finder statusbar border color: (Project builder similar is 9B9B9B)
133 dc
.SetPen(wxPen(wxColour(0xB1,0xB1,0xB1),1,wxSOLID
));
135 dc
.SetPen(wxPen(wxColour(0x80,0x80,0x80),1,wxSOLID
));
142 if ( GetFont().Ok() )
143 dc
.SetFont(GetFont());
144 dc
.SetBackgroundMode(wxTRANSPARENT
);
146 for ( i
= 0; i
< m_nFields
; i
++ )
150 void wxStatusBarMac::MacSuperEnabled( bool enabled
)
153 wxWindow::MacSuperEnabled( enabled
) ;