]>
git.saurik.com Git - wxWidgets.git/blob - src/univ/statbmp.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/univ/statbmp.cpp
3 // Purpose: wxStaticBitmap implementation
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 #include "wx/wxprec.h"
28 #include "wx/statbmp.h"
33 #include "wx/validate.h"
36 #include "wx/univ/renderer.h"
37 #include "wx/univ/theme.h"
39 // ============================================================================
41 // ============================================================================
43 IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap
, wxControl
)
45 // ----------------------------------------------------------------------------
47 // ----------------------------------------------------------------------------
49 bool wxStaticBitmap::Create(wxWindow
*parent
,
51 const wxBitmap
&label
,
57 if ( !wxControl::Create(parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
) )
63 // and adjust our size to fit it after this
69 // ----------------------------------------------------------------------------
70 // bitmap/icon setting/getting and converting between
71 // ----------------------------------------------------------------------------
73 void wxStaticBitmap::SetBitmap(const wxBitmap
& bitmap
)
78 void wxStaticBitmap::SetIcon(const wxIcon
& icon
)
81 m_bitmap
.CopyFromIcon(icon
);
83 m_bitmap
= (const wxBitmap
&)icon
;
87 wxIcon
wxStaticBitmap::GetIcon() const
91 icon
.CopyFromBitmap(m_bitmap
);
93 icon
= (const wxIcon
&)m_bitmap
;
98 // ----------------------------------------------------------------------------
100 // ----------------------------------------------------------------------------
102 void wxStaticBitmap::DoDraw(wxControlRenderer
*renderer
)
104 wxControl::DoDraw(renderer
);
105 renderer
->DrawBitmap(GetBitmap());
108 #endif // wxUSE_STATBMP