]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/bmpbuttn.h
wxMessageBox off the main thread lost result code.
[wxWidgets.git] / include / wx / motif / bmpbuttn.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/bmpbuttn.h
3 // Purpose: wxBitmapButton 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_BMPBUTTN_H_
12 #define _WX_BMPBUTTN_H_
13
14 #include "wx/motif/bmpmotif.h"
15
16 #define wxDEFAULT_BUTTON_MARGIN 4
17
18 class WXDLLIMPEXP_CORE wxBitmapButton: public wxBitmapButtonBase
19 {
20 public:
21 wxBitmapButton();
22 virtual ~wxBitmapButton();
23 wxBitmapButton(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
24 const wxPoint& pos = wxDefaultPosition,
25 const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
26 const wxValidator& validator = wxDefaultValidator,
27 const wxString& name = wxButtonNameStr)
28 {
29 Create(parent, id, bitmap, pos, size, style, validator, name);
30 }
31
32 bool Create(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap,
33 const wxPoint& pos = wxDefaultPosition,
34 const wxSize& size = wxDefaultSize, long style = wxBU_AUTODRAW,
35 const wxValidator& validator = wxDefaultValidator,
36 const wxString& name = wxButtonNameStr);
37
38 // Implementation
39 virtual void ChangeBackgroundColour();
40
41 protected:
42 virtual wxSize DoGetBestSize() const;
43
44 virtual void DoSetBitmap(const wxBitmap& bitmap, State which);
45 virtual void OnSetBitmap();
46
47 // original bitmaps may be different from the ones we were initialized with
48 // if they were changed to reflect button background colour
49 wxBitmap m_bitmapsOriginal[State_Max];
50
51 wxBitmapCache m_bitmapCache;
52
53 WXPixmap m_insensPixmap;
54
55 DECLARE_DYNAMIC_CLASS(wxBitmapButton)
56 };
57
58 #endif // _WX_BMPBUTTN_H_