]>
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::SetSize(int x
, int y
, int width
, int height
, int sizeFlags
)
62 wxControl::SetSize( x
, y
, width
, height
, sizeFlags
) ;
65 void wxStaticBitmap::SetBitmap(const wxBitmap
& bitmap
)
69 SetBestSize(wxSize(bitmap
.GetWidth(), bitmap
.GetHeight()));
72 void wxStaticBitmap::OnPaint( wxPaintEvent
&event
)
77 dc
.DrawBitmap( m_bitmap
, 0 , 0 , TRUE
) ;
80 wxSize
wxStaticBitmap::DoGetBestSize() const
83 return wxSize(m_bitmap
.GetWidth(), m_bitmap
.GetHeight());
85 return wxSize(16, 16); // completely arbitrary