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()
140 wpos at( ScreenPos() +
wpos( 1, 0 ) );
145 YUI_CHECK_NEW( dialog );
147 int selection = dialog->post();
151 YDialog::deleteTopmostDialog();
152 return NCursesEvent::none;
156 ret.selection = findMenuItem( selection );
157 YDialog::deleteTopmostDialog();
int printw(const char *fmt,...)
Do a formatted print to the window.
int vline(int len, chtype ch=0)
Draw a vertical line of len characters with the given character.
void bkgdset(chtype ch)
Set the background property.
int maxx() const
Largest x coord in window.
int box()
Draw a box around the window with the given vertical and horizontal drawing characters.
int height() const
Number of lines in this window.
int addch(const char ch)
Put attributed character to the window.
int width() const
Number of columns in this window.
int add_wch(const cchar_t *cch)
Put a combined character to the window.