25 #define YUILogComponent "ncurses"
26 #include <yui/YUILog.h>
27 #include <yui/YDialog.h>
30 #include "NCPushButton.h"
31 #include "YNCursesUI.h"
34 NCPushButton::NCPushButton( YWidget * parent,
const std::string & nlabel )
35 : YPushButton( parent, nlabel )
38 yuiDebug() << std::endl;
44 NCPushButton::~NCPushButton()
46 yuiDebug() << std::endl;
50 int NCPushButton::preferredWidth()
52 wsze defsize = wGetDefsze();
53 return wGetDefsze().W;
57 int NCPushButton::preferredHeight()
59 return wGetDefsze().H;
66 YPushButton::setEnabled( do_bv );
70 void NCPushButton::setSize(
int newwidth,
int newheight )
72 wRelocate(
wpos( 0 ),
wsze( newheight, newwidth ) );
84 ret = NCursesEvent::Activated;
92 void NCPushButton::setLabel(
const std::string & nlabel )
96 defsze =
wsze( label.height(), label.width() + 2 );
97 YPushButton::setLabel( nlabel );
102 void NCPushButton::wRedraw()
109 win->
bkgd( style.plain );
113 if ( label.height() <= 1 )
123 label.drawAt( *win, style,
wpos( 0, 1 ),
wsze( -1, win->
width() - 2 ),