40 friend std::ostream & operator<<( std::ostream & str,
const NCtext & obj );
44 typedef std::list<NCstring>::iterator iterator;
45 typedef std::list<NCstring>::const_iterator const_iterator;
53 std::list<NCstring> mtext;
55 virtual void lset(
const NCstring & ntext );
56 void lbrset(
const NCstring & ntext,
size_t columns );
60 NCtext(
const NCstring & nstr =
"" );
61 NCtext(
const NCstring & nstr,
size_t columns );
65 unsigned Lines()
const;
66 size_t Columns()
const;
68 void append(
const NCstring & line );
70 const std::list<NCstring> & Text()
const {
return mtext; }
72 const NCstring & operator[]( std::wstring::size_type idx )
const;
74 const_iterator begin()
const {
return mtext.begin(); }
76 const_iterator end()
const {
return mtext.end(); }
81class NClabel :
protected NCtext
84 friend std::ostream & operator<<( std::ostream & str,
const NClabel & obj );
88 std::wstring::size_type hotline;
90 virtual void lset(
const NCstring & ntext )
92 NCtext::lset( ntext );
99 NClabel(
const NCstring & nstr =
"" )
103 virtual ~NClabel() {}
105 size_t width()
const {
return Columns(); }
107 unsigned height()
const {
return Lines(); }
109 wsze size()
const {
return wsze( Lines(), Columns() ); }
111 const std::list<NCstring> & getText()
const {
return Text(); }
113 void drawAt(
NCursesWindow & w, chtype style, chtype hotstyle,
116 bool fillup =
true )
const;
118 void drawAt(
NCursesWindow & w, chtype style, chtype hotstyle,
120 bool fillup =
true )
const
122 drawAt( w, style, hotstyle,
wrect( 0, -1 ), adjust, fillup );
125 void drawAt(
NCursesWindow & w, chtype style, chtype hotstyle,
128 bool fillup =
true )
const
130 drawAt( w, style, hotstyle,
wrect( pos, -1 ), adjust, fillup );
133 void drawAt(
NCursesWindow & w, chtype style, chtype hotstyle,
136 bool fillup =
true )
const
138 drawAt( w, style, hotstyle,
wrect( pos, sze ), adjust, fillup );
144 bool fillup =
true )
const
146 drawAt( w, istyle.label, istyle.hint,
wrect( 0, -1 ), adjust, fillup );
152 bool fillup =
true )
const
154 drawAt( w, istyle.label, istyle.hint,
wrect( pos, -1 ), adjust, fillup );
160 bool fillup =
true )
const
162 drawAt( w, istyle.label, istyle.hint,
wrect( pos, sze ), adjust, fillup );
168 bool fillup =
true )
const
170 drawAt( w, istyle.label, istyle.hint, dim, adjust, fillup );
176 bool hasHotkey()
const {
return hotline != std::wstring::npos; }
178 wchar_t hotkey()
const {
return hasHotkey() ? operator[]( hotline ).hotkey() : L
'\0'; }
180 std::wstring::size_type hotpos()
const {
return hasHotkey() ? operator[]( hotline ).hotpos() : std::wstring::npos; }
Screen position pair in the order line, column: (L, C)
Definition position.h:110
Screen dimension (screen size) in the order height, width: (H, W)
Definition position.h:154