]>
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"
19 #include "wx/dcclient.h"
21 IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap
, wxControl
)
27 BEGIN_EVENT_TABLE(wxStaticBitmap
, wxStaticBitmapBase
)
28 EVT_PAINT(wxStaticBitmap::OnPaint
)
31 bool wxStaticBitmap::Create(wxWindow
*parent
, wxWindowID id
,
32 const wxBitmap
& bitmap
,
43 size
.x
= bitmap
.GetWidth() ;
45 size
.y
= bitmap
.GetHeight() ;
48 m_backgroundColour
= parent
->GetBackgroundColour() ;
49 m_foregroundColour
= parent
->GetForegroundColour() ;
53 m_windowId
= (int)NewControlId();
57 m_windowStyle
= style
;
59 bool ret
= wxControl::Create( parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
);
65 void wxStaticBitmap::SetBitmap(const wxBitmap
& bitmap
)
69 SetSize(wxSize(bitmap
.GetWidth(), bitmap
.GetHeight()));
73 void wxStaticBitmap::OnPaint( wxPaintEvent
& WXUNUSED(event
) )
78 dc
.DrawBitmap( m_bitmap
, 0 , 0 , true ) ;
81 wxSize
wxStaticBitmap::DoGetBestSize() const
83 return wxWindow::DoGetBestSize() ;