25 #define YUILogComponent "ncurses"
26 #include <yui/YUILog.h>
28 #include "NCMenuButton.h"
29 #include "NCPopupMenu.h"
32 NCMenuButton::NCMenuButton( YWidget * parent,
34 : YMenuButton( parent, nlabel )
37 yuiDebug() << std::endl;
43 NCMenuButton::~NCMenuButton()
45 yuiDebug() << std::endl;
49 int NCMenuButton::preferredWidth()
51 return wGetDefsze().W;
55 int NCMenuButton::preferredHeight()
57 return wGetDefsze().H;
64 YMenuButton::setEnabled( do_bv );
68 void NCMenuButton::setSize(
int newwidth,
int newheight )
70 wRelocate(
wpos( 0 ),
wsze( newheight, newwidth ) );
92 void NCMenuButton::setLabel(
const std::string & nlabel )
96 defsze =
wsze( label.height(), label.width() + 3 );
97 YMenuButton::setLabel( nlabel );
102 void NCMenuButton::wRedraw()
111 if ( label.height() > 1 )
120 label.drawAt( *win, style,
wpos( 0, 1 ),
wsze( -1, win->
width() - 3 ),
127 : win->
addch( 0, win->
maxx() - 1, ACS_DARROW );
131 void NCMenuButton::rebuildMenuTree()
143 YUI_CHECK_NEW( dialog );
145 int selection = dialog->post();
149 YDialog::deleteTopmostDialog();
150 return NCursesEvent::none;
154 ret.selection = findMenuItem( selection );
155 YDialog::deleteTopmostDialog();
int printw(const char *fmt,...)
int vline(int len, chtype ch=0)
int add_wch(const cchar_t *cch)