]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/statbmp.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxStaticBitmap
8 // Copyright: (c) AUTHOR
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
, wxControl
)
30 EVT_PAINT(wxStaticBitmap::OnPaint
)
33 bool wxStaticBitmap::Create(wxWindow
*parent
, wxWindowID id
,
34 const wxBitmap
& bitmap
,
43 m_backgroundColour
= parent
->GetBackgroundColour() ;
44 m_foregroundColour
= parent
->GetForegroundColour() ;
46 m_messageBitmap
= bitmap
;
48 m_windowId
= (int)NewControlId();
52 m_windowStyle
= style
;
54 bool ret
= wxControl::Create( parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
);
55 SetSizeOrDefault( size
) ;
60 void wxStaticBitmap::SetSize(int x
, int y
, int width
, int height
, int sizeFlags
)
62 wxControl::SetSize( x
, y
, width
, height
, sizeFlags
) ;
65 void wxStaticBitmap::SetBitmap(const wxBitmap
& bitmap
)
67 m_messageBitmap
= bitmap
;
72 void wxStaticBitmap::OnPaint( wxPaintEvent
&event
)
77 dc
.DrawBitmap( m_messageBitmap
, 0 , 0 , TRUE
) ;
80 wxSize
wxStaticBitmap::DoGetBestSize() const
82 if ( m_messageBitmap
.Ok() )
83 return wxSize(m_messageBitmap
.GetWidth(), m_messageBitmap
.GetHeight());
85 return wxSize(16, 16); // completely arbitrary