]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/statbmp.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxStaticBitmap
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
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
,
42 m_backgroundColour
= parent
->GetBackgroundColour() ;
43 m_foregroundColour
= parent
->GetForegroundColour() ;
47 m_windowId
= (int)NewControlId();
51 m_windowStyle
= style
;
53 bool ret
= wxControl::Create( parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
);
59 void wxStaticBitmap::SetBitmap(const wxBitmap
& bitmap
)
62 SetSize(GetBestSize());
66 void wxStaticBitmap::OnPaint( wxPaintEvent
& WXUNUSED(event
) )
71 dc
.DrawBitmap( m_bitmap
, 0 , 0 , TRUE
) ;
74 wxSize
wxStaticBitmap::DoGetBestSize() const
76 return DoGetSizeFromClientSize( wxSize( m_bitmap
.GetWidth() , m_bitmap
.GetHeight() ) ) ;