void OnInitDialogSldShow(void *w) { GEM_WINDOW *wnd = (GEM_WINDOW *) w ; WEXTENSION_SLDSHOW *wext = wnd->DlgData->UserData ; WDLG_DATA *wdlg = wnd->Extension ; OBJECT *adr_sldshow = wnd->DlgData->BaseObject ; int i ; char buffer[20] ; if ( config.display_type & DISPLAYTYPE_ZOOM ) select( adr_sldshow, SSH_AFFZOOM ) ; else deselect( adr_sldshow, SSH_AFFZOOM ) ; if ( config.display_type & DISPLAYTYPE_REDUC ) select( adr_sldshow, SSH_AFFREDUC ) ; else deselect( adr_sldshow, SSH_AFFREDUC ) ; wext->transition = config.transition ; wdlg->popup_transition = popup_make(3, 13) ; if (wdlg->popup_transition == NULL) return ; for (i = 0; i <= 2; i++) strcpy(wdlg->popup_transition[1+i].ob_spec.free_string, msg[MSG_TRANSIT0+i]) ; write_text(adr_sldshow, SSH_TRANSITION, msg[MSG_TRANSIT0+wext->transition]) ; wext->back = config.back ; wdlg->popup_back = popup_make(2, 13) ; if (wdlg->popup_back == NULL) return ; strcpy(wdlg->popup_back[1].ob_spec.free_string, msg[MSG_NOIR]) ; strcpy(wdlg->popup_back[2].ob_spec.free_string, msg[MSG_BLANC]) ; if ( config.cycle ) select(adr_sldshow, SSH_CYCLE) ; else deselect(adr_sldshow, SSH_CYCLE) ; if ( config.do_not_cls_scr ) deselect(adr_sldshow, SSH_CLSSCREEN) ; else select(adr_sldshow, SSH_CLSSCREEN) ; if ( config.aff_name ) select(adr_sldshow, SSH_SHOWNAME) ; else deselect(adr_sldshow, SSH_SHOWNAME) ; if ( config.aff_prog ) select(adr_sldshow, SSH_SHOWPROG) ; else deselect(adr_sldshow, SSH_SHOWPROG) ; if ( config.wait_mini_sec >= 0 ) { sprintf( buffer, "%02d", config.wait_mini_sec ) ; write_text(adr_sldshow, SSH_WAITMINI, buffer) ; adr_sldshow[SSH_WAITMINI].ob_state &= ~DISABLED ; adr_sldshow[SSH_TWAITMINI].ob_state &= ~DISABLED ; deselect( adr_sldshow, SSH_NOTIMER ) ; } else { strcpy( buffer, "00" ) ; write_text(adr_sldshow, SSH_WAITMINI, buffer) ; adr_sldshow[SSH_WAITMINI].ob_state |= DISABLED ; adr_sldshow[SSH_TWAITMINI].ob_state |= DISABLED ; select( adr_sldshow, SSH_NOTIMER ) ; } }
void OnInitDialogPref(void *w) { GEM_WINDOW *wnd = (GEM_WINDOW *) w ; WEXTENSION_PREF *wext = wnd->DlgData->UserData ; WDLG_PREF *wdlg = wnd->Extension ; OBJECT *adr_pref = wnd->DlgData->BaseObject ; int i ; memcpy( &wext->save, &config, sizeof(VISION_CFG) ) ; wext->display_toolbar = config.flags & FLG_TOOLBAR ; if (config.flag_fullscreen == 1) select(adr_pref, PREF_PECRAN) ; else deselect(adr_pref, PREF_PECRAN) ; if (config.w_info == 1) select(adr_pref, PREF_WKIND) ; else deselect(adr_pref, PREF_WKIND) ; if (config.quitte == 1) select(adr_pref, PREF_QUIT) ; else deselect(adr_pref, PREF_QUIT) ; if (config.clip_gem == 1) select(adr_pref, PREF_CLIP) ; else deselect(adr_pref, PREF_CLIP) ; if (config.souris_viseur == 1) select(adr_pref, PREF_MVISEUR) ; else deselect(adr_pref, PREF_MVISEUR) ; if (config.flags & FLG_HELP) select(adr_pref, PREF_AIDE) ; else deselect(adr_pref, PREF_AIDE) ; if (config.flags & FLG_SPLASH) select(adr_pref, PREF_SPLASH) ; else deselect(adr_pref, PREF_SPLASH) ; if (config.flags & FLG_TOOLBAR) select(adr_pref, PREF_TOOLBAR) ; else deselect(adr_pref, PREF_TOOLBAR) ; if (config.flags & FLG_LONGFNAME) select(adr_pref, PREF_LONGFNAME) ; else deselect(adr_pref, PREF_LONGFNAME) ; if (config.flags & FLG_DITHERAUTO) select(adr_pref, PREF_DITHERAUTO) ; else deselect(adr_pref, PREF_DITHERAUTO) ; wdlg->popup_cp = popup_make(3, 14) ; if (wdlg->popup_cp == NULL) return ; for (i = 0; i <= 2; i++) strcpy(wdlg->popup_cp[1+i].ob_spec.free_string, msg[MSG_CPNONE+i]) ; wext->cp = config.color_protect ; write_text(adr_pref, PREF_CP, msg[MSG_CPNONE+wext->cp]) ; wdlg->popup_dm = popup_make(3, 26) ; if (wdlg->popup_dm == NULL) return ; for (i = 0; i <= 2; i++) strcpy(wdlg->popup_dm[1+i].ob_spec.free_string, msg[MSG_DITHERAUTO+i]) ; wext->dm = config.dither_method ; write_text(adr_pref, PREF_DITHER, msg[MSG_DITHERAUTO+wext->dm]) ; wdlg->popup_language = popup_make( config.nb_languages, 17 ) ; if ( wdlg->popup_language == NULL ) return ; for ( i = 1; i <= config.nb_languages; i++) sprintf( wdlg->popup_language[i].ob_spec.free_string, " %s", config.all_languages[i-1] ) ; sprintf( wext->language, " %s", config.language ) ; write_text( adr_pref, PREF_LANGUE, wext->language ) ; }
static int OnRButtonDown(void *w, int mk_state, int x, int y) { GEM_WINDOW *wnd = w ; HEX_DUMP *hex_dump = (HEX_DUMP *) wnd->Extension ; OBJECT *popup ; int clicked ; int i, mx, my, dummy ; popup = popup_make( 4, 15 ) ; if ( popup == NULL ) return( 0 ) ; i = 0 ; strcpy( popup[++i].ob_spec.free_string, " Byte " ) ; strcpy( popup[++i].ob_spec.free_string, " Word " ) ; strcpy( popup[++i].ob_spec.free_string, " Long " ) ; strcpy( popup[++i].ob_spec.free_string, " Find... " ) ; if ( ( hex_dump->display_type >= DT_BYTE ) && ( hex_dump->display_type <= DT_MIXED ) ) popup[hex_dump->display_type].ob_spec.free_string[0] = 8 ; graf_mkstate( &mx, &my, &dummy, &dummy ) ; clicked = popup_formdo( &popup, mx-16, my, 1, 0 ) ; popup_kill( popup, 4 ) ; if ( clicked >= 0 ) { } return( GW_EVTSTOPROUTING ) ; }
static void edit_handle_button(void *data, int b_num) { EDITINFO *einf = (EDITINFO *) data; switch (b_num) { case OUTPUTBUTTON: if (mouse_button==3) { outputmenu.parentwin=einf->win_id; outputmenu.x=-1; outputmenu.y=-1; outputmenu.menu = popup_define(translate("OutputFormat")); popup_make(&outputmenu); } else { outputmenu.menu = popup_define(translate("OutputFormat")); popup_call_default(&outputmenu); set_fileselc(data,b_num); } break; case LOADBUTTON: case INCLUDEBUTTON: case SAVEBUTTON: case RENAMEBUTTON: set_fileselc( data, b_num); break; case DONEBUTTON: if (can_close_edit) edit_close(data); break; } newname = NULL; }
int OnRButtonDownRTZoom(void *w, int mk_state, int mx, int my) { GEM_WINDOW *wnd = w ; OBJECT *popup ; int clicked ; int i, wx, wy, dummy ; popup = popup_make( 6, 15 ) ; if (popup == NULL) return( 0 ) ; for ( i = 0; i <= 4; i++ ) sprintf( popup[1+i].ob_spec.free_string, " Zoom x %d ", 1 << i ) ; sprintf( popup[1+i].ob_spec.free_string, " Options... " ) ; wnd->GetWorkXYWH( wnd, &wx, &wy, &dummy, &dummy ) ; clicked = popup_formdo( &popup, wx+mx-16, wy+my, 1, 0 ) - 1 ; popup_kill( popup, 6 ) ; if ( clicked >= 0 ) { if ( clicked < 5 ) rtzoom_change_level( 1 << clicked ) ; else pref_rtzoom() ; RTZoomDisable = 0 ; } return( 0 ) ; }
static void OnInitDialog(void *w) { GEM_WINDOW *wnd = (GEM_WINDOW *) w ; WEXTENSION_LDVDETAIL *wext = wnd->DlgData->UserData ; LDV_MODULE *ldv = wext->LdvModule ; LDV_INFOS *ldv_infos = &ldv->Infos ; LDV_INI_SPEC *ldv_lspec = &ldv->IniSpec ; WDLG_LDVDETAIL *wdlg = wnd->Extension ; OBJECT *bobj = wnd->DlgData->BaseObject ; TEDINFO *ted ; int i, nb_nplanes = (int) ( sizeof(nplanes)/sizeof(char) ) ; char buf[100] ; char *pt, c ; wdlg->popup_nplanes = popup_make( nb_nplanes, 6 ) ; if ( wdlg->popup_nplanes == NULL ) return ; wext->inplanes = -1 ; for ( i = 0; i < nb_nplanes; i++ ) { sprintf( wdlg->popup_nplanes[1+i].ob_spec.free_string, " %d ", nplanes[i] ) ; if ( LDVGetNPlanesCaps( wext->LdvModule, nplanes[i] ) == NULL ) wdlg->popup_nplanes[1+i].ob_state |= DISABLED ; else if ( wext->inplanes < 0 ) wext->inplanes = i+1 ; } if ( wext->inplanes >= 0 ) write_text( bobj, LDVD_NPLANES, wdlg->popup_nplanes[wext->inplanes].ob_spec.free_string ) ; write_text( bobj, LDVD_LONGNAME, ldv_lspec->LongName ) ; sprintf( buf, "%d", ldv_infos->Type ) ; write_text( bobj, LDVD_TYPE, buf ) ; sprintf( buf, "%02x.%02x", (ldv->Version & 0xFF00) >> 8, ldv->Version & 0x00FF ) ; write_text( bobj, LDVD_VERSION, buf ) ; write_text( bobj, LDVD_AUTHORS, ldv_infos->Authors ) ; ted = bobj[LDVD_DESC1].ob_spec.tedinfo ; if ( ldv_lspec->Description && ( strlen( ldv_lspec->Description ) > ted->te_txtlen ) ) { pt = ldv_lspec->Description + ted->te_txtlen - 1 ; while ( ( pt > ldv_lspec->Description ) && ( *pt != ' ' ) ) pt-- ; if ( pt == ldv_lspec->Description ) pt = ldv_lspec->Description + ted->te_txtlen ; c = *pt ; *pt = 0 ; write_text( bobj, LDVD_DESC1, ldv_lspec->Description ) ; *pt = c ; if ( c == ' ' ) write_text( bobj, LDVD_DESC2, 1+pt ) ; else write_text( bobj, LDVD_DESC2, pt ) ; } else { write_text( bobj, LDVD_DESC1, ldv_lspec->Description ) ; write_text( bobj, LDVD_DESC2, "" ) ; } GetLDVLanguages( ldv, buf ) ; write_text( bobj, LDVD_LANGUAGES, buf ) ; write_text( bobj, LDVD_FILENAME, wext->LdvModule->FileName ) ; setup_details( wnd, 0 ) ; }
void OnInitDialogIBrowser(void *w) { GEM_WINDOW *wnd = (GEM_WINDOW *) w ; OBJECT *bobj = wnd->DlgData->BaseObject ; WBROWSER *wb = wnd->Extension ; CMD_BROWSER *wdlg = wnd->DlgData->UserData ; int i ; int sel = SEL_100PC ; /* 100% */ wdlg->popup_zoom = popup_make( NB_LABELS, 3 + 1 + (int)strlen( popup_label[0] ) ) ; if ( wdlg->popup_zoom == NULL ) return ; for ( i = 0; i < NB_LABELS; i++ ) sprintf( wdlg->popup_zoom[1+i].ob_spec.free_string, " %s ", popup_label[i] ) ; write_text( bobj, IMGB_SCALE, wdlg->popup_zoom[1+sel].ob_spec.free_string ) ; sscanf( wdlg->popup_zoom[1+sel].ob_spec.free_string, "%d%%", &wb->pczoom ) ; write_text( bobj, IMGB_TEXT, "" ) ; wb->mini_w = bobj[0].ob_width ; }
OBJECT *make_category_popup(GEM_WINDOW *wnd) { WEXTENSION_ALBUM *wext = wnd->DlgData->UserData ; int i = 0 ; if ( wext->categorie ) popup_kill( wext->categorie, wext->nb_categories ) ; wext->nb_categories = 1 ; while ( catalog_header.category_names[i][0] ) { wext->nb_categories++ ; i++ ; } wext->categorie = popup_make( wext->nb_categories, 3+CATEGORY_SIZE ) ; if ( wext->categorie == NULL ) return( NULL ) ; strcpy( wext->categorie[1].ob_spec.free_string, msg[MSG_NEWCAT] ) ; i = 0 ; while ( catalog_header.category_names[i][0] ) { sprintf( wext->categorie[2+i].ob_spec.free_string, " %s", catalog_header.category_names[i] ) ; i++ ; } return( wext->categorie ) ; }
void OnInitPrinterDialog(void *w) { static int printer_index ; static int type_index = 0 ; GEM_WINDOW *wnd = (GEM_WINDOW *) w ; DIALOG *dlg = (DIALOG *) wnd->DlgData ; DLGPRINTER_USER_DATA *dlg_user_data = dlg->UserData ; DLGPRINTER_WEXTENSION *wext ; OBJECT *adr_print = dlg->BaseObject ; int i ; char buffer[200] ; wnd->Extension = calloc( sizeof(DLGPRINTER_WEXTENSION), 1 ) ; wext = (DLGPRINTER_WEXTENSION *) wnd->Extension ; read_text( adr_print, PRINT_FILE, buffer ) ; if ( dlg_user_data->filename[0] ) write_text( adr_print, PRINT_FILE, dlg_user_data->filename ) ; else write_text( adr_print, PRINT_FILE, buffer ) ; wext->popup_page = popup_make(1+LAST_INDEX, 11) ; for (i = 0; i <= LAST_INDEX; i++) strcpy(wext->popup_page[1+i].ob_spec.free_string, tab_page[i]->nom) ; wext->popup_printer = popup_make(nb_drivers, 20) ; for (i = 0; i < nb_drivers; i++) sprintf(wext->popup_printer[1+i].ob_spec.free_string, " %s", &printer_names[i][0]) ; dlg_user_data->printer_index = printer_index ; wext->popup_type = popup_make(2, 20) ; strcpy(wext->popup_type[1].ob_spec.free_string, msg[MSG_PRINTCOLOR]) ; strcpy(wext->popup_type[2].ob_spec.free_string, msg[MSG_PRINTBW]) ; dlg_user_data->sizex = (float)dlg_user_data->raster.fd_w*(float)dlg_user_data->info.lpix/10000.0 ; /* En cm */ sprintf(buffer, "%.1f", dlg_user_data->sizex) ; write_text(adr_print, PRINT_SIZEX, buffer) ; dlg_user_data->sizey = (float)dlg_user_data->raster.fd_h*(float)dlg_user_data->info.hpix/10000.0 ; /* En cm */ sprintf(buffer, "%.1f", dlg_user_data->sizey) ; write_text(adr_print, PRINT_SIZEY, buffer) ; write_text(adr_print, PRINT_XPC, "100") ; write_text(adr_print, PRINT_YPC, "100") ; dlg_user_data->page.unite = CM ; read_text(adr_print, PRINT_SIZEPAGEW, buffer) ; dlg_user_data->page.largeur = atof(buffer) ; read_text(adr_print, PRINT_SIZEPAGEH, buffer) ; dlg_user_data->page.hauteur = atof(buffer) ; setup_pagename(&dlg_user_data->page) ; deselect(adr_print, PRINT_R90) ; deselect(adr_print, PRINT_CENTREX) ; deselect(adr_print, PRINT_CENTREY) ; if (dlg_user_data->info.nplans == 1) { adr_print[PRINT_TYPE].ob_state |= DISABLED ; dlg_user_data->type_index = 1 ; } else { adr_print[PRINT_TYPE].ob_state &= ~DISABLED ; dlg_user_data->type_index = type_index ; } write_text(adr_print, PRINT_CONFIGPAGE, dlg_user_data->page.nom) ; write_text(adr_print, PRINT_PRINTER, wext->popup_printer[1+dlg_user_data->printer_index].ob_spec.free_string) ; write_text(adr_print, PRINT_TYPE, wext->popup_type[1+dlg_user_data->type_index].ob_spec.free_string) ; sprintf(buffer, "%.4d/%.4d", micron2dpi(dlg_user_data->info.lpix), micron2dpi(dlg_user_data->info.hpix)) ; write_text(adr_print, PRINT_RESOL, buffer) ; compute_page( dlg ) ; }