2 * Copyright (C) 2010-2013 by CenterIM developers
4 * This file is part of CenterIM.
6 * CenterIM is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * CenterIM is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
28 #ifndef __CHECKBOX_H__
29 #define __CHECKBOX_H__
43 CheckBox(int w
, int h
, const char *text_
= NULL
, bool checked_
= false);
44 explicit CheckBox(const char *text_
= NULL
, bool checked_
= false);
48 virtual void draw(Curses::ViewPort area
);
51 * Sets a new label text and redraws the widget.
53 virtual void setText(const char *new_text
);
55 * Returns a current label text.
57 virtual const char *getText() const { return text
; }
59 virtual void setChecked(bool new_checked
);
60 virtual bool isChecked() const { return checked
; }
63 * Emited signal when a checkbox is pressed/activated.
65 sigc::signal
<void, CheckBox
&, bool> signal_toggle
;
74 CONSUI_DISABLE_COPY(CheckBox
);
78 void declareBindables();
81 } // namespace CppConsUI
83 #endif // __CHECKBOX_H__
85 /* vim: set tabstop=2 shiftwidth=2 textwidth=78 expandtab : */