]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk/button.h
MVC works now.
[wxWidgets.git] / include / wx / gtk / button.h
CommitLineData
c801d85f 1/////////////////////////////////////////////////////////////////////////////
6b0d8a01 2// Name: wx/gtk/button.h
c801d85f
KB
3// Purpose:
4// Author: Robert Roebling
dbf858b5 5// Id: $Id$
01111366 6// Copyright: (c) 1998 Robert Roebling
65571936 7// Licence: wxWindows licence
c801d85f
KB
8/////////////////////////////////////////////////////////////////////////////
9
c801d85f
KB
10#ifndef __GTKBUTTONH__
11#define __GTKBUTTONH__
12
c801d85f
KB
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
20123d49 22class WXDLLIMPEXP_CORE wxButton;
c801d85f
KB
23
24//-----------------------------------------------------------------------------
25// global data
26//-----------------------------------------------------------------------------
27
63ec432b 28extern WXDLLIMPEXP_CORE const wxChar wxButtonNameStr[];
c801d85f
KB
29
30//-----------------------------------------------------------------------------
31// wxButton
32//-----------------------------------------------------------------------------
33
20123d49 34class WXDLLIMPEXP_CORE wxButton: public wxButtonBase
c801d85f 35{
738f9e5a 36public:
fd0eed64 37 wxButton();
5f7bcb48
VS
38 wxButton(wxWindow *parent, wxWindowID id,
39 const wxString& label = wxEmptyString,
6de97a3b
RR
40 const wxPoint& pos = wxDefaultPosition,
41 const wxSize& size = wxDefaultSize, long style = 0,
42 const wxValidator& validator = wxDefaultValidator,
43 const wxString& name = wxButtonNameStr)
44 {
401e3b6e 45 Create(parent, id, label, pos, size, style, validator, name);
6de97a3b 46 }
401e3b6e 47
6b0d8a01
VZ
48 virtual ~wxButton();
49
5f7bcb48
VS
50 bool Create(wxWindow *parent, wxWindowID id,
51 const wxString& label = wxEmptyString,
6de97a3b
RR
52 const wxPoint& pos = wxDefaultPosition,
53 const wxSize& size = wxDefaultSize, long style = 0,
54 const wxValidator& validator = wxDefaultValidator,
55 const wxString& name = wxButtonNameStr);
6b0d8a01 56
42b4e99e 57 virtual void SetDefault();
6b0d8a01
VZ
58 virtual void SetLabel( const wxString &label );
59 virtual bool Enable( bool enable = TRUE );
8dbf4589 60
20e05ffb
RR
61 // implementation
62 // --------------
6b0d8a01 63
2b5f62a0 64 bool IsOwnGtkWindow( GdkWindow *window );
6b0d8a01 65
e8e24dfa
RD
66 // Since this wxButton doesn't derive from wxButtonBase (why?) we need
67 // to override this here too...
68 virtual bool ShouldInheritColours() const { return false; }
69
9d522606
RD
70 static wxVisualAttributes
71 GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
72
6f02a879
VZ
73 // helper to allow access to protected member from GTK callback
74 void MoveWindow(int x, int y, int width, int height) { DoMoveWindow(x, y, width, height); }
75
db434467
RR
76protected:
77 virtual wxSize DoGetBestSize() const;
6f02a879 78 void DoApplyWidgetStyle(GtkRcStyle *style);
db434467 79
738f9e5a
RR
80private:
81 DECLARE_DYNAMIC_CLASS(wxButton)
c801d85f
KB
82};
83
84#endif // __GTKBUTTONH__