]>
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 licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 #include "wx/wxprec.h"
31 #include "wx/statbmp.h"
32 #include "wx/validate.h"
35 #include "wx/univ/renderer.h"
36 #include "wx/univ/theme.h"
38 // ============================================================================
40 // ============================================================================
42 IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap
, wxControl
)
44 // ----------------------------------------------------------------------------
46 // ----------------------------------------------------------------------------
48 bool wxStaticBitmap::Create(wxWindow
*parent
,
50 const wxBitmap
&label
,
56 if ( !wxControl::Create(parent
, id
, pos
, size
, style
, wxDefaultValidator
, name
) )
62 // and adjust our size to fit it after this
68 // ----------------------------------------------------------------------------
69 // bitmap/icon setting/getting and converting between
70 // ----------------------------------------------------------------------------
72 void wxStaticBitmap::SetBitmap(const wxBitmap
& bitmap
)
77 void wxStaticBitmap::SetIcon(const wxIcon
& icon
)
80 m_bitmap
.CopyFromIcon(icon
);
82 m_bitmap
= (const wxBitmap
&)icon
;
86 wxIcon
wxStaticBitmap::GetIcon() const
90 icon
.CopyFromBitmap(m_bitmap
);
92 icon
= (const wxIcon
&)m_bitmap
;
97 // ----------------------------------------------------------------------------
99 // ----------------------------------------------------------------------------
101 void wxStaticBitmap::DoDraw(wxControlRenderer
*renderer
)
103 wxControl::DoDraw(renderer
);
104 renderer
->DrawBitmap(GetBitmap());
107 #endif // wxUSE_STATBMP