libyui-ncurses
Loading...
Searching...
No Matches
NCMultiLineEdit.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: NCMultiLineEdit.h
20
21 Author: Michael Andres <ma@suse.de>
22
23/-*/
24
25#ifndef NCMultiLineEdit_h
26#define NCMultiLineEdit_h
27
28#include <iosfwd>
29
30#include <yui/YMultiLineEdit.h>
31#include "NCPadWidget.h"
32#include "NCTextPad.h"
33
34
35class NCMultiLineEdit : public YMultiLineEdit, public NCPadWidget
36{
37private:
38 friend std::ostream & operator<<( std::ostream & str, const NCMultiLineEdit & obj );
39
40 NCMultiLineEdit & operator=( const NCMultiLineEdit & );
42
43 NCstring ctext;
44
45protected:
46
50 virtual NCTextPad * myPad() const
51 { return dynamic_cast<NCTextPad*>( NCPadWidget::myPad() ); }
52
53protected:
54
55 virtual const char * location() const { return "NCMultiLineEdit"; }
56
57 virtual void wRedraw();
58
59 virtual NCPad * CreatePad();
60 virtual void DrawPad();
61
62public:
63
64 NCMultiLineEdit( YWidget * parent, const std::string & label );
65
66 virtual ~NCMultiLineEdit();
67
68 virtual int preferredWidth();
69 virtual int preferredHeight();
70
71 virtual void setSize( int newWidth, int newHeight );
72
73 virtual void setLabel( const std::string & nlabel );
74 virtual void setValue( const std::string & ntext );
75
76 virtual std::string value();
77
78 virtual NCursesEvent wHandleInput( wint_t key );
79
80 virtual void setEnabled( bool do_bv );
81
82 virtual bool setKeyboardFocus()
83 {
84 if ( !grabFocus() )
85 return YWidget::setKeyboardFocus();
86
87 return true;
88 }
89
90 // sets the maximum number of characters of the NCTextPad
91 void setInputMaxLength( int numberOfChars );
92
93};
94
95
96#endif // NCMultiLineEdit_h
Definition NCMultiLineEdit.h:36
virtual void setEnabled(bool do_bv)
Definition NCMultiLineEdit.cc:60
virtual NCTextPad * myPad() const
Definition NCMultiLineEdit.h:50
Definition NCPadWidget.h:40
virtual NCPad * myPad() const
Definition NCPadWidget.h:64
Definition NCPad.h:113
Definition NCTextPad.h:36
Definition NCstring.h:36
Definition NCurses.h:73