]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/classic/statbmp.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/mac/classic/statbmp.cpp
3 // Purpose: wxStaticBitmap
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
18 #include "wx/statbmp.h"
21 #include "wx/dcclient.h"
24 IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap
, wxControl
)
30 BEGIN_EVENT_TABLE(wxStaticBitmap
, wxStaticBitmapBase
)
31 EVT_PAINT(wxStaticBitmap::OnPaint
)
34 bool wxStaticBitmap::Create(wxWindow
*parent
, wxWindowID id
,
35 const wxBitmap
& bitmap
,
46 size
.x
= bitmap
.GetWidth() ;
48 size
.y
= bitmap
.GetHeight() ;
51 m_backgroundColour
= parent
->GetBackgroundColour() ;
52 m_foregroundColour
= parent
->GetForegroundColour() ;
56 m_windowId
= (int)NewControlId();
60 m_windowStyle
= style
;
62 bool ret
= wxControl::Create( parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
);
63 SetInitialSize( size
) ;
68 void wxStaticBitmap::SetBitmap(const wxBitmap
& bitmap
)
72 SetSize(wxSize(bitmap
.GetWidth(), bitmap
.GetHeight()));
76 void wxStaticBitmap::OnPaint( wxPaintEvent
& WXUNUSED(event
) )
81 dc
.DrawBitmap( m_bitmap
, 0 , 0 , true ) ;
84 wxSize
wxStaticBitmap::DoGetBestSize() const
86 return wxWindow::DoGetBestSize() ;