1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2002-06-04 18:09:20 +00:00
|
|
|
// Name: wx/gtk/button.h
|
1998-05-20 14:01:55 +00:00
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-26 10:56:58 +00:00
|
|
|
// Id: $Id$
|
1998-10-24 17:12:05 +00:00
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
2004-05-23 14:56:36 +00:00
|
|
|
// Licence: wxWidgets licence
|
1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef __GTKBUTTONH__
|
|
|
|
#define __GTKBUTTONH__
|
|
|
|
|
2003-08-09 12:38:21 +00:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
1998-05-20 14:01:55 +00:00
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/list.h"
|
|
|
|
#include "wx/control.h"
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxButton;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// global data
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1999-07-15 18:08:57 +00:00
|
|
|
extern const wxChar *wxButtonNameStr;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxButton
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxButton: public wxControl
|
|
|
|
{
|
1999-10-11 10:05:36 +00:00
|
|
|
public:
|
1998-11-06 08:50:52 +00:00
|
|
|
wxButton();
|
2002-06-04 18:09:20 +00:00
|
|
|
wxButton(wxWindow *parent, wxWindowID id, const wxString& label,
|
1998-08-14 10:07:38 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize, long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxButtonNameStr)
|
|
|
|
{
|
|
|
|
Create(parent, id, label, pos, size, style, validator, name);
|
|
|
|
}
|
2002-06-04 18:09:20 +00:00
|
|
|
virtual ~wxButton();
|
|
|
|
|
1998-08-14 10:07:38 +00:00
|
|
|
bool Create(wxWindow *parent, wxWindowID id, const wxString& label,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize, long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
|
|
|
const wxString& name = wxButtonNameStr);
|
2002-06-04 18:09:20 +00:00
|
|
|
|
1999-08-16 20:17:48 +00:00
|
|
|
virtual void SetDefault();
|
2002-06-04 18:09:20 +00:00
|
|
|
virtual void SetLabel( const wxString &label );
|
|
|
|
virtual bool Enable( bool enable = TRUE );
|
1999-07-04 13:50:13 +00:00
|
|
|
|
|
|
|
static wxSize GetDefaultSize();
|
2002-06-04 18:09:20 +00:00
|
|
|
|
1999-11-22 19:44:25 +00:00
|
|
|
// implementation
|
|
|
|
// --------------
|
2002-06-04 18:09:20 +00:00
|
|
|
|
|
|
|
void ApplyWidgetStyle();
|
2002-12-04 14:11:26 +00:00
|
|
|
bool IsOwnGtkWindow( GdkWindow *window );
|
2002-06-04 18:09:20 +00:00
|
|
|
|
2003-12-03 03:24:47 +00: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 17:26:25 +00:00
|
|
|
static wxVisualAttributes
|
|
|
|
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
|
|
|
|
2000-01-04 13:02:27 +00:00
|
|
|
protected:
|
|
|
|
virtual wxSize DoGetBestSize() const;
|
|
|
|
|
1999-10-11 10:05:36 +00:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxButton)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __GTKBUTTONH__
|