1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2002-06-04 14:09:20 -04:00
|
|
|
// Name: wx/gtk/button.h
|
1998-05-20 10:01:55 -04:00
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-26 05:56:58 -05:00
|
|
|
// Id: $Id$
|
1998-10-24 13:12:05 -04:00
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __GTKBUTTONH__
|
|
|
|
#define __GTKBUTTONH__
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/list.h"
|
|
|
|
#include "wx/control.h"
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2005-08-02 18:58:06 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxButton;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// global data
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2005-08-02 18:58:06 -04:00
|
|
|
extern WXDLLIMPEXP_CORE const wxChar *wxButtonNameStr;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxButton
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2005-08-02 18:58:06 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxButton: public wxButtonBase
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
1999-10-11 06:05:36 -04:00
|
|
|
public:
|
1998-11-06 03:50:52 -05:00
|
|
|
wxButton();
|
2004-08-30 10:42:51 -04:00
|
|
|
wxButton(wxWindow *parent, wxWindowID id,
|
|
|
|
const wxString& label = wxEmptyString,
|
1998-08-14 06:07:38 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize, long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxButtonNameStr)
|
|
|
|
{
|
2004-08-15 11:56:56 -04:00
|
|
|
Create(parent, id, label, pos, size, style, validator, name);
|
1998-08-14 06:07:38 -04:00
|
|
|
}
|
2004-08-15 11:56:56 -04:00
|
|
|
|
2002-06-04 14:09:20 -04:00
|
|
|
virtual ~wxButton();
|
|
|
|
|
2004-08-30 10:42:51 -04:00
|
|
|
bool Create(wxWindow *parent, wxWindowID id,
|
|
|
|
const wxString& label = wxEmptyString,
|
1998-08-14 06:07:38 -04:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize, long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxButtonNameStr);
|
2002-06-04 14:09:20 -04:00
|
|
|
|
1999-08-16 16:17:48 -04:00
|
|
|
virtual void SetDefault();
|
2002-06-04 14:09:20 -04:00
|
|
|
virtual void SetLabel( const wxString &label );
|
|
|
|
virtual bool Enable( bool enable = TRUE );
|
1999-07-04 09:50:13 -04:00
|
|
|
|
1999-11-22 14:44:25 -05:00
|
|
|
// implementation
|
|
|
|
// --------------
|
2002-06-04 14:09:20 -04:00
|
|
|
|
2004-06-14 13:34:00 -04:00
|
|
|
void DoApplyWidgetStyle(GtkRcStyle *style);
|
2002-12-04 09:11:26 -05:00
|
|
|
bool IsOwnGtkWindow( GdkWindow *window );
|
2002-06-04 14:09:20 -04:00
|
|
|
|
2003-12-02 22:24:47 -05:00
|
|
|
// Since this wxButton doesn't derive from wxButtonBase (why?) we need
|
|
|
|
// to override this here too...
|
|
|
|
virtual bool ShouldInheritColours() const { return false; }
|
|
|
|
|
2004-05-06 13:26:25 -04:00
|
|
|
static wxVisualAttributes
|
|
|
|
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
|
|
|
|
2000-01-04 08:02:27 -05:00
|
|
|
protected:
|
|
|
|
virtual wxSize DoGetBestSize() const;
|
|
|
|
|
1999-10-11 06:05:36 -04:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxButton)
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __GTKBUTTONH__
|