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 ),
int bkgd(const chtype ch)
Set the background property and apply it to the window.
int maxx() const
Largest x coord in window.
int printw(const char *fmt,...)
Do a formatted print to the window.
int clear()
Clear the window.
int box()
Draw a box around the window with the given vertical and horizontal drawing characters.
int width() const
Number of columns in this window.
void sendEvent(NCursesEvent event)
Send an event to the UI.
static YNCursesUI * ui()
Access the global Y2NCursesUI.