]>
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"
18 #include "wx/statbmp.h"
19 #include "wx/dcclient.h"
21 #if !USE_SHARED_LIBRARY
22 IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap
, wxControl
)
29 BEGIN_EVENT_TABLE(wxStaticBitmap
, wxStaticBitmapBase
)
30 EVT_PAINT(wxStaticBitmap::OnPaint
)
33 bool wxStaticBitmap::Create(wxWindow
*parent
, wxWindowID id
,
34 const wxBitmap
& bitmap
,
43 m_backgroundColour
= parent
->GetBackgroundColour() ;
44 m_foregroundColour
= parent
->GetForegroundColour() ;
48 m_windowId
= (int)NewControlId();
52 m_windowStyle
= style
;
54 bool ret
= wxControl::Create( parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
);
60 void wxStaticBitmap::SetBitmap(const wxBitmap
& bitmap
)
64 SetBestSize(wxSize(bitmap
.GetWidth(), bitmap
.GetHeight()));
67 void wxStaticBitmap::OnPaint( wxPaintEvent
&event
)
72 dc
.DrawBitmap( m_bitmap
, 0 , 0 , TRUE
) ;
75 wxSize
wxStaticBitmap::DoGetBestSize() const
78 return wxSize(m_bitmap
.GetWidth(), m_bitmap
.GetHeight());
80 return wxSize(16, 16); // completely arbitrary