Exemplo n.º 1
0
void newtCheckboxSetFlags(newtComponent co, int flags, enum newtFlagsSense sense) {
    struct checkbox * cb = co->data;
    int row, col;

    cb->flags = newtSetFlags(cb->flags, flags, sense);

    if (!(cb->flags & NEWT_FLAG_DISABLED))
	co->takesFocus = 1;
    else
	co->takesFocus = 0;

    newtGetrc(&row, &col);
    cbDraw(co);
    newtGotorc(row, col);
}
Exemplo n.º 2
0
void newtCheckboxSetFlags(newtComponent co, int flags, enum newtFlagsSense sense) {
    struct checkbox * cb = co->data;
    int row, col;

    cb->flags = newtSetFlags(cb->flags, flags, sense);

    // If the flag just sets a property (eg. NEWT_FLAG_RETURNEXIT),
    // don't redraw, etc. as the component might be 'hidden' and not to
    // be drawn (eg. in a scrolled list)
    if (flags == NEWT_FLAG_RETURNEXIT)
	    return;

    if (!(cb->flags & NEWT_FLAG_DISABLED))
	co->takesFocus = 1;
    else
	co->takesFocus = 0;

    newtGetrc(&row, &col);
    cbDraw(co);
    newtGotorc(row, col);
}