]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/gtk/button.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
5 | // Id: $Id$ | |
6 | // Copyright: (c) 1998 Robert Roebling | |
7 | // Licence: wxWindows licence | |
8 | ///////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | #ifndef __GTKBUTTONH__ | |
11 | #define __GTKBUTTONH__ | |
12 | ||
13 | #include "wx/defs.h" | |
14 | #include "wx/object.h" | |
15 | #include "wx/list.h" | |
16 | #include "wx/control.h" | |
17 | ||
18 | //----------------------------------------------------------------------------- | |
19 | // classes | |
20 | //----------------------------------------------------------------------------- | |
21 | ||
22 | class WXDLLIMPEXP_CORE wxButton; | |
23 | ||
24 | //----------------------------------------------------------------------------- | |
25 | // global data | |
26 | //----------------------------------------------------------------------------- | |
27 | ||
28 | extern WXDLLIMPEXP_CORE const wxChar *wxButtonNameStr; | |
29 | ||
30 | //----------------------------------------------------------------------------- | |
31 | // wxButton | |
32 | //----------------------------------------------------------------------------- | |
33 | ||
34 | class WXDLLIMPEXP_CORE wxButton: public wxButtonBase | |
35 | { | |
36 | public: | |
37 | wxButton(); | |
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) | |
44 | { | |
45 | Create(parent, id, label, pos, size, style, validator, name); | |
46 | } | |
47 | ||
48 | virtual ~wxButton(); | |
49 | ||
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); | |
56 | ||
57 | virtual void SetDefault(); | |
58 | virtual void SetLabel( const wxString &label ); | |
59 | virtual bool Enable( bool enable = TRUE ); | |
60 | ||
61 | // implementation | |
62 | // -------------- | |
63 | ||
64 | void DoApplyWidgetStyle(GtkRcStyle *style); | |
65 | bool IsOwnGtkWindow( GdkWindow *window ); | |
66 | ||
67 | // Since this wxButton doesn't derive from wxButtonBase (why?) we need | |
68 | // to override this here too... | |
69 | virtual bool ShouldInheritColours() const { return false; } | |
70 | ||
71 | static wxVisualAttributes | |
72 | GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); | |
73 | ||
74 | protected: | |
75 | virtual wxSize DoGetBestSize() const; | |
76 | ||
77 | private: | |
78 | DECLARE_DYNAMIC_CLASS(wxButton) | |
79 | }; | |
80 | ||
81 | #endif // __GTKBUTTONH__ |