]>
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
) )
63 m_hasDialogBackground
= TRUE
;
68 // and adjust our size to fit it after this
74 // ----------------------------------------------------------------------------
75 // bitmap/icon setting/getting and converting between
76 // ----------------------------------------------------------------------------
78 void wxStaticBitmap::SetBitmap(const wxBitmap
& bitmap
)
83 void wxStaticBitmap::SetIcon(const wxIcon
& icon
)
86 m_bitmap
.CopyFromIcon(icon
);
88 m_bitmap
= (const wxBitmap
&)icon
;
92 wxIcon
wxStaticBitmap::GetIcon() const
96 icon
.CopyFromBitmap(m_bitmap
);
98 icon
= (const wxIcon
&)m_bitmap
;
103 // ----------------------------------------------------------------------------
105 // ----------------------------------------------------------------------------
107 void wxStaticBitmap::DoDraw(wxControlRenderer
*renderer
)
109 wxControl::DoDraw(renderer
);
110 renderer
->DrawBitmap(GetBitmap());
113 #endif // wxUSE_STATBMP