void uiupdateedit( a_dialog *info, VFIELD *field ) { an_edit_control *edit; a_combo_box *combo; if( ( field == NULL ) || ( info == NULL ) || ( field != info->curr ) ) { return; } edit = NULL; switch( field->typ ) { case FLD_COMBOBOX : combo = field->ptr; edit = &combo->edit; break; case FLD_EDIT : case FLD_INVISIBLE_EDIT: edit = field->ptr; break; } if( edit != NULL ) { if( info->edit_data != NULL ) { uiendedit(); info->edit_data = NULL; } enter_field( info, info->curr ); } }
void uireinitdialog( a_dialog *info, VFIELD *fields ) { unsigned i; uiposnhotspots( info->vs, fields ); info->dirty = FALSE; info->first = NULL; info->other = NULL; info->fields = fields; info->first = &fields[0]; /* set first to be first field in tab sequence */ while( notintab( info->first ) ) { if( info->first->typ == FLD_VOID ) { info->first = NULL; break; } ++(info->first); } info->curr = info->first; if( info->first != NULL ) { /* set curr to first field in tab sequence not an unset radio button */ while( radiooff( info->curr ) ) { info->curr = nextfield( info->curr ); } } for( i = 0 ; fields[i].typ != FLD_VOID ; ++i ) { print_field( info->vs, &fields[i], &fields[i] == info->curr ); } enter_field( info, info->curr ); }
void uireinitdialog( a_dialog *ui_dlg_info, VFIELD *fields ) { uiposnhotspots( ui_dlg_info->vs, fields ); ui_dlg_info->dirty = false; ui_dlg_info->first = NULL; ui_dlg_info->other = NULL; ui_dlg_info->fields = fields; /* set first to be first field in tab sequence */ for( ui_dlg_info->first = fields; notintab( ui_dlg_info->first ); ui_dlg_info->first++ ) { if( ui_dlg_info->first->typ == FLD_NONE ) { ui_dlg_info->first = NULL; break; } } ui_dlg_info->curr = ui_dlg_info->first; if( ui_dlg_info->first != NULL ) { /* set curr to first field in tab sequence not an unset radio button */ while( radiooff( ui_dlg_info->curr ) ) { ui_dlg_info->curr = nextfield( ui_dlg_info->curr ); } } for( ; fields->typ != FLD_NONE; fields++ ) { print_field( ui_dlg_info->vs, fields, ( fields == ui_dlg_info->curr ) ); } enter_field( ui_dlg_info, ui_dlg_info->curr ); }
extern void uidialogsetcurr( a_dialog *info, VFIELD *curr ) { VFIELD *other; other = info->curr; if( other != curr ) { info->other = info->curr; info->curr = curr; if( exit_field( info, other ) ) { info->dirty = TRUE; } print_field( info->vs, other, FALSE ); enter_field( info, curr ); print_field( info->vs, curr, TRUE ); uidialogchangefield( info ); } }
void uidialogsetcurr( a_dialog *ui_dlg_info, VFIELD *curr ) { VFIELD *other; other = ui_dlg_info->curr; if( other != curr ) { ui_dlg_info->other = ui_dlg_info->curr; ui_dlg_info->curr = curr; if( exit_field( ui_dlg_info, other ) ) { ui_dlg_info->dirty = true; } print_field( ui_dlg_info->vs, other, false ); enter_field( ui_dlg_info, curr ); print_field( ui_dlg_info->vs, curr, true ); uidialogchangefield( ui_dlg_info ); } }
an_event uidialog( a_dialog *info ) { static EVENT dialog_events[] = { 'a', 'z', 'A', 'Z', EV_ALT_Q, EV_ALT_M, EV_NO_EVENT, EV_ALT_CURSOR_DOWN, EV_CURSOR_UP, EV_CURSOR_DOWN, EV_CURSOR_LEFT, EV_CURSOR_RIGHT, EV_TAB_FORWARD, EV_TAB_BACKWARD, EV_MOUSE_PRESS, EV_MOUSE_RELEASE, EV_MOUSE_DRAG, EV_MOUSE_REPEAT, EV_MOUSE_DCLICK, EV_ENTER, ' ', EV_NO_EVENT }; a_list *list; an_event ev; VFIELD *field; ev = EV_NO_EVENT; enter_field( info, info->curr ); while( ev == EV_NO_EVENT || !uiinlist( ev ) ) { field = info->curr; if( field != NULL ) { switch( field->typ ) { case FLD_EDIT: case FLD_INVISIBLE_EDIT: uieditpushlist(); break; case FLD_PULLDOWN: uiboxpushlist( ); break; case FLD_COMBOBOX: uiboxpushlist( ); uieditpushlist(); break; case FLD_LISTBOX: case FLD_EDIT_MLE: list = field->ptr; uiboxpushlist(); break; } } uipushlist( dialog_events ); ev = uidialogevent( info->vs ); ev = uidialogcallback( info, ev ); uipoplist( /* dialog_events */ ); if( field != NULL ) { switch( field->typ ) { case FLD_EDIT: case FLD_INVISIBLE_EDIT: uieditpoplist(); break; case FLD_PULLDOWN: uiboxpoplist(); break; case FLD_COMBOBOX: uiboxpoplist(); uieditpoplist(); break; case FLD_LISTBOX: case FLD_EDIT_MLE: uiboxpoplist(); break; } } ev = uiprocessdialogevent( ev, info ); } /* This code will make sure to exit the current fields before returning * a default hot spot event. This is for consistency with windows. */ if( uiisdefaulthotspot( info->fields, ev ) ) { if( exit_field( info, info->curr ) ) { info->dirty = TRUE; } } info->field = (VFIELD *)info->curr - (VFIELD *)info->fields; return( ev ); }