libyui-ncurses
Loading...
Searching...
No Matches
NCCheckBoxFrame.h
1/*
2 Copyright (C) 2000-2012 Novell, Inc
3 This library is free software; you can redistribute it and/or modify
4 it under the terms of the GNU Lesser General Public License as
5 published by the Free Software Foundation; either version 2.1 of the
6 License, or (at your option) version 3.0 of the License. This library
7 is distributed in the hope that it will be useful, but WITHOUT ANY
8 WARRANTY; without even the implied warranty of MERCHANTABILITY or
9 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10 License for more details. You should have received a copy of the GNU
11 Lesser General Public License along with this library; if not, write
12 to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13 Floor, Boston, MA 02110-1301 USA
14*/
15
16
17/*-/
18
19 File: NCCheckBoxFrame.h
20
21 Author: Michael Andres <ma@suse.de>
22
23/-*/
24
25#ifndef NCCheckBoxFrame_h
26#define NCCheckBoxFrame_h
27
28#include <iosfwd>
29
30#include <yui/YCheckBoxFrame.h>
31#include "NCWidget.h"
32#include "NCCheckBox.h"
33
34class NCCheckBoxFrame;
35
36
37class NCCheckBoxFrame : public YCheckBoxFrame, public NCWidget
38{
39private:
40
41 friend std::ostream & operator<<( std::ostream & str, const NCCheckBoxFrame & obj );
42
43 NCCheckBoxFrame & operator=( const NCCheckBoxFrame & );
45
46
47 NClabel label;
48 bool isEnabled;
49
50protected:
51
52 bool gotBuddy();
53
54 virtual const char * location() const { return "NCCheckBoxFrame"; }
55
56 virtual void wRedraw();
57
58public:
59
60 NCCheckBoxFrame( YWidget * parent, const std::string & label,
61 bool checked );
62 virtual ~NCCheckBoxFrame();
63
64 virtual int preferredWidth();
65 virtual int preferredHeight();
66
67 virtual void setSize( int newWidth, int newHeight );
68
69 virtual void setLabel( const std::string & nlabel );
70
71 virtual void setEnabled( bool do_bv );
72
73 virtual bool getValue() { return isEnabled; }
74
75 // Do not forget to call Redraw(), so that UI::ChangeWidget works
76 // correctly - bug #301370
77 virtual void setValue( bool enable ) { isEnabled = enable; Redraw();}
78
79 virtual bool setKeyboardFocus();
80
81 virtual bool value();
82
83 virtual NCursesEvent wHandleInput( wint_t key );
84
85 bool getParentValue( NCWidget * widget, bool initial );
86};
87
88
89#endif // NCCheckBoxFrame_h
Definition NCCheckBoxFrame.h:38
virtual void setEnabled(bool do_bv)
Definition NCCheckBoxFrame.cc:127
Definition NCWidget.h:46
Multi-line string, with optional hotkey, drawable.
Definition NCtext.h:82
Definition NCurses.h:73