]>
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 /////////////////////////////////////////////////////////////////////////////
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
,
45 size
.x
= bitmap
.GetWidth() ;
47 size
.y
= bitmap
.GetHeight() ;
50 m_backgroundColour
= parent
->GetBackgroundColour() ;
51 m_foregroundColour
= parent
->GetForegroundColour() ;
55 m_windowId
= (int)NewControlId();
59 m_windowStyle
= style
;
61 bool ret
= wxControl::Create( parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
);
67 void wxStaticBitmap::SetBitmap(const wxBitmap
& bitmap
)
70 SetSize(wxSize(bitmap
.GetWidth(), bitmap
.GetHeight()));
74 void wxStaticBitmap::OnPaint( wxPaintEvent
& WXUNUSED(event
) )
79 dc
.DrawBitmap( m_bitmap
, 0 , 0 , TRUE
) ;
82 wxSize
wxStaticBitmap::DoGetBestSize() const
84 return wxWindow::DoGetBestSize() ;