1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/statbmpg.h
3 // Purpose: wxGenericStaticBitmap header
4 // Author: Marcin Wojdyr, Stefan Csomor
7 // Copyright: wxWidgets developers
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_GENERIC_STATBMP_H_
12 #define _WX_GENERIC_STATBMP_H_
14 #include "wx/statbmp.h"
16 class WXDLLIMPEXP_CORE wxGenericStaticBitmap
: public wxStaticBitmapBase
19 wxGenericStaticBitmap() {}
20 wxGenericStaticBitmap(wxWindow
*parent
,
22 const wxBitmap
& bitmap
,
23 const wxPoint
& pos
= wxDefaultPosition
,
24 const wxSize
& size
= wxDefaultSize
,
26 const wxString
& name
= wxStaticBitmapNameStr
)
28 Create(parent
, id
, bitmap
, pos
, size
, style
, name
);
31 bool Create(wxWindow
*parent
,
33 const wxBitmap
& bitmap
,
34 const wxPoint
& pos
= wxDefaultPosition
,
35 const wxSize
& size
= wxDefaultSize
,
37 const wxString
& name
= wxStaticBitmapNameStr
);
39 virtual void SetBitmap(const wxBitmap
& bitmap
)
42 SetInitialSize(GetBitmapSize());
46 virtual wxBitmap
GetBitmap() const { return m_bitmap
; }
48 virtual void SetIcon(const wxIcon
& icon
)
50 m_bitmap
.CopyFromIcon(icon
);
51 SetInitialSize(GetBitmapSize());
55 #if defined(__WXGTK20__) || defined(__WXMAC__)
56 // icons and bitmaps are really the same thing in wxGTK and wxMac
57 wxIcon
GetIcon() const { return (const wxIcon
&)m_bitmap
; }
62 wxSize
GetBitmapSize()
64 return m_bitmap
.Ok() ? wxSize(m_bitmap
.GetWidth(), m_bitmap
.GetHeight())
65 : wxSize(16, 16); // this is completely arbitrary
68 void OnPaint(wxPaintEvent
& event
);
72 DECLARE_DYNAMIC_CLASS(wxGenericStaticBitmap
)
76 #endif //_WX_GENERIC_STATBMP_H_