]>
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 | |
997176a3 VZ |
15 | #include "wx/defs.h" |
16 | ||
7ef8bfc4 | 17 | // ---------------------------------------------------------------------------- |
0b4f47a3 | 18 | // wxButton flags shared with other classes |
7ef8bfc4 VZ |
19 | // ---------------------------------------------------------------------------- |
20 | ||
0b4f47a3 | 21 | #if wxUSE_TOGGLEBTN || wxUSE_BUTTON |
7ccb2521 VZ |
22 | |
23 | // These flags affect label alignment | |
7ef8bfc4 VZ |
24 | #define wxBU_LEFT 0x0040 |
25 | #define wxBU_TOP 0x0080 | |
26 | #define wxBU_RIGHT 0x0100 | |
27 | #define wxBU_BOTTOM 0x0200 | |
041ae202 | 28 | #define wxBU_ALIGN_MASK ( wxBU_LEFT | wxBU_TOP | wxBU_RIGHT | wxBU_BOTTOM ) |
0b4f47a3 DS |
29 | #endif |
30 | ||
31 | #if wxUSE_BUTTON | |
32 | ||
33 | // ---------------------------------------------------------------------------- | |
34 | // wxButton specific flags | |
35 | // ---------------------------------------------------------------------------- | |
36 | ||
37 | // These two flags are obsolete | |
38 | #define wxBU_NOAUTODRAW 0x0000 | |
39 | #define wxBU_AUTODRAW 0x0004 | |
40 | ||
7ef8bfc4 VZ |
41 | // by default, the buttons will be created with some (system dependent) |
42 | // minimal size to make them look nicer, giving this style will make them as | |
43 | // small as possible | |
44 | #define wxBU_EXACTFIT 0x0001 | |
45 | ||
1e6feb95 VZ |
46 | #include "wx/control.h" |
47 | ||
b5dbe15d | 48 | class WXDLLIMPEXP_FWD_CORE wxBitmap; |
1e6feb95 | 49 | |
53a2db12 | 50 | extern WXDLLIMPEXP_DATA_CORE(const char) wxButtonNameStr[]; |
1e6feb95 VZ |
51 | |
52 | // ---------------------------------------------------------------------------- | |
53 | // wxButton: a push button | |
54 | // ---------------------------------------------------------------------------- | |
55 | ||
53a2db12 | 56 | class WXDLLIMPEXP_CORE wxButtonBase : public wxControl |
1e6feb95 VZ |
57 | { |
58 | public: | |
6463b9f5 | 59 | wxButtonBase() { } |
fc7a2a60 | 60 | |
1e6feb95 | 61 | // show the image in the button in addition to the label |
d699f48b | 62 | virtual void SetImageLabel(const wxBitmap& WXUNUSED(bitmap)) { } |
1e6feb95 VZ |
63 | |
64 | // set the margins around the image | |
d699f48b | 65 | virtual void SetImageMargins(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y)) { } |
1e6feb95 | 66 | |
94aff5ff VZ |
67 | // make this button the default button in its top level window |
68 | // | |
69 | // returns the old default item (possibly NULL) | |
70 | virtual wxWindow *SetDefault(); | |
1e6feb95 | 71 | |
e8e24dfa RD |
72 | // Buttons on MSW can look bad if they are not native colours, because |
73 | // then they become owner-drawn and not theme-drawn. Disable it here | |
74 | // in wxButtonBase to make it consistent. | |
75 | virtual bool ShouldInheritColours() const { return false; } | |
76 | ||
1e6feb95 VZ |
77 | // returns the default button size for this platform |
78 | static wxSize GetDefaultSize(); | |
fc7a2a60 | 79 | |
401e3b6e | 80 | protected: |
dc797d8e JS |
81 | // choose the default border for this window |
82 | virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; } | |
83 | ||
c0c133e1 | 84 | wxDECLARE_NO_COPY_CLASS(wxButtonBase); |
1e6feb95 VZ |
85 | }; |
86 | ||
87 | #if defined(__WXUNIVERSAL__) | |
88 | #include "wx/univ/button.h" | |
89 | #elif defined(__WXMSW__) | |
90 | #include "wx/msw/button.h" | |
2049ba38 | 91 | #elif defined(__WXMOTIF__) |
1e6feb95 | 92 | #include "wx/motif/button.h" |
1be7a35c | 93 | #elif defined(__WXGTK20__) |
1e6feb95 | 94 | #include "wx/gtk/button.h" |
1be7a35c MR |
95 | #elif defined(__WXGTK__) |
96 | #include "wx/gtk1/button.h" | |
34138703 | 97 | #elif defined(__WXMAC__) |
ef0e9220 | 98 | #include "wx/osx/button.h" |
e64df9bc DE |
99 | #elif defined(__WXCOCOA__) |
100 | #include "wx/cocoa/button.h" | |
1777b9bb | 101 | #elif defined(__WXPM__) |
1e6feb95 | 102 | #include "wx/os2/button.h" |
db101bd3 WS |
103 | #elif defined(__WXPALMOS__) |
104 | #include "wx/palmos/button.h" | |
c801d85f KB |
105 | #endif |
106 | ||
1e6feb95 VZ |
107 | #endif // wxUSE_BUTTON |
108 | ||
c801d85f | 109 | #endif |
34138703 | 110 | // _WX_BUTTON_H_BASE_ |