]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/classic/statbmp.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxStaticBitmap
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
14 #include "wx/statbmp.h"
15 #include "wx/dcclient.h"
17 IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap
, wxControl
)
23 BEGIN_EVENT_TABLE(wxStaticBitmap
, wxStaticBitmapBase
)
24 EVT_PAINT(wxStaticBitmap::OnPaint
)
27 bool wxStaticBitmap::Create(wxWindow
*parent
, wxWindowID id
,
28 const wxBitmap
& bitmap
,
39 size
.x
= bitmap
.GetWidth() ;
41 size
.y
= bitmap
.GetHeight() ;
44 m_backgroundColour
= parent
->GetBackgroundColour() ;
45 m_foregroundColour
= parent
->GetForegroundColour() ;
49 m_windowId
= (int)NewControlId();
53 m_windowStyle
= style
;
55 bool ret
= wxControl::Create( parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
);
61 void wxStaticBitmap::SetBitmap(const wxBitmap
& bitmap
)
65 SetSize(wxSize(bitmap
.GetWidth(), bitmap
.GetHeight()));
69 void wxStaticBitmap::OnPaint( wxPaintEvent
& WXUNUSED(event
) )
74 dc
.DrawBitmap( m_bitmap
, 0 , 0 , TRUE
) ;
77 wxSize
wxStaticBitmap::DoGetBestSize() const
79 return wxWindow::DoGetBestSize() ;