]>
git.saurik.com Git - wxWidgets.git/blob - src/univ/statbmp.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: univ/statbmp.cpp
3 // Purpose: wxStaticBitmap implementation
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
21 #pragma implementation "univstatbmp.h"
24 #include "wx/wxprec.h"
35 #include "wx/statbmp.h"
36 #include "wx/validate.h"
39 #include "wx/univ/renderer.h"
40 #include "wx/univ/theme.h"
42 // ============================================================================
44 // ============================================================================
46 IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap
, wxControl
)
48 // ----------------------------------------------------------------------------
50 // ----------------------------------------------------------------------------
52 bool wxStaticBitmap::Create(wxWindow
*parent
,
54 const wxBitmap
&label
,
60 if ( !wxControl::Create(parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
) )
66 // and adjust our size to fit it after this
72 // ----------------------------------------------------------------------------
73 // bitmap/icon setting/getting and converting between
74 // ----------------------------------------------------------------------------
76 void wxStaticBitmap::SetBitmap(const wxBitmap
& bitmap
)
81 void wxStaticBitmap::SetIcon(const wxIcon
& icon
)
84 m_bitmap
.CopyFromIcon(icon
);
86 m_bitmap
= (const wxBitmap
&)icon
;
90 wxIcon
wxStaticBitmap::GetIcon() const
94 icon
.CopyFromBitmap(m_bitmap
);
96 icon
= (const wxIcon
&)m_bitmap
;
101 // ----------------------------------------------------------------------------
103 // ----------------------------------------------------------------------------
105 void wxStaticBitmap::DoDraw(wxControlRenderer
*renderer
)
107 wxControl::DoDraw(renderer
);
108 renderer
->DrawBitmap(GetBitmap());
111 #endif // wxUSE_STATBMP