2006-05-23 13:53:50 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2011-03-19 20:14:35 -04:00
|
|
|
// Name: wx/univ/tglbtn.h
|
2006-05-23 13:53:50 -04:00
|
|
|
// Purpose: wxToggleButton for wxUniversal
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Modified by: David Bjorkevik
|
|
|
|
// Created: 16.05.06
|
|
|
|
// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_UNIV_TGLBTN_H_
|
|
|
|
#define _WX_UNIV_TGLBTN_H_
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxToggleButton: a push button
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2014-09-23 13:38:47 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxToggleButton: public wxToggleButtonBase
|
2006-05-23 13:53:50 -04:00
|
|
|
{
|
|
|
|
public:
|
2006-05-24 13:17:27 -04:00
|
|
|
wxToggleButton();
|
|
|
|
|
2006-05-23 13:53:50 -04:00
|
|
|
wxToggleButton(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& label = wxEmptyString,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
2019-10-22 06:34:29 -04:00
|
|
|
const wxString& name = wxASCII_STR(wxCheckBoxNameStr));
|
2006-05-23 13:53:50 -04:00
|
|
|
|
2014-09-23 13:38:47 -04:00
|
|
|
// Create the control
|
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& lbl = wxEmptyString,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
2019-10-22 06:34:29 -04:00
|
|
|
const wxString& name = wxASCII_STR(wxCheckBoxNameStr));
|
2006-05-23 13:53:50 -04:00
|
|
|
|
2014-03-29 20:02:23 -04:00
|
|
|
virtual bool IsPressed() const wxOVERRIDE { return m_isPressed || m_value; }
|
2006-05-23 13:53:50 -04:00
|
|
|
|
|
|
|
// wxToggleButton actions
|
2014-03-29 20:02:23 -04:00
|
|
|
virtual void Toggle() wxOVERRIDE;
|
|
|
|
virtual void Click() wxOVERRIDE;
|
2006-05-23 13:53:50 -04:00
|
|
|
|
|
|
|
// Get/set the value
|
|
|
|
void SetValue(bool state);
|
|
|
|
bool GetValue() const { return m_value; }
|
|
|
|
|
2006-05-24 01:03:00 -04:00
|
|
|
protected:
|
2014-03-29 20:02:23 -04:00
|
|
|
virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; }
|
2007-11-13 07:10:34 -05:00
|
|
|
|
2006-05-23 13:53:50 -04:00
|
|
|
// the current value
|
|
|
|
bool m_value;
|
|
|
|
|
|
|
|
private:
|
2006-05-24 13:17:27 -04:00
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
2006-05-23 13:53:50 -04:00
|
|
|
|
2015-04-23 07:49:01 -04:00
|
|
|
wxDECLARE_DYNAMIC_CLASS(wxToggleButton);
|
2006-05-23 13:53:50 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WX_UNIV_TGLBTN_H_
|