]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/statbmp.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxStaticBitmap
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "statbmp.h"
16 #include "wx/statbmp.h"
18 #if !USE_SHARED_LIBRARY
19 IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap
, wxControl
)
26 BEGIN_EVENT_TABLE(wxStaticBitmap
, wxControl
)
27 EVT_PAINT(wxStaticBitmap::OnPaint
)
30 bool wxStaticBitmap::Create(wxWindow
*parent
, wxWindowID id
,
31 const wxBitmap
& bitmap
,
37 m_messageBitmap
= bitmap
;
39 if (parent
) parent
->AddChild(this);
42 m_windowId
= (int)NewControlId();
46 m_windowStyle
= style
;
48 bool ret
= wxControl::Create( parent
, id
, pos
, size
, style
, name
);
53 void wxStaticBitmap::SetSize(int x
, int y
, int width
, int height
, int sizeFlags
)
55 wxControl::SetSize( x
, y
, width
, height
, sizeFlags
) ;
58 void wxStaticBitmap::SetBitmap(const wxBitmap
& bitmap
)
60 m_messageBitmap
= bitmap
;
64 void wxStaticBitmap::OnPaint( wxPaintEvent
&event
)
68 dc
.SetPalette( *m_messageBitmap
.GetPalette() ) ;
69 dc
.DrawBitmap( m_messageBitmap
, 0 , 0 ) ;