1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/button.h
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef __GTKBUTTONH__
11 #define __GTKBUTTONH__
14 #include "wx/object.h"
16 #include "wx/control.h"
18 //-----------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------
22 class WXDLLIMPEXP_CORE wxButton
;
24 //-----------------------------------------------------------------------------
26 //-----------------------------------------------------------------------------
28 extern WXDLLIMPEXP_CORE
const wxChar wxButtonNameStr
[];
30 //-----------------------------------------------------------------------------
32 //-----------------------------------------------------------------------------
34 class WXDLLIMPEXP_CORE wxButton
: public wxButtonBase
38 wxButton(wxWindow
*parent
, wxWindowID id
,
39 const wxString
& label
= wxEmptyString
,
40 const wxPoint
& pos
= wxDefaultPosition
,
41 const wxSize
& size
= wxDefaultSize
, long style
= 0,
42 const wxValidator
& validator
= wxDefaultValidator
,
43 const wxString
& name
= wxButtonNameStr
)
45 Create(parent
, id
, label
, pos
, size
, style
, validator
, name
);
50 bool Create(wxWindow
*parent
, wxWindowID id
,
51 const wxString
& label
= wxEmptyString
,
52 const wxPoint
& pos
= wxDefaultPosition
,
53 const wxSize
& size
= wxDefaultSize
, long style
= 0,
54 const wxValidator
& validator
= wxDefaultValidator
,
55 const wxString
& name
= wxButtonNameStr
);
57 virtual void SetDefault();
58 virtual void SetLabel( const wxString
&label
);
59 virtual bool Enable( bool enable
= TRUE
);
64 // Since this wxButton doesn't derive from wxButtonBase (why?) we need
65 // to override this here too...
66 virtual bool ShouldInheritColours() const { return false; }
68 static wxVisualAttributes
69 GetClassDefaultAttributes(wxWindowVariant variant
= wxWINDOW_VARIANT_NORMAL
);
71 // helper to allow access to protected member from GTK callback
72 void MoveWindow(int x
, int y
, int width
, int height
) { DoMoveWindow(x
, y
, width
, height
); }
75 virtual wxSize
DoGetBestSize() const;
76 virtual void DoApplyWidgetStyle(GtkRcStyle
*style
);
78 virtual GdkWindow
*GTKGetWindow(wxArrayGdkWindows
& windows
) const;
81 DECLARE_DYNAMIC_CLASS(wxButton
)
84 #endif // __GTKBUTTONH__