1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/gtk/button.h
3 // Purpose: wxGTK wxButton class declaration
4 // Author: Robert Roebling
5 // Copyright: (c) 1998 Robert Roebling
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
9 #ifndef _WX_GTK_BUTTON_H_
10 #define _WX_GTK_BUTTON_H_
12 //-----------------------------------------------------------------------------
14 //-----------------------------------------------------------------------------
16 class WXDLLIMPEXP_CORE wxButton
: public wxButtonBase
20 wxButton(wxWindow
*parent
, wxWindowID id
,
21 const wxString
& label
= wxEmptyString
,
22 const wxPoint
& pos
= wxDefaultPosition
,
23 const wxSize
& size
= wxDefaultSize
, long style
= 0,
24 const wxValidator
& validator
= wxDefaultValidator
,
25 const wxString
& name
= wxButtonNameStr
)
27 Create(parent
, id
, label
, pos
, size
, style
, validator
, name
);
30 bool Create(wxWindow
*parent
, wxWindowID id
,
31 const wxString
& label
= wxEmptyString
,
32 const wxPoint
& pos
= wxDefaultPosition
,
33 const wxSize
& size
= wxDefaultSize
, long style
= 0,
34 const wxValidator
& validator
= wxDefaultValidator
,
35 const wxString
& name
= wxButtonNameStr
);
37 virtual wxWindow
*SetDefault();
38 virtual void SetLabel( const wxString
&label
);
43 static wxVisualAttributes
44 GetClassDefaultAttributes(wxWindowVariant variant
= wxWINDOW_VARIANT_NORMAL
);
46 // helper to allow access to protected member from GTK callback
47 void MoveWindow(int x
, int y
, int width
, int height
) { DoMoveWindow(x
, y
, width
, height
); }
49 // called from GTK callbacks: they update the button state and call
51 void GTKMouseEnters();
52 void GTKMouseLeaves();
57 virtual wxSize
DoGetBestSize() const;
58 virtual void DoApplyWidgetStyle(GtkRcStyle
*style
);
61 virtual bool DoSetLabelMarkup(const wxString
& markup
);
62 #endif // wxUSE_MARKUP
65 typedef wxButtonBase base_type
;
67 // Return the GtkLabel used by this button.
68 GtkLabel
*GTKGetLabel() const;
70 DECLARE_DYNAMIC_CLASS(wxButton
)
73 #endif // _WX_GTK_BUTTON_H_