]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/statbrma.cpp
1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: native implementation of wxStatusBar (optional)
8 // Copyright: (c) 1998 AUTHOR
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "statusbr.h"
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 #include "wx/mac/statusbr.h"
22 #if !USE_SHARED_LIBRARY
23 IMPLEMENT_DYNAMIC_CLASS(wxStatusBarMac
, wxStatusBarGeneric
);
25 BEGIN_EVENT_TABLE(wxStatusBarMac
, wxStatusBarGeneric
)
26 EVT_PAINT(wxStatusBarMac::OnPaint
)
28 #endif //USE_SHARED_LIBRARY
31 // ============================================================================
33 // ============================================================================
35 // ----------------------------------------------------------------------------
36 // wxStatusBarXX 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 wxString
text(GetStatusText(i
));
66 dc
.GetTextExtent(text
, &x
, &y
);
68 int xpos
= rect
.x
+ leftMargin
+ 1 ;
71 dc
.SetClippingRegion(rect
.x
, 0, rect
.width
, m_height
);
73 dc
.DrawText(text
, xpos
, ypos
);
75 dc
.DestroyClippingRegion();
78 void wxStatusBarMac::DrawField(wxDC
& dc
, int i
)
83 void wxStatusBarMac::OnPaint(wxPaintEvent
& WXUNUSED(event
) )
86 wxPen
black( wxBLACK
, 1 , wxSOLID
) ;
87 wxPen
white( wxWHITE
, 1 , wxSOLID
) ;
99 dc
.SetFont(GetFont());
100 dc
.SetBackgroundMode(wxTRANSPARENT
);
102 for ( i
= 0; i
< m_nFields
; i
++ )
106 dc
.SetFont(wxNullFont
);