25 #define YUILogComponent "ncurses"
26 #include <yui/YUILog.h>
28 #include "NCRadioButton.h"
29 #include "NCRadioButtonGroup.h"
32 NCRadioButton::NCRadioButton( YWidget * parent,
33 const std::string & nlabel,
35 : YRadioButton( parent, nlabel )
39 yuiDebug() << std::endl;
46 NCRadioButton::~NCRadioButton()
48 yuiDebug() << std::endl;
52 int NCRadioButton::preferredWidth()
54 return wGetDefsze().W;
58 int NCRadioButton::preferredHeight()
60 return wGetDefsze().H;
67 YRadioButton::setEnabled( do_bv );
71 void NCRadioButton::setSize(
int newwidth,
int newheight )
73 wRelocate(
wpos( 0 ),
wsze( newheight, newwidth ) );
77 void NCRadioButton::setLabel(
const std::string & nlabel )
81 defsze =
wsze( label.height(), label.width() + 4 );
82 YRadioButton::setLabel( nlabel );
87 void NCRadioButton::setValue(
bool newval )
89 if ( newval != checked )
93 if ( checked && buttonGroup() )
95 buttonGroup()->uncheckOtherButtons(
this );
103 void NCRadioButton::wRedraw()
112 win->
printw( 0, 0,
"( ) " );
114 label.drawAt( *win, style,
wpos( 0, 4 ) );
118 win->
printw( 0, 1,
"%c", ( checked ?
'x' :
' ' ) );
125 bool oldChecked = checked;
135 if ( notify() && oldChecked != checked )
136 ret = NCursesEvent::ValueChanged;
144 group->focusPrevButton();
152 group->focusNextButton();
int printw(const char *fmt,...)