1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/msw/statbmp.h
3 // Purpose: wxStaticBitmap class for wxMSW
4 // Author: Julian Smart
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_STATBMP_H_
12 #define _WX_STATBMP_H_
14 #include "wx/control.h"
16 #include "wx/bitmap.h"
18 extern WXDLLIMPEXP_DATA_CORE(const char) wxStaticBitmapNameStr
[];
20 // a control showing an icon or a bitmap
21 class WXDLLIMPEXP_CORE wxStaticBitmap
: public wxStaticBitmapBase
24 wxStaticBitmap() { Init(); }
26 wxStaticBitmap(wxWindow
*parent
,
28 const wxGDIImage
& label
,
29 const wxPoint
& pos
= wxDefaultPosition
,
30 const wxSize
& size
= wxDefaultSize
,
32 const wxString
& name
= wxStaticBitmapNameStr
)
36 Create(parent
, id
, label
, pos
, size
, style
, name
);
39 bool Create(wxWindow
*parent
,
41 const wxGDIImage
& label
,
42 const wxPoint
& pos
= wxDefaultPosition
,
43 const wxSize
& size
= wxDefaultSize
,
45 const wxString
& name
= wxStaticBitmapNameStr
);
47 virtual ~wxStaticBitmap() { Free(); }
49 virtual void SetIcon(const wxIcon
& icon
) { SetImage(&icon
); }
50 virtual void SetBitmap(const wxBitmap
& bitmap
) { SetImage(&bitmap
); }
51 virtual wxBitmap
GetBitmap() const;
52 virtual wxIcon
GetIcon() const;
54 virtual WXDWORD
MSWGetStyle(long style
, WXDWORD
*exstyle
) const;
56 // returns true if the platform should explicitly apply a theme border
57 virtual bool CanApplyThemeBorder() const { return false; }
60 virtual wxSize
DoGetBestClientSize() const;
63 void Init() { m_isIcon
= true; m_image
= NULL
; m_currentHandle
= 0; }
66 // true if icon/bitmap is valid
67 bool ImageIsOk() const;
69 void SetImage(const wxGDIImage
* image
);
70 void SetImageNoCopy( wxGDIImage
* image
);
73 // draw the bitmap ourselves here if the OS can't do it correctly (if it
74 // can we leave it to it)
75 void DoPaintManually(wxPaintEvent
& event
);
76 #endif // !__WXWINCE__
78 void WXHandleSize(wxSizeEvent
& event
);
80 // we can have either an icon or a bitmap
84 // handle used in last call to STM_SETIMAGE
85 WXHANDLE m_currentHandle
;
88 DECLARE_DYNAMIC_CLASS(wxStaticBitmap
)
89 wxDECLARE_EVENT_TABLE();
90 wxDECLARE_NO_COPY_CLASS(wxStaticBitmap
);