]>
Commit | Line | Data |
---|---|---|
1e6feb95 VZ |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/button.h | |
3 | // Purpose: wxButtonBase class | |
4 | // Author: Vadim Zetlin | |
5 | // Modified by: | |
6 | // Created: 15.08.00 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Vadim Zetlin | |
65571936 | 9 | // Licence: wxWindows licence |
1e6feb95 VZ |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
34138703 JS |
12 | #ifndef _WX_BUTTON_H_BASE_ |
13 | #define _WX_BUTTON_H_BASE_ | |
c801d85f | 14 | |
401e3b6e VS |
15 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
16 | #pragma interface "buttonbase.h" | |
17 | #endif | |
18 | ||
997176a3 VZ |
19 | #include "wx/defs.h" |
20 | ||
7ef8bfc4 | 21 | // ---------------------------------------------------------------------------- |
0b4f47a3 | 22 | // wxButton flags shared with other classes |
7ef8bfc4 VZ |
23 | // ---------------------------------------------------------------------------- |
24 | ||
0b4f47a3 | 25 | #if wxUSE_TOGGLEBTN || wxUSE_BUTTON |
7ccb2521 VZ |
26 | |
27 | // These flags affect label alignment | |
7ef8bfc4 VZ |
28 | #define wxBU_LEFT 0x0040 |
29 | #define wxBU_TOP 0x0080 | |
30 | #define wxBU_RIGHT 0x0100 | |
31 | #define wxBU_BOTTOM 0x0200 | |
32 | ||
0b4f47a3 DS |
33 | #endif |
34 | ||
35 | #if wxUSE_BUTTON | |
36 | ||
37 | // ---------------------------------------------------------------------------- | |
38 | // wxButton specific flags | |
39 | // ---------------------------------------------------------------------------- | |
40 | ||
41 | // These two flags are obsolete | |
42 | #define wxBU_NOAUTODRAW 0x0000 | |
43 | #define wxBU_AUTODRAW 0x0004 | |
44 | ||
7ef8bfc4 VZ |
45 | // by default, the buttons will be created with some (system dependent) |
46 | // minimal size to make them look nicer, giving this style will make them as | |
47 | // small as possible | |
48 | #define wxBU_EXACTFIT 0x0001 | |
49 | ||
1e6feb95 | 50 | #include "wx/control.h" |
401e3b6e | 51 | #include "wx/stockitem.h" |
1e6feb95 VZ |
52 | |
53 | class WXDLLEXPORT wxBitmap; | |
54 | ||
55 | WXDLLEXPORT_DATA(extern const wxChar*) wxButtonNameStr; | |
56 | ||
57 | // ---------------------------------------------------------------------------- | |
58 | // wxButton: a push button | |
59 | // ---------------------------------------------------------------------------- | |
60 | ||
61 | class WXDLLEXPORT wxButtonBase : public wxControl | |
62 | { | |
63 | public: | |
6463b9f5 | 64 | wxButtonBase() { } |
fc7a2a60 | 65 | |
1e6feb95 | 66 | // show the image in the button in addition to the label |
d699f48b | 67 | virtual void SetImageLabel(const wxBitmap& WXUNUSED(bitmap)) { } |
1e6feb95 VZ |
68 | |
69 | // set the margins around the image | |
d699f48b | 70 | virtual void SetImageMargins(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y)) { } |
1e6feb95 VZ |
71 | |
72 | // this wxButton method is called when the button becomes the default one | |
73 | // on its panel | |
74 | virtual void SetDefault() { } | |
75 | ||
e8e24dfa RD |
76 | // Buttons on MSW can look bad if they are not native colours, because |
77 | // then they become owner-drawn and not theme-drawn. Disable it here | |
78 | // in wxButtonBase to make it consistent. | |
79 | virtual bool ShouldInheritColours() const { return false; } | |
80 | ||
1e6feb95 VZ |
81 | // returns the default button size for this platform |
82 | static wxSize GetDefaultSize(); | |
fc7a2a60 | 83 | |
401e3b6e | 84 | protected: |
853bbd9e | 85 | #if !defined(__WXGTK20__) || defined(__WXUNIVERSAL__) |
401e3b6e VS |
86 | // create stock button (generic implementation) |
87 | bool CreateStock(wxWindow *parent, wxWindowID id, wxStockItemID stock, | |
88 | const wxString& descriptiveLabel = wxEmptyString, | |
89 | const wxPoint& pos = wxDefaultPosition, | |
90 | long style = 0, | |
91 | const wxValidator& validator = wxDefaultValidator, | |
92 | const wxString& name = wxButtonNameStr); | |
93 | #endif | |
94 | ||
fc7a2a60 | 95 | DECLARE_NO_COPY_CLASS(wxButtonBase) |
1e6feb95 VZ |
96 | }; |
97 | ||
98 | #if defined(__WXUNIVERSAL__) | |
99 | #include "wx/univ/button.h" | |
100 | #elif defined(__WXMSW__) | |
101 | #include "wx/msw/button.h" | |
2049ba38 | 102 | #elif defined(__WXMOTIF__) |
1e6feb95 | 103 | #include "wx/motif/button.h" |
2049ba38 | 104 | #elif defined(__WXGTK__) |
1e6feb95 | 105 | #include "wx/gtk/button.h" |
34138703 | 106 | #elif defined(__WXMAC__) |
1e6feb95 | 107 | #include "wx/mac/button.h" |
e64df9bc DE |
108 | #elif defined(__WXCOCOA__) |
109 | #include "wx/cocoa/button.h" | |
1777b9bb | 110 | #elif defined(__WXPM__) |
1e6feb95 | 111 | #include "wx/os2/button.h" |
c801d85f KB |
112 | #endif |
113 | ||
1e6feb95 VZ |
114 | #endif // wxUSE_BUTTON |
115 | ||
c801d85f | 116 | #endif |
34138703 | 117 | // _WX_BUTTON_H_BASE_ |