Esempio n. 1
0
void uimovelistbox( a_list *list, int row_diff, int col_diff )
{
    if( list ->box != NULL ) {
        uivmove( list->box->vs, list->box->vs->area.row + row_diff,
                 list->box->vs->area.col + col_diff );
    }
}
Esempio n. 2
0
bool uiresizedialog( a_dialog *info, SAREA *new_area )
{
    int         row_diff;
    int         col_diff;
    VSCREEN     *vs;
    VFIELD      *curr;
    int         i;
    bool        resize;

    vs = (VSCREEN *)info->vs;

    if( new_area->row < 2 ) {
        new_area->row = 2;
    }
    if( new_area->col < 1 ) {
        new_area->col = 1;
    }
    if( new_area->row + vs->area.height >= UIData->height ) {
        new_area->row = UIData->height - vs->area.height - 1;
    }
    if( new_area->col + vs->area.width >= UIData->width ) {
        new_area->col = UIData->width - vs->area.width - 1;
    }
    row_diff = new_area->row - vs->area.row;
    col_diff = new_area->col - vs->area.col;
    resize = ( new_area->width != vs->area.width ) ||
             ( new_area->height != vs->area.height );
    if( resize ) {
        uivclose( vs );
        vs->area = *new_area;
        uivopen( vs );
    } else {
        uivmove( info->vs, new_area->row, new_area->col );
    }
    /* close all open pull down boxes */
    for( curr = info->fields; curr->typ != FLD_VOID; curr++ ) {
        uimovefield( info, curr, row_diff, col_diff );
    }
    if( resize ) {
        for( i = 0 ; info->fields[i].typ != FLD_VOID ; ++i ) {
            print_field( info->vs, &info->fields[i],
                         &info->fields[i] == info->curr );
        }
    }
    return( TRUE );
}
Esempio n. 3
0
bool uiresizedialog( a_dialog *ui_dlg_info, SAREA *new_area )
{
    int         row_diff;
    int         col_diff;
    VSCREEN     *vs;
    VFIELD      *fields;
    bool        resize;

    vs = ui_dlg_info->vs;

    if( new_area->row < 2 ) {
        new_area->row = 2;
    }
    if( new_area->col < 1 ) {
        new_area->col = 1;
    }
    if( new_area->row + vs->area.height >= UIData->height ) {
        new_area->row = UIData->height - vs->area.height - 1;
    }
    if( new_area->col + vs->area.width >= UIData->width ) {
        new_area->col = UIData->width - vs->area.width - 1;
    }
    row_diff = new_area->row - vs->area.row;
    col_diff = new_area->col - vs->area.col;
    resize = ( new_area->width != vs->area.width ) ||
             ( new_area->height != vs->area.height );
    if( resize ) {
        uivclose( vs );
        vs->area = *new_area;
        uivopen( vs );
    } else {
        uivmove( ui_dlg_info->vs, new_area->row, new_area->col );
    }
    /* close all open pull down boxes */
    for( fields = ui_dlg_info->fields; fields->typ != FLD_NONE; fields++ ) {
        uimovefield( ui_dlg_info, fields, row_diff, col_diff );
    }
    if( resize ) {
        for( fields = ui_dlg_info->fields; fields->typ != FLD_NONE; fields++ ) {
            print_field( ui_dlg_info->vs, fields, ( fields == ui_dlg_info->curr ) );
        }
    }
    return( true );
}