void uifreedialog( a_dialog *ui_dlg_info ) { VFIELD *fields; // pointer to array of fields in dialog box a_list *list; a_combo_box *combo; // an_edit_control *edit; exit_field( ui_dlg_info, ui_dlg_info->curr ); for( fields = ui_dlg_info->fields; fields->typ != FLD_NONE; fields++ ) { switch( fields->typ ) { case FLD_LISTBOX: case FLD_PULLDOWN: case FLD_EDIT_MLE: list = fields->u.list; uiendlistbox( list ); break; // case FLD_INVISIBLE_EDIT: // case FLD_EDIT: // edit = fields->u.edit; // uifree( edit->buffer ); // edit->buffer = NULL; // Need this null for next // break; // time around case FLD_COMBOBOX: combo = fields->u.combo; list = &combo->list; // edit = &combo->edit; // uifree( edit->buffer ); // edit->buffer = NULL; uiendlistbox( list ); // Shut down listbox break; } } }
extern void uidialogexitcurr( a_dialog *info ) { /* you must call this function to set info->dirty or to do */ /* blank trimming on an edit control */ if( exit_field( info, info->curr ) ) { info->dirty = TRUE; } }
void uidialogexitcurr( a_dialog *ui_dlg_info ) { /* you must call this function to set ui_dlg_info->dirty or to do */ /* blank trimming on an edit control */ if( exit_field( ui_dlg_info, ui_dlg_info->curr ) ) { ui_dlg_info->dirty = true; } }
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 ); } }
void uifreedialog( a_dialog *info ) { VFIELD *fields; // pointer to array of fields in dialog box a_list *list; short unsigned i; a_combo_box *combo; // an_edit_control *edit; fields = info->fields; exit_field( info, info->curr ); for( i = 0 ; fields[i].typ != FLD_VOID ; ++i ) { switch( fields[i].typ ) { case FLD_LISTBOX: case FLD_PULLDOWN: case FLD_EDIT_MLE: list = fields[i].ptr; uiendlistbox( list ); break; // case FLD_INVISIBLE_EDIT: // case FLD_EDIT: // edit = fields[i].ptr; // uifree( edit->buffer ); // edit->buffer = NULL; // Need this null for next // break; // time around case FLD_COMBOBOX: combo = fields[i].ptr; list = &combo->list; // edit = &combo->edit; // uifree( edit->buffer ); // edit->buffer = NULL; uiendlistbox( list ); // Shut down listbox break; } } }
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 ); }