25 #define YUILogComponent "ncurses"
26 #include <yui/YUILog.h>
30 #define AUTO_WRAP_WIDTH 10
31 #define AUTO_WRAP_HEIGHT 1
36 NCLabel::NCLabel( YWidget * parent,
37 const string & nlabel,
40 : YLabel( parent, nlabel, isHeading, isOutputField )
42 , heading( isHeading )
44 yuiDebug() << std::endl;
53 yuiDebug() << std::endl;
57 int NCLabel::preferredWidth()
63 if ( layoutPass() == 2 )
88 width = AUTO_WRAP_WIDTH;
93 width = wGetDefsze().W;
100 int NCLabel::preferredHeight()
106 if ( layoutPass() == 2 )
115 height = wrapper.
lines();
120 height = AUTO_WRAP_HEIGHT;
125 height = wGetDefsze().H;
135 YLabel::setEnabled( do_bv );
139 void NCLabel::setSize(
int newWidth,
int newHeight )
141 if ( autoWrap() && layoutPass() == 1 )
144 wRelocate(
wpos( 0 ),
wsze( newHeight, newWidth ) );
148 void NCLabel::setText(
const string & newLabel )
151 defsze = label.size();
152 YLabel::setText( newLabel );
157 void NCLabel::wRedraw()
162 chtype bg = heading ? wStyle().dumb.title
163 : wStyle().dumb.text;
171 label.drawAt( *win, bg, bg );
175 void NCLabel::setAutoWrap(
bool autoWrap )
177 YLabel::setAutoWrap( autoWrap );
194 defsze = label.size();