2006-05-23 13:53:50 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/univ/button.h
|
|
|
|
// Purpose: wxToggleButton for wxUniversal
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Modified by: David Bjorkevik
|
|
|
|
// Created: 16.05.06
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_UNIV_TGLBTN_H_
|
|
|
|
#define _WX_UNIV_TGLBTN_H_
|
|
|
|
|
2006-05-24 13:17:27 -04:00
|
|
|
#include "wx/button.h"
|
2006-05-24 01:03:00 -04:00
|
|
|
|
|
|
|
extern WXDLLEXPORT_DATA(const wxChar) wxCheckBoxNameStr[];
|
2006-05-23 13:53:50 -04:00
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxToggleButton: a push button
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2006-05-24 13:17:27 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxToggleButton: public wxButton
|
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 wxBitmap& bitmap,
|
|
|
|
const wxString& label = wxEmptyString,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = 0,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
2006-05-24 13:17:27 -04:00
|
|
|
const wxString& name = wxCheckBoxNameStr);
|
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,
|
2006-05-24 13:17:27 -04:00
|
|
|
const wxString& name = wxCheckBoxNameStr);
|
2006-05-23 13:53:50 -04:00
|
|
|
|
|
|
|
virtual ~wxToggleButton();
|
|
|
|
|
|
|
|
virtual bool IsPressed() const { return m_isPressed || m_value; }
|
|
|
|
|
|
|
|
// wxToggleButton actions
|
2006-05-24 13:17:27 -04:00
|
|
|
virtual void Toggle();
|
2006-05-23 13:53:50 -04:00
|
|
|
virtual void Click();
|
|
|
|
|
|
|
|
// Get/set the value
|
|
|
|
void SetValue(bool state);
|
|
|
|
bool GetValue() const { return m_value; }
|
|
|
|
|
2006-05-24 01:03:00 -04:00
|
|
|
protected:
|
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
|
|
|
|
2006-05-24 13:17:27 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxToggleButton)
|
2006-05-23 13:53:50 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WX_UNIV_TGLBTN_H_
|