1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/statbmp.h
3 // Purpose: wxStaticBitmap class for wxMSW
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_STATBMP_H_
13 #define _WX_STATBMP_H_
15 #include "wx/control.h"
17 #include "wx/bitmap.h"
19 extern WXDLLEXPORT_DATA(const wxChar
*) wxStaticBitmapNameStr
;
21 // a control showing an icon or a bitmap
22 class WXDLLEXPORT wxStaticBitmap
: public wxStaticBitmapBase
25 wxStaticBitmap() { Init(); }
27 wxStaticBitmap(wxWindow
*parent
,
29 const wxGDIImage
& label
,
30 const wxPoint
& pos
= wxDefaultPosition
,
31 const wxSize
& size
= wxDefaultSize
,
33 const wxString
& name
= wxStaticBitmapNameStr
)
37 Create(parent
, id
, label
, pos
, size
, style
, name
);
40 bool Create(wxWindow
*parent
,
42 const wxGDIImage
& label
,
43 const wxPoint
& pos
= wxDefaultPosition
,
44 const wxSize
& size
= wxDefaultSize
,
46 const wxString
& name
= wxStaticBitmapNameStr
);
48 virtual ~wxStaticBitmap() { Free(); }
50 virtual void SetIcon(const wxIcon
& icon
) { SetImage(&icon
); }
51 virtual void SetBitmap(const wxBitmap
& bitmap
) { SetImage(&bitmap
); }
52 virtual wxBitmap
GetBitmap() const;
53 virtual wxIcon
GetIcon() const;
57 virtual wxBorder
GetDefaultBorder() const;
58 virtual wxSize
DoGetBestSize() const;
59 virtual WXDWORD
MSWGetStyle(long style
, WXDWORD
*exstyle
) const;
62 void Init() { m_isIcon
= true; m_image
= NULL
; }
65 // true if icon/bitmap is valid
66 bool ImageIsOk() const;
68 void SetImage(const wxGDIImage
* image
);
69 void SetImageNoCopy( wxGDIImage
* image
);
71 // we can have either an icon or a bitmap
76 DECLARE_DYNAMIC_CLASS(wxStaticBitmap
)
77 DECLARE_NO_COPY_CLASS(wxStaticBitmap
)