]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/motif/statbmp.h | |
3 | // Purpose: wxStaticBitmap class | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 17/09/98 | |
7 | // Copyright: (c) Julian Smart | |
8 | // Licence: wxWindows licence | |
9 | ///////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifndef _WX_STATBMP_H_ | |
12 | #define _WX_STATBMP_H_ | |
13 | ||
14 | #include "wx/motif/bmpmotif.h" | |
15 | #include "wx/icon.h" | |
16 | ||
17 | class WXDLLIMPEXP_CORE wxStaticBitmap : public wxStaticBitmapBase | |
18 | { | |
19 | DECLARE_DYNAMIC_CLASS(wxStaticBitmap) | |
20 | ||
21 | public: | |
22 | wxStaticBitmap() { } | |
23 | virtual ~wxStaticBitmap(); | |
24 | ||
25 | wxStaticBitmap(wxWindow *parent, wxWindowID id, | |
26 | const wxBitmap& label, | |
27 | const wxPoint& pos = wxDefaultPosition, | |
28 | const wxSize& size = wxDefaultSize, | |
29 | long style = 0, | |
30 | const wxString& name = wxStaticBitmapNameStr) | |
31 | { | |
32 | Create(parent, id, label, pos, size, style, name); | |
33 | } | |
34 | ||
35 | bool Create(wxWindow *parent, wxWindowID id, | |
36 | const wxBitmap& label, | |
37 | const wxPoint& pos = wxDefaultPosition, | |
38 | const wxSize& size = wxDefaultSize, | |
39 | long style = 0, | |
40 | const wxString& name = wxStaticBitmapNameStr); | |
41 | ||
42 | virtual void SetBitmap(const wxBitmap& bitmap); | |
43 | ||
44 | virtual bool ProcessCommand(wxCommandEvent& WXUNUSED(event)) | |
45 | { | |
46 | return false; | |
47 | } | |
48 | ||
49 | wxBitmap GetBitmap() const { return m_messageBitmap; } | |
50 | ||
51 | // for compatibility with wxMSW | |
52 | wxIcon GetIcon() const | |
53 | { | |
54 | // don't use wxDynamicCast, icons and bitmaps are really the same thing | |
55 | return *(wxIcon*)&m_messageBitmap; | |
56 | } | |
57 | ||
58 | // for compatibility with wxMSW | |
59 | void SetIcon(const wxIcon& icon) | |
60 | { | |
61 | SetBitmap( icon ); | |
62 | } | |
63 | ||
64 | // Implementation | |
65 | virtual void ChangeBackgroundColour(); | |
66 | virtual void ChangeForegroundColour(); | |
67 | ||
68 | protected: | |
69 | void DoSetBitmap(); | |
70 | ||
71 | protected: | |
72 | wxBitmap m_messageBitmap; | |
73 | wxBitmap m_messageBitmapOriginal; | |
74 | wxBitmapCache m_bitmapCache; | |
75 | }; | |
76 | ||
77 | #endif | |
78 | // _WX_STATBMP_H_ |