]>
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 | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
34138703 JS |
12 | #ifndef _WX_BUTTON_H_BASE_ |
13 | #define _WX_BUTTON_H_BASE_ | |
c801d85f | 14 | |
997176a3 VZ |
15 | #include "wx/defs.h" |
16 | ||
1e6feb95 VZ |
17 | #if wxUSE_BUTTON |
18 | ||
7ef8bfc4 VZ |
19 | // ---------------------------------------------------------------------------- |
20 | // wxButton flags | |
21 | // ---------------------------------------------------------------------------- | |
22 | ||
7ccb2521 | 23 | // These two flags are obsolete |
7ef8bfc4 VZ |
24 | #define wxBU_NOAUTODRAW 0x0000 |
25 | #define wxBU_AUTODRAW 0x0004 | |
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 | ||
33 | // by default, the buttons will be created with some (system dependent) | |
34 | // minimal size to make them look nicer, giving this style will make them as | |
35 | // small as possible | |
36 | #define wxBU_EXACTFIT 0x0001 | |
37 | ||
1e6feb95 VZ |
38 | #include "wx/control.h" |
39 | ||
40 | class WXDLLEXPORT wxBitmap; | |
41 | ||
42 | WXDLLEXPORT_DATA(extern const wxChar*) wxButtonNameStr; | |
43 | ||
44 | // ---------------------------------------------------------------------------- | |
45 | // wxButton: a push button | |
46 | // ---------------------------------------------------------------------------- | |
47 | ||
48 | class WXDLLEXPORT wxButtonBase : public wxControl | |
49 | { | |
50 | public: | |
fc7a2a60 VZ |
51 | wxButtonBase() { } |
52 | ||
1e6feb95 | 53 | // show the image in the button in addition to the label |
d699f48b | 54 | virtual void SetImageLabel(const wxBitmap& WXUNUSED(bitmap)) { } |
1e6feb95 VZ |
55 | |
56 | // set the margins around the image | |
d699f48b | 57 | virtual void SetImageMargins(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y)) { } |
1e6feb95 VZ |
58 | |
59 | // this wxButton method is called when the button becomes the default one | |
60 | // on its panel | |
61 | virtual void SetDefault() { } | |
62 | ||
e8e24dfa RD |
63 | // Buttons on MSW can look bad if they are not native colours, because |
64 | // then they become owner-drawn and not theme-drawn. Disable it here | |
65 | // in wxButtonBase to make it consistent. | |
66 | virtual bool ShouldInheritColours() const { return false; } | |
67 | ||
1e6feb95 VZ |
68 | // returns the default button size for this platform |
69 | static wxSize GetDefaultSize(); | |
fc7a2a60 VZ |
70 | |
71 | DECLARE_NO_COPY_CLASS(wxButtonBase) | |
1e6feb95 VZ |
72 | }; |
73 | ||
74 | #if defined(__WXUNIVERSAL__) | |
75 | #include "wx/univ/button.h" | |
76 | #elif defined(__WXMSW__) | |
77 | #include "wx/msw/button.h" | |
2049ba38 | 78 | #elif defined(__WXMOTIF__) |
1e6feb95 | 79 | #include "wx/motif/button.h" |
2049ba38 | 80 | #elif defined(__WXGTK__) |
1e6feb95 | 81 | #include "wx/gtk/button.h" |
34138703 | 82 | #elif defined(__WXMAC__) |
1e6feb95 | 83 | #include "wx/mac/button.h" |
e64df9bc DE |
84 | #elif defined(__WXCOCOA__) |
85 | #include "wx/cocoa/button.h" | |
1777b9bb | 86 | #elif defined(__WXPM__) |
1e6feb95 | 87 | #include "wx/os2/button.h" |
c801d85f KB |
88 | #endif |
89 | ||
1e6feb95 VZ |
90 | #endif // wxUSE_BUTTON |
91 | ||
c801d85f | 92 | #endif |
34138703 | 93 | // _WX_BUTTON_H_BASE_ |