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