STATIC void getDlgValues( gui_window *gui ) /*****************************************/ { OptDIFFormat = GUIIsChecked( gui, CTL_DIF_FMT ); OptCommaFormat = GUIIsChecked( gui, CTL_COMMA_FMT ); GUIDlgBuffGetText( gui, CTL_NAME, convertPath, sizeof( convertPath ) ); }
OVL_EXTERN bool ProgEvent( gui_window * gui, gui_event gui_ev, void * param ) { gui_ctl_id id; dlg_new_prog *dlg; dlg = GUIGetExtra( gui ); switch( gui_ev ) { case GUI_INIT_DIALOG: GUILimitEditText( gui, CTL_NEWP_PROG, UTIL_LEN - 1 ); GUILimitEditText( gui, CTL_NEWP_ARGS, UTIL_LEN - 1 ); GUISetText( gui, CTL_NEWP_PROG, dlg->prog ); GUISetText( gui, CTL_NEWP_ARGS, dlg->args ); GUISetFocus( gui, CTL_NEWP_PROG ); return( true ); case GUI_CONTROL_CLICKED : GUI_GETID( param, id ); switch( id ) { case CTL_NEWP_BROWSE: GUIDlgBuffGetText( gui, CTL_NEWP_PROG, TxtBuff, TXT_LEN ); if( !ExeBrowse() ) return( true ); GUISetText( gui, CTL_NEWP_PROG, TxtBuff ); GUISetFocus( gui, CTL_NEWP_PROG ); return( true ); case CTL_NEWP_OK: GUIDlgBuffGetText( gui, CTL_NEWP_PROG, prog, sizeof( prog ) ); GUIDlgBuffGetText( gui, CTL_NEWP_ARGS, args, sizeof( args ) ); dlg->cancel = false; GUICloseDialog( gui ); return( true ); case CTL_NEWP_CANCEL: GUICloseDialog( gui ); return( true ); } return( false ); case GUI_DESTROY: return( true ); } return( false ); }
static bool SourceEvent( gui_window *gui, gui_event gui_ev, void *param ) { gui_ctl_id id; void *curr; int i; int size; char *text; dlg_list *dlg; dlg = GUIGetExtra( gui ); switch( gui_ev ) { case GUI_DESTROY: WndFree( dlg->title ); return( true ); case GUI_INIT_DIALOG: GUISetWindowText( gui, dlg->title ); GUIClearList( gui, CTL_LIST_LIST ); for( curr = dlg->next( NULL ); curr != NULL; curr = dlg->next( curr ) ) { AddText( gui, dlg->name( curr ) ); } GUISetFocus( gui, CTL_LIST_EDIT ); return( true ); case GUI_CONTROL_CLICKED: GUI_GETID( param, id ); switch( id ) { case CTL_LIST_LIST: GUIDlgBuffGetText( gui, CTL_LIST_LIST, TxtBuff, TXT_LEN ); GUISetText( gui, CTL_LIST_EDIT, TxtBuff ); break; case CTL_LIST_DELETE: i = GUIGetCurrSelect( gui, CTL_LIST_LIST ); if( i != -1 ) { GUIDeleteItem( gui, CTL_LIST_LIST, i ); } size = GUIGetListSize( gui, CTL_LIST_LIST ); if( i < size ) { GUISetCurrSelect( gui, CTL_LIST_LIST, i ); } else { SelectListLast( gui ); } GUISetFocus( gui, CTL_LIST_LIST ); GUISetText( gui, CTL_LIST_EDIT, NULL ); break; case CTL_LIST_ADD: case CTL_LIST_OK: GUIDlgBuffGetText( gui, CTL_LIST_EDIT, TxtBuff, TXT_LEN ); if( TxtBuff[0] != '\0' ) AddText( gui, TxtBuff ); SelectListLast( gui ); GUIClearText( gui, CTL_LIST_EDIT ); GUISetFocus( gui, CTL_LIST_EDIT ); if( id == CTL_LIST_ADD ) break; dlg->clear(); size = GUIGetListSize( gui, CTL_LIST_LIST ); for( i = 0; i < size; ++i ) { text = GUIGetListItem( gui, CTL_LIST_LIST, i ); if( text != NULL ) { dlg->add( text, strlen( text ) ); GUIMemFree( text ); } } /* fall through */ case CTL_LIST_CANCEL: GUICloseDialog( gui ); break; case CTL_LIST_BROWSE: GUIDlgBuffGetText( gui, CTL_LIST_EDIT, TxtBuff, TXT_LEN ); if( !AllBrowse( TxtBuff ) ) return( true ); GUISetText( gui, CTL_LIST_EDIT, TxtBuff ); GUISetFocus( gui, CTL_LIST_EDIT ); return( true ); } return( true ); default: return( false ); } }