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 WXDLLIMPEXP_DATA_CORE(const char) wxStaticBitmapNameStr
[];
21 // a control showing an icon or a bitmap
22 class WXDLLIMPEXP_CORE 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;
55 virtual WXDWORD
MSWGetStyle(long style
, WXDWORD
*exstyle
) const;
57 // returns true if the platform should explicitly apply a theme border
58 virtual bool CanApplyThemeBorder() const { return false; }
61 virtual wxSize
DoGetBestClientSize() const;
64 void Init() { m_isIcon
= true; m_image
= NULL
; m_currentHandle
= 0; }
67 // true if icon/bitmap is valid
68 bool ImageIsOk() const;
70 void SetImage(const wxGDIImage
* image
);
71 void SetImageNoCopy( wxGDIImage
* image
);
74 // draw the bitmap ourselves here if the OS can't do it correctly (if it
75 // can we leave it to it)
76 void DoPaintManually(wxPaintEvent
& event
);
77 #endif // !__WXWINCE__
79 void WXHandleSize(wxSizeEvent
& event
);
81 // we can have either an icon or a bitmap
85 // handle used in last call to STM_SETIMAGE
86 WXHANDLE m_currentHandle
;
89 DECLARE_DYNAMIC_CLASS(wxStaticBitmap
)
90 wxDECLARE_EVENT_TABLE();
91 wxDECLARE_NO_COPY_CLASS(wxStaticBitmap
);