]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/statbrma.cpp
1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: native implementation of wxStatusBar (optional)
8 // Copyright: (c) 1998 AUTHOR
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "statbar.h"
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 #include "wx/statusbr.h"
22 #include "wx/dcclient.h"
24 #if !USE_SHARED_LIBRARY
25 IMPLEMENT_DYNAMIC_CLASS(wxStatusBarMac
, wxStatusBarGeneric
);
27 BEGIN_EVENT_TABLE(wxStatusBarMac
, wxStatusBarGeneric
)
28 EVT_PAINT(wxStatusBarMac::OnPaint
)
30 #endif //USE_SHARED_LIBRARY
33 // ============================================================================
35 // ============================================================================
37 // ----------------------------------------------------------------------------
38 // wxStatusBarMac class
39 // ----------------------------------------------------------------------------
41 wxStatusBarMac::wxStatusBarMac()
46 wxStatusBarMac::~wxStatusBarMac()
50 bool wxStatusBarMac::Create(wxWindow
*parent
, wxWindowID id
,
54 return wxStatusBarGeneric::Create( parent
, id
, style
, name
) ;
57 void wxStatusBarMac::DrawFieldText(wxDC
& dc
, int i
)
62 GetFieldRect(i
, rect
);
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::OnPaint(wxPaintEvent
& WXUNUSED(event
) )
88 wxPen
black( wxBLACK
, 1 , wxSOLID
) ;
89 wxPen
white( wxWHITE
, 1 , wxSOLID
) ;
100 if ( GetFont().Ok() )
101 dc
.SetFont(GetFont());
102 dc
.SetBackgroundMode(wxTRANSPARENT
);
104 for ( i
= 0; i
< m_nFields
; i
++ )
108 dc
.SetFont(wxNullFont
);