]> git.saurik.com Git - wxWidgets.git/blame - include/wx/univ/tglbtn.h
Fixed wxDatePickerCtrl under OS X
[wxWidgets.git] / include / wx / univ / tglbtn.h
CommitLineData
43be3c33
JS
1///////////////////////////////////////////////////////////////////////////////
2// Name: wx/univ/button.h
3// Purpose: wxToggleButton for wxUniversal
4// Author: Vadim Zeitlin
5// Modified by: David Bjorkevik
6// Created: 16.05.06
7// RCS-ID: $Id$
8// Copyright: (c) 2000 SciTech Software, Inc. (www.scitechsoft.com)
9// Licence: wxWindows licence
10///////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_UNIV_TGLBTN_H_
13#define _WX_UNIV_TGLBTN_H_
14
bd88c1fa 15#include "wx/button.h"
13199c3d 16
53a2db12 17extern WXDLLIMPEXP_DATA_CORE(const char) wxCheckBoxNameStr[];
43be3c33 18
43be3c33
JS
19// ----------------------------------------------------------------------------
20// wxToggleButton: a push button
21// ----------------------------------------------------------------------------
22
bd88c1fa 23class WXDLLIMPEXP_CORE wxToggleButton: public wxButton
43be3c33
JS
24{
25public:
bd88c1fa
PC
26 wxToggleButton();
27
43be3c33
JS
28 wxToggleButton(wxWindow *parent,
29 wxWindowID id,
30 const wxBitmap& bitmap,
31 const wxString& label = wxEmptyString,
32 const wxPoint& pos = wxDefaultPosition,
33 const wxSize& size = wxDefaultSize,
34 long style = 0,
35 const wxValidator& validator = wxDefaultValidator,
bd88c1fa 36 const wxString& name = wxCheckBoxNameStr);
43be3c33 37
43be3c33
JS
38 wxToggleButton(wxWindow *parent,
39 wxWindowID id,
40 const wxString& label = wxEmptyString,
41 const wxPoint& pos = wxDefaultPosition,
42 const wxSize& size = wxDefaultSize,
43 long style = 0,
44 const wxValidator& validator = wxDefaultValidator,
bd88c1fa 45 const wxString& name = wxCheckBoxNameStr);
43be3c33
JS
46
47 virtual ~wxToggleButton();
48
43be3c33
JS
49 virtual bool IsPressed() const { return m_isPressed || m_value; }
50
51 // wxToggleButton actions
bd88c1fa 52 virtual void Toggle();
43be3c33
JS
53 virtual void Click();
54
55 // Get/set the value
56 void SetValue(bool state);
57 bool GetValue() const { return m_value; }
58
13199c3d 59protected:
dc797d8e
JS
60 virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
61
43be3c33
JS
62 // the current value
63 bool m_value;
64
43be3c33 65private:
bd88c1fa
PC
66 // common part of all ctors
67 void Init();
43be3c33 68
bd88c1fa 69 DECLARE_DYNAMIC_CLASS(wxToggleButton)
43be3c33
JS
70};
71
72#endif // _WX_UNIV_TGLBTN_H_