1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2002-06-04 18:09:20 +00:00
|
|
|
// Name: wx/gtk/button.h
|
2009-06-16 05:16:31 +00:00
|
|
|
// Purpose: wxGTK wxButton class declaration
|
1998-05-20 14:01:55 +00:00
|
|
|
// 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 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2006-08-30 05:55:56 +00:00
|
|
|
#ifndef _WX_GTK_BUTTON_H_
|
|
|
|
#define _WX_GTK_BUTTON_H_
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxButton
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2009-06-16 05:16:31 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxButton : public wxButtonBase
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1999-10-11 10:05:36 +00:00
|
|
|
public:
|
2011-06-14 13:00:42 +00:00
|
|
|
wxButton() {}
|
2004-08-30 14:42:51 +00:00
|
|
|
wxButton(wxWindow *parent, wxWindowID id,
|
|
|
|
const wxString& label = wxEmptyString,
|
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)
|
|
|
|
{
|
2004-08-15 15:56:56 +00:00
|
|
|
Create(parent, id, label, pos, size, style, validator, name);
|
1998-08-14 10:07:38 +00:00
|
|
|
}
|
2004-08-15 15:56:56 +00:00
|
|
|
|
2004-08-30 14:42:51 +00:00
|
|
|
bool Create(wxWindow *parent, wxWindowID id,
|
|
|
|
const wxString& label = wxEmptyString,
|
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);
|
2002-06-04 18:09:20 +00:00
|
|
|
|
2007-04-08 22:18:35 +00:00
|
|
|
virtual wxWindow *SetDefault();
|
2002-06-04 18:09:20 +00:00
|
|
|
virtual void SetLabel( const wxString &label );
|
1999-07-04 13:50:13 +00:00
|
|
|
|
1999-11-22 19:44:25 +00:00
|
|
|
// implementation
|
|
|
|
// --------------
|
2002-06-04 18:09:20 +00:00
|
|
|
|
2004-05-06 17:26:25 +00:00
|
|
|
static wxVisualAttributes
|
|
|
|
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
|
|
|
|
2006-02-08 21:47:09 +00:00
|
|
|
// helper to allow access to protected member from GTK callback
|
|
|
|
void MoveWindow(int x, int y, int width, int height) { DoMoveWindow(x, y, width, height); }
|
|
|
|
|
2009-06-16 19:08:59 +00:00
|
|
|
// called from GTK callbacks: they update the button state and call
|
|
|
|
// GTKUpdateBitmap()
|
|
|
|
void GTKMouseEnters();
|
|
|
|
void GTKMouseLeaves();
|
|
|
|
void GTKPressed();
|
|
|
|
void GTKReleased();
|
|
|
|
|
2000-01-04 13:02:27 +00:00
|
|
|
protected:
|
|
|
|
virtual wxSize DoGetBestSize() const;
|
2006-08-25 12:59:28 +00:00
|
|
|
virtual void DoApplyWidgetStyle(GtkRcStyle *style);
|
|
|
|
|
2011-02-27 12:48:30 +00:00
|
|
|
#if wxUSE_MARKUP
|
|
|
|
virtual bool DoSetLabelMarkup(const wxString& markup);
|
|
|
|
#endif // wxUSE_MARKUP
|
|
|
|
|
1999-10-11 10:05:36 +00:00
|
|
|
private:
|
2009-12-05 19:25:04 +00:00
|
|
|
typedef wxButtonBase base_type;
|
|
|
|
|
2011-02-27 12:48:30 +00:00
|
|
|
// Return the GtkLabel used by this button.
|
|
|
|
GtkLabel *GTKGetLabel() const;
|
|
|
|
|
1999-10-11 10:05:36 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxButton)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
2006-08-30 05:55:56 +00:00
|
|
|
#endif // _WX_GTK_BUTTON_H_
|