1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        wx/gtk1/button.h
3 // Purpose:
4 // Author:      Robert Roebling
5 // Copyright:   (c) 1998 Robert Roebling
6 // Licence:     wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
8 
9 #ifndef __GTKBUTTONH__
10 #define __GTKBUTTONH__
11 
12 #include "wx/defs.h"
13 #include "wx/object.h"
14 #include "wx/list.h"
15 
16 //-----------------------------------------------------------------------------
17 // wxButton
18 //-----------------------------------------------------------------------------
19 
20 class WXDLLIMPEXP_CORE wxButton: public wxButtonBase
21 {
22 public:
23     wxButton();
24     wxButton(wxWindow *parent, wxWindowID id,
25            const wxString& label = wxEmptyString,
26            const wxPoint& pos = wxDefaultPosition,
27            const wxSize& size = wxDefaultSize, long style = 0,
28            const wxValidator& validator = wxDefaultValidator,
29            const wxString& name = wxButtonNameStr)
30     {
31         Create(parent, id, label, pos, size, style, validator, name);
32     }
33 
34     virtual ~wxButton();
35 
36     bool Create(wxWindow *parent, wxWindowID id,
37            const wxString& label = wxEmptyString,
38            const wxPoint& pos = wxDefaultPosition,
39            const wxSize& size = wxDefaultSize, long style = 0,
40            const wxValidator& validator = wxDefaultValidator,
41            const wxString& name = wxButtonNameStr);
42 
43     virtual wxWindow *SetDefault();
44     virtual void SetLabel( const wxString &label );
45     virtual bool Enable( bool enable = TRUE );
46 
47     // implementation
48     // --------------
49 
50     void DoApplyWidgetStyle(GtkRcStyle *style);
51     bool IsOwnGtkWindow( GdkWindow *window );
52 
53     // Since this wxButton doesn't derive from wxButtonBase (why?) we need
54     // to override this here too...
ShouldInheritColours()55     virtual bool ShouldInheritColours() const { return false; }
56 
57     static wxVisualAttributes
58     GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
59 
60 protected:
61     virtual wxSize DoGetBestSize() const;
62 
63 private:
64     DECLARE_DYNAMIC_CLASS(wxButton)
65 };
66 
67 #endif // __GTKBUTTONH__
68