1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/generic/statbmpg.h
3 // Purpose: wxGenericStaticBitmap header
4 // Author: Marcin Wojdyr, Stefan Csomor
6 // Copyright: wxWidgets developers
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_GENERIC_STATBMP_H_
11 #define _WX_GENERIC_STATBMP_H_
13 #include "wx/statbmp.h"
15 class WXDLLIMPEXP_CORE wxGenericStaticBitmap
: public wxStaticBitmapBase
18 wxGenericStaticBitmap() {}
19 wxGenericStaticBitmap(wxWindow
*parent
,
21 const wxBitmap
& bitmap
,
22 const wxPoint
& pos
= wxDefaultPosition
,
23 const wxSize
& size
= wxDefaultSize
,
25 const wxString
& name
= wxStaticBitmapNameStr
)
27 Create(parent
, id
, bitmap
, pos
, size
, style
, name
);
30 bool Create(wxWindow
*parent
,
32 const wxBitmap
& bitmap
,
33 const wxPoint
& pos
= wxDefaultPosition
,
34 const wxSize
& size
= wxDefaultSize
,
36 const wxString
& name
= wxStaticBitmapNameStr
);
38 virtual void SetBitmap(const wxBitmap
& bitmap
)
41 SetInitialSize(GetBitmapSize());
45 virtual wxBitmap
GetBitmap() const { return m_bitmap
; }
47 virtual void SetIcon(const wxIcon
& icon
)
49 m_bitmap
.CopyFromIcon(icon
);
50 SetInitialSize(GetBitmapSize());
54 #if defined(__WXGTK20__) || defined(__WXMAC__)
55 // icons and bitmaps are really the same thing in wxGTK and wxMac
56 wxIcon
GetIcon() const { return (const wxIcon
&)m_bitmap
; }
61 wxSize
GetBitmapSize()
63 return m_bitmap
.IsOk() ? wxSize(m_bitmap
.GetWidth(), m_bitmap
.GetHeight())
64 : wxSize(16, 16); // this is completely arbitrary
67 void OnPaint(wxPaintEvent
& event
);
71 DECLARE_DYNAMIC_CLASS(wxGenericStaticBitmap
)
75 #endif //_WX_GENERIC_STATBMP_H_