25 #define YUILogComponent "ncurses" 26 #include <yui/YUILog.h> 28 #include "NCRadioButton.h" 29 #include "NCRadioButtonGroup.h" 30 #include "YNCursesUI.h" 33 NCRadioButton::NCRadioButton( YWidget * parent,
34 const std::string & nlabel,
36 : YRadioButton( parent, nlabel )
40 yuiDebug() << std::endl;
47 NCRadioButton::~NCRadioButton()
49 yuiDebug() << std::endl;
53 int NCRadioButton::preferredWidth()
55 return wGetDefsze().W;
59 int NCRadioButton::preferredHeight()
61 return wGetDefsze().H;
68 YRadioButton::setEnabled( do_bv );
72 void NCRadioButton::setSize(
int newwidth,
int newheight )
74 wRelocate(
wpos( 0 ),
wsze( newheight, newwidth ) );
78 void NCRadioButton::setLabel(
const std::string & nlabel )
82 defsze =
wsze( label.height(), label.width() + 4 );
83 YRadioButton::setLabel( nlabel );
88 void NCRadioButton::setValue(
bool newval )
90 if ( newval != checked )
94 if ( checked && buttonGroup() )
96 buttonGroup()->uncheckOtherButtons(
this );
111 void NCRadioButton::wRedraw()
120 win->
printw( 0, 0,
"( ) " );
122 label.drawAt( *win, style,
wpos( 0, 4 ) );
126 win->
printw( 0, 1,
"%c", ( checked ?
'x' :
' ' ) );
133 bool oldChecked = checked;
143 if ( notify() && oldChecked != checked )
144 ret = NCursesEvent::ValueChanged;
152 group->focusPrevButton();
160 group->focusNextButton();
int printw(const char *fmt,...)
Do a formatted print to the window.
void bkgdset(chtype ch)
Set the background property.
static YNCursesUI * ui()
Access the global Y2NCursesUI.
void sendEvent(NCursesEvent event)
Send an event to the UI.