1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxButtonBase class
4 // Author: Vadim Zetlin
8 // Copyright: (c) Vadim Zetlin
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_BUTTON_H_BASE_
13 #define _WX_BUTTON_H_BASE_
17 // ----------------------------------------------------------------------------
18 // wxButton flags shared with other classes
19 // ----------------------------------------------------------------------------
21 #if wxUSE_TOGGLEBTN || wxUSE_BUTTON
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 )
33 // ----------------------------------------------------------------------------
34 // wxButton specific flags
35 // ----------------------------------------------------------------------------
37 // These two flags are obsolete
38 #define wxBU_NOAUTODRAW 0x0000
39 #define wxBU_AUTODRAW 0x0004
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
44 #define wxBU_EXACTFIT 0x0001
46 #include "wx/control.h"
48 class WXDLLIMPEXP_FWD_CORE wxBitmap
;
50 extern WXDLLEXPORT_DATA(const wxChar
) wxButtonNameStr
[];
52 // ----------------------------------------------------------------------------
53 // wxButton: a push button
54 // ----------------------------------------------------------------------------
56 class WXDLLEXPORT wxButtonBase
: public wxControl
61 // show the image in the button in addition to the label
62 virtual void SetImageLabel(const wxBitmap
& WXUNUSED(bitmap
)) { }
64 // set the margins around the image
65 virtual void SetImageMargins(wxCoord
WXUNUSED(x
), wxCoord
WXUNUSED(y
)) { }
67 // make this button the default button in its top level window
69 // returns the old default item (possibly NULL)
70 virtual wxWindow
*SetDefault();
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; }
77 // returns the default button size for this platform
78 static wxSize
GetDefaultSize();
81 DECLARE_NO_COPY_CLASS(wxButtonBase
)
84 #if defined(__WXUNIVERSAL__)
85 #include "wx/univ/button.h"
86 #elif defined(__WXMSW__)
87 #include "wx/msw/button.h"
88 #elif defined(__WXMOTIF__)
89 #include "wx/motif/button.h"
90 #elif defined(__WXGTK20__)
91 #include "wx/gtk/button.h"
92 #elif defined(__WXGTK__)
93 #include "wx/gtk1/button.h"
94 #elif defined(__WXMAC__)
95 #include "wx/mac/button.h"
96 #elif defined(__WXCOCOA__)
97 #include "wx/cocoa/button.h"
98 #elif defined(__WXPM__)
99 #include "wx/os2/button.h"
100 #elif defined(__WXPALMOS__)
101 #include "wx/palmos/button.h"
104 #endif // wxUSE_BUTTON
107 // _WX_BUTTON_H_BASE_