]>
Commit | Line | Data |
---|---|---|
2bda0e17 | 1 | ///////////////////////////////////////////////////////////////////////////// |
1e6feb95 VZ |
2 | // Name: wx/msw/statbmp.h |
3 | // Purpose: wxStaticBitmap class for wxMSW | |
2bda0e17 KB |
4 | // Author: Julian Smart |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
bbcdf8bc | 8 | // Copyright: (c) Julian Smart |
65571936 | 9 | // Licence: wxWindows licence |
2bda0e17 KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
bbcdf8bc JS |
12 | #ifndef _WX_STATBMP_H_ |
13 | #define _WX_STATBMP_H_ | |
2bda0e17 | 14 | |
2bda0e17 | 15 | #include "wx/control.h" |
916d0b61 | 16 | #include "wx/icon.h" |
4304b42f | 17 | #include "wx/bitmap.h" |
2bda0e17 | 18 | |
63ec432b | 19 | extern WXDLLEXPORT_DATA(const wxChar) wxStaticBitmapNameStr[]; |
2bda0e17 | 20 | |
9e3e0821 | 21 | // a control showing an icon or a bitmap |
1e6feb95 | 22 | class WXDLLEXPORT wxStaticBitmap : public wxStaticBitmapBase |
2bda0e17 | 23 | { |
06b57134 | 24 | public: |
9e3e0821 VZ |
25 | wxStaticBitmap() { Init(); } |
26 | ||
27 | wxStaticBitmap(wxWindow *parent, | |
28 | wxWindowID id, | |
6d167489 | 29 | const wxGDIImage& label, |
9e3e0821 VZ |
30 | const wxPoint& pos = wxDefaultPosition, |
31 | const wxSize& size = wxDefaultSize, | |
32 | long style = 0, | |
33 | const wxString& name = wxStaticBitmapNameStr) | |
06b57134 | 34 | { |
46a5e01e VZ |
35 | Init(); |
36 | ||
06b57134 VZ |
37 | Create(parent, id, label, pos, size, style, name); |
38 | } | |
9e3e0821 VZ |
39 | |
40 | bool Create(wxWindow *parent, | |
41 | wxWindowID id, | |
6d167489 | 42 | const wxGDIImage& label, |
9e3e0821 VZ |
43 | const wxPoint& pos = wxDefaultPosition, |
44 | const wxSize& size = wxDefaultSize, | |
45 | long style = 0, | |
46 | const wxString& name = wxStaticBitmapNameStr); | |
47 | ||
48 | virtual ~wxStaticBitmap() { Free(); } | |
49 | ||
1e6feb95 VZ |
50 | virtual void SetIcon(const wxIcon& icon) { SetImage(&icon); } |
51 | virtual void SetBitmap(const wxBitmap& bitmap) { SetImage(&bitmap); } | |
a44fb285 VZ |
52 | virtual wxBitmap GetBitmap() const; |
53 | virtual wxIcon GetIcon() const; | |
46a5e01e | 54 | |
9e3e0821 | 55 | |
06b57134 | 56 | protected: |
65bc172c | 57 | virtual wxBorder GetDefaultBorder() const; |
9d17ee60 | 58 | virtual wxSize DoGetBestSize() const; |
46a5e01e | 59 | virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; |
6d167489 | 60 | |
46a5e01e | 61 | // ctor/dtor helpers |
3dece6c4 | 62 | void Init() { m_isIcon = true; m_image = NULL; m_currentHandle = 0; } |
9e3e0821 VZ |
63 | void Free(); |
64 | ||
57f4f925 | 65 | // true if icon/bitmap is valid |
9e3e0821 VZ |
66 | bool ImageIsOk() const; |
67 | ||
4004f41e | 68 | void SetImage(const wxGDIImage* image); |
d8bffc13 | 69 | void SetImageNoCopy( wxGDIImage* image ); |
6d167489 | 70 | |
9e3e0821 VZ |
71 | // we can have either an icon or a bitmap |
72 | bool m_isIcon; | |
6d167489 | 73 | wxGDIImage *m_image; |
3dece6c4 JS |
74 | // handle used in last call to STM_SETIMAGE |
75 | HGDIOBJ m_currentHandle; | |
1e6feb95 VZ |
76 | |
77 | private: | |
78 | DECLARE_DYNAMIC_CLASS(wxStaticBitmap) | |
22f3361e | 79 | DECLARE_NO_COPY_CLASS(wxStaticBitmap) |
2bda0e17 KB |
80 | }; |
81 | ||
82 | #endif | |
bbcdf8bc | 83 | // _WX_STATBMP_H_ |