void on_page_setup_default_button_clicked (GtkButton *button, gpointer user_data) { // Initialize paper size. UpdateMenuLink(CNCL_PAPERSIZE, g_main_window->init_paper_size); // Re-create the user size dialog. g_user_size_dialog = ReCreateUserSizeDialog( g_user_size_dialog, UI_DIALOG(g_main_window), g_unit_inch); // Initialize printing type. g_main_window->printing_type = g_printing_type_value[0]; // Initialize margin type. if( IsAvailableBorderless() ) UpdateMenuLink(CNCL_MARGINTYPE, CND_MARGIN_NORMAL); // Initialize scaling, etc. g_main_window->scaling = 100; g_main_window->centering = LOCATION_UPPERLEFT; g_main_window->ext_border = GetDefaultExtBorder(g_model_id); g_main_window->copies = 1; // Update widgets. DisableSignal(); UpdateWidgets(UI_DIALOG(g_main_window)->window, NULL); EnableSignal(); }
void on_quality_dialog_quality_i_button_toggled (GtkToggleButton *togglebutton, gpointer user_data) { if( DisableSignal() ) { GtkWidget* window = GetTopWidget(GTK_WIDGET(togglebutton)); int quality = GetActiveButtonIndex(window, print_quality_button_name,0); // Save the halftoning value before updating the print quality. short bin_method_value = GetCurrentnValue(CNCL_DITHER_PAT); short flag; UpdateMenuLink(CNCL_PRINTQUALITY, print_quality_button_value[quality]); // If can be set previous halftoning value, set it. flag = GetAllFlags(CNCL_DITHER_PAT, bin_method_value); if( !(flag & DISABLE_FLAG) ) UpdateMenuLink(CNCL_DITHER_PAT, bin_method_value); UpdateQualityDialogWidgets(window, "quality_i_button"); } EnableSignal(); }
/*--------------------------------------*/ void HideColorDialog2(UIColorDialog2* dialog, gboolean apply) { /* Ver.2.80 */ GtkWidget* window = UI_DIALOG(dialog)->window; if( apply ) { /* Ver.2.90 */ dialog->cyan_balance = (short)atoi( gtk_entry_get_text( GTK_ENTRY( LookupWidget( window , "c_dlg_c_value_spin2") ) ) ); dialog->magenta_balance = (short)atoi( gtk_entry_get_text( GTK_ENTRY( LookupWidget( window , "c_dlg_m_value_spin2") ) ) ); dialog->yellow_balance = (short)atoi( gtk_entry_get_text( GTK_ENTRY( LookupWidget( window , "c_dlg_y_value_spin2") ) ) ); dialog->density_balance = (short)atoi( gtk_entry_get_text( GTK_ENTRY( LookupWidget( window , "c_dlg_density_value_spin2") ) ) ); dialog->contrast_balance = (short)atoi( gtk_entry_get_text( GTK_ENTRY( LookupWidget( window , "c_dlg_contrast_value_spin2") ) ) ); /* Ver.3.40 */ dialog->tone_balance = (short)atoi( gtk_entry_get_text( GTK_ENTRY( LookupWidget( window , "c_dlg_tone_value_spin2") ) ) ); dialog->vivid = GTK_TOGGLE_BUTTON(LookupWidget(UI_DIALOG(dialog)->window, "color_dialog_vivid_button2"))->active; /* CNCL_INTENT : Set current setting */ dialog->color_correct = GetCurrentnValue(CNCL_INTENT); /* CNCL_INPUT_GAMMA : Set current setting */ dialog->gamma = GetCurrentnValue(CNCL_INPUT_GAMMA); } else { /* "Cancel" -> Recover parameters. */ UpdateMenuLink(CNCL_INPUT_GAMMA, dialog->gamma); UpdateMenuLink(CNCL_INTENT, dialog->color_correct); } HideDialog((UIDialog*)dialog); }
static void update_by_cartridge_type_entry() { GtkWidget* window = UI_DIALOG(g_main_window)->window; GtkWidget* entry = LookupWidget(window, "cartridge_type_entry"); short new_cartridge_value = NameToValue(CNCL_CARTRIDGE, (char*)gtk_entry_get_text(GTK_ENTRY(entry))); short media_type_value = GetCurrentnValue(CNCL_MEDIATYPE); if( !IsAvailableMedia(g_mediatype_dialog, media_type_value, new_cartridge_value) ) { short new_media_type_value; if( (new_media_type_value = ShowMediaTypeDialog(g_mediatype_dialog, media_type_value, new_cartridge_value)) != -1 ) { UpdateMenuLink(CNCL_MEDIATYPE, new_media_type_value); UpdateMenuLink(CNCL_CARTRIDGE, new_cartridge_value); #ifdef NEED_TO_SAVE_GRAYSCALE if( GetCurrentnValue(CNCL_GRAYSCALE) != CND_BJGRAYSCALE_GRAY ) { short gray_scale_value = IsGrayPrint(g_main_window)? CND_BJGRAYSCALE_ON : CND_BJGRAYSCALE_OFF; UpdateMenuLink(CNCL_GRAYSCALE, gray_scale_value); } #endif UpdateWidgets(window, "cartridge_type_combo"); } else { UpdateWidgets(window, NULL); } } else { UpdateMenuLink(CNCL_CARTRIDGE, new_cartridge_value); #ifdef NEED_TO_SAVE_GRAYSCALE if( GetCurrentnValue(CNCL_GRAYSCALE) != CND_BJGRAYSCALE_GRAY ) { short gray_scale_value = IsGrayPrint(g_main_window)? CND_BJGRAYSCALE_ON : CND_BJGRAYSCALE_OFF; UpdateMenuLink(CNCL_GRAYSCALE, gray_scale_value); } #endif UpdateWidgets(window, "cartridge_type_combo"); } #ifdef GUI_WITH_PIXMAPS UpdateDrawingArea(window, "basic_draw_area"); #endif g_cartridge_type_entry_changed = FALSE; }
UIMainDialog* CreateMainWindow() { short supply_value; short margin_value; UIMainDialog* main_window = (UIMainDialog*)CreateDialog(sizeof(UIMainDialog), NULL); #ifdef USE_LIB_GLADE UI_DIALOG(main_window)->window = LookupWidget(NULL, "ui_window"); #else UI_DIALOG(main_window)->window = create_ui_window(); #endif // Get initial paper size. main_window->init_paper_size = GetCurrentnValue(CNCL_PAPERSIZE); // Initialize auto color adjustment. main_window->color_auto = TRUE; // Initialize printing type, etc. main_window->printing_type = g_printing_type_value[0]; main_window->scaling = 100; main_window->centering = LOCATION_UPPERLEFT; main_window->ext_border = GetDefaultExtBorder(g_model_id); main_window->stapleside = STAPLESIDE_LONG; main_window->copies = 1; // Save current supply & margin value . supply_value = GetCurrentnValue(CNCL_MEDIASUPPLY); margin_value = GetCurrentnValue(CNCL_MARGINTYPE); // Store ASF supply value. UpdateMenuLink(CNCL_MEDIASUPPLY, CND_SUPPLY_ASF); // Save list. g_paper_size_list = GetComboList(CNCL_PAPERSIZE); // Store ASF supply value. UpdateMenuLink(CNCL_MARGINTYPE, CND_MARGIN_MINUS); // Save list. g_paper_size_margin_list = GetComboList(CNCL_PAPERSIZE); // Store current supply value. UpdateMenuLink(CNCL_MARGINTYPE, margin_value); UpdateMenuLink(CNCL_MEDIASUPPLY, supply_value); // Save current paper size value. g_paper_size_value = GetCurrentnValue(CNCL_PAPERSIZE); // Save current duplex printing g_duplex_value = GetCurrentnValue(CNCL_DUPLEX_PRINTING); return main_window; }
int InitDataBase(char* model_name) { if( model_name ) g_model_id = ModelNameToID(model_name); else g_model_id = ModelNameToID(PACKAGE_PRINTER_MODEL); g_bjlibdir = BJ_LIB_DIR; // Retrieve name information. if( CNCL_GetDBName(&g_uidb.nominfo, (void *)g_bjlibdir, g_model_id) < 0 ) { printf("Error: CNCL_GetDBName\n"); return -1; } // Obtain the size of Internal Database. g_uidb.dbsize = CNCL_GetDBSize(&g_uidb.nominfo, (void*)g_bjlibdir); // Allocate Internal DB Area. g_uidb.lpdbTop = (LPCNCLDB)g_malloc(sizeof(CNCLDB) * g_uidb.dbsize); g_uidb.ModelID = g_model_id; // Initialize database values with CNCL. CNCL_GetEntries(&g_uidb.nominfo, (void*)g_bjlibdir, g_uidb.lpdbTop); // Then get Defaults. CNCL_GetDefaults(&g_uidb.nominfo, (void*)g_bjlibdir, g_uidb.lpdbTop, g_uidb.dbsize); // At last, call MODESET. CNCL_InitMenulink(&g_uidb.nominfo, (void*)g_bjlibdir, g_uidb.lpdbTop, g_uidb.dbsize); // Get min and max paper size. CNCL_GetMargin(&g_uidb.nominfo, (void*)g_bjlibdir, g_uidb.lpdbTop, &g_bj_paper_size, g_uidb.dbsize); // If the default unit is "inch", change the media size to "letter". if( g_unit_inch == TRUE ) UpdateMenuLink(CNCL_PAPERSIZE, CND_SIZE_LETTER); else UpdateMenuLink(CNCL_PAPERSIZE, CND_SIZE_A4); // Set the user paper size into globals. InitUserPaperSize(); #ifdef DEBUG_DUMP_DATABASE DumpDataBase(-1); #endif return 0; }
void on_borderless_button_clicked (GtkButton *button, gpointer user_data) { if( DisableSignal() ) { GtkWidget* window = GetTopWidget(GTK_WIDGET(button)); if( GTK_TOGGLE_BUTTON(button)->active ) { short media_type_value = GetCurrentnValue(CNCL_MEDIATYPE); if( IsAvailableMediaBorder(g_mediaborder_dialog, media_type_value) ) { gchar* alert_msg = LookupText(g_keytext_list, "mediaborder_alert"); UtilMessageBox(alert_msg, g_window_title, MB_OK | MB_ICON_INFORMATION); UpdateMenuLink(CNCL_MARGINTYPE, CND_MARGIN_MINUS); } else { short new_media_type_value; if( (new_media_type_value = ShowMediaBorderDialog(g_mediaborder_dialog, media_type_value)) != -1 ) { UpdateMenuLink(CNCL_MEDIATYPE, new_media_type_value); UpdateMenuLink(CNCL_MARGINTYPE, CND_MARGIN_MINUS); } else { gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(button), FALSE); } } } else { UpdateMenuLink(CNCL_MARGINTYPE, CND_MARGIN_NORMAL); } UpdateWidgets(window, "borderless_button"); #ifdef GUI_WITH_PIXMAPS UpdateDrawingArea(window, "basic_draw_area"); #endif } EnableSignal(); }
void HideQualityDialog(UIQualityDialog* dialog, gboolean apply) { if( !apply ) { // Recover parameters. UpdateMenuLink(CNCL_PRINTQUALITY, dialog->print_quality); UpdateMenuLink(CNCL_DITHER_PAT, dialog->bin_method); } else SetQualityCustomValue(dialog); HideDialog((UIDialog*)dialog); }
void on_print_bw_button_clicked (GtkButton *button, gpointer user_data) { if( DisableSignal() ) { GtkWidget* window = GetTopWidget(GTK_WIDGET(button)); short value; if( IsGrayPrint(g_main_window) ) value = CND_BJGRAYSCALE_ON; else value = CND_BJGRAYSCALE_OFF; UpdateMenuLink(CNCL_GRAYSCALE, value); UpdateWidgets(window, "print_bw_button"); #ifdef GUI_WITH_PIXMAPS UpdateDrawingArea(window, "basic_draw_area"); UpdateDrawingArea(window, "quality_draw_area"); #endif } EnableSignal(); }
static void update_by_media_type_entry() { GtkWidget* window = UI_DIALOG(g_main_window)->window; GtkWidget* entry = LookupWidget(window, "media_type_entry"); short type_value = NameToValue(CNCL_MEDIATYPE, (char*)gtk_entry_get_text(GTK_ENTRY(entry))); // Save current supply value. short supply_value = GetCurrentnValue(CNCL_MEDIASUPPLY); UpdateMenuLink(CNCL_MEDIATYPE, type_value); // If changed the supply value, show the alert. if( supply_value != GetCurrentnValue(CNCL_MEDIASUPPLY) ) { confirm_media_supply_change(supply_value); } UpdateWidgets(window, "media_type_combo"); #ifdef GUI_WITH_PIXMAPS UpdateDrawingArea(window, "basic_draw_area"); #endif g_media_type_entry_changed = FALSE; }
void on_default_button_clicked (GtkButton *button, gpointer user_data) { short paper_size_value = GetCurrentnValue(CNCL_PAPERSIZE); short margin_type_value = GetCurrentnValue(CNCL_MARGINTYPE); FreeDataBase(); InitDataBase(g_model_name); // Initialize the print quality toggle button. gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(LookupWidget(UI_DIALOG(g_main_window)->window, "quality_standard_button")), TRUE); SetQualityCustomValue(g_quality_dialog); // Initialize the color adjustment toggle button. gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(LookupWidget(UI_DIALOG(g_main_window)->window, "color_auto_button")), TRUE); // Initialize the print bw toggle button. gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(LookupWidget(UI_DIALOG(g_main_window)->window, "print_bw_button1")), FALSE); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(LookupWidget(UI_DIALOG(g_main_window)->window, "print_bw_button2")), FALSE); // Re-create the color adjustment dialog. g_color_dialog = ReCreateColorDialog( g_color_dialog, UI_DIALOG(g_main_window)); // Restore paper size and margin type. UpdateMenuLink(CNCL_PAPERSIZE, paper_size_value); UpdateMenuLink(CNCL_MARGINTYPE, margin_type_value); // Update widgets. DisableSignal(); UpdateWidgets(UI_DIALOG(g_main_window)->window, NULL); EnableSignal(); // Update all of window UpdateDialog(UI_DIALOG(g_main_window), NULL); }
void on_color_dialog_gamma_entry_changed (GtkEditable *editable, gpointer user_data) { short gamma = NameToValue(CNCL_INPUT_GAMMA, (char*)gtk_entry_get_text(GTK_ENTRY(editable))); UpdateMenuLink(CNCL_INPUT_GAMMA, gamma); }
static short SetGammaCombo(UIColorDialog2* dialog, short gamma) { if( gamma != GetCurrentnValue(CNCL_INPUT_GAMMA) ) UpdateMenuLink(CNCL_INPUT_GAMMA, gamma); /* Ver.2.80 */ SetItemsToComboBox( UI_DIALOG(dialog)->window, "color_dialog_gamma_combo2", CNCL_INPUT_GAMMA, gamma ); return gamma; }
/* for CND_FORMATTYPE_6 or above */ static short SetColorCorrectCombo2(UIColorDialog2* dialog , short intent) { if( intent != GetCurrentnValue(CNCL_INTENT) ) UpdateMenuLink(CNCL_INTENT, intent); /* Ver.2.80 */ dialog->intent_num = SetItemsToComboBox( UI_DIALOG(dialog)->window, "color_dialog_correct_combo2", CNCL_INTENT, intent ); return intent; }
void on_quality_button_clicked (GtkButton *button, gpointer user_data) { if( DisableSignal() ) { GtkWidget* window = GetTopWidget(GTK_WIDGET(button)); int quality = g_mess_map[GetActiveButtonIndex(window, g_quality_button_name,0)]; switch( quality ) { case CNCL_MESS_Q_MAP1: case CNCL_MESS_Q_MAP2: case CNCL_MESS_Q_MAP3: { UpdateMenuLink(CNCL_PRINTQUALITY, GetCurrentnValue(quality)); UpdateMenuLink(CNCL_DITHER_PAT, CND_UIBIN_ED); break; } default: { UpdateMenuLink(CNCL_PRINTQUALITY, g_quality_dialog->print_quality); UpdateMenuLink(CNCL_DITHER_PAT, g_quality_dialog->bin_method); break; } } UpdateWidgets(window, "quality_buttons"); #ifdef GUI_WITH_PIXMAPS UpdateDrawingArea(window, "quality_draw_area"); #endif } EnableSignal(); }
void on_quality_dialog_ht_button_toggled (GtkToggleButton *togglebutton, gpointer user_data) { if( DisableSignal() ) { GtkWidget* window = GetTopWidget(GTK_WIDGET(togglebutton)); int bin_method = GetActiveButtonIndex(window, bin_method_button_name,0); UpdateMenuLink(CNCL_DITHER_PAT, bin_method_button_value[bin_method]); UpdateQualityDialogWidgets(window, "quality_ht_button"); } EnableSignal(); }
static void update_by_paper_gap_entry() { GtkWidget* window = UI_DIALOG(g_main_window)->window; GtkWidget* entry = LookupWidget(window, "paper_gap_entry"); short value = NameToValue(CNCL_PAPERGAP_COMMAND, (char*)gtk_entry_get_text(GTK_ENTRY(entry))); UpdateMenuLink(CNCL_PAPERGAP_COMMAND, value); UpdateWidgets(window, "paper_gap_combo"); #ifdef GUI_WITH_PIXMAPS UpdateDrawingArea(window, "basic_draw_area"); #endif g_paper_gap_entry_changed = FALSE; }
static void update_by_media_supply_entry() { GtkWidget* window = UI_DIALOG(g_main_window)->window; GtkWidget* entry = LookupWidget(window, "media_supply_entry"); short value = NameToValue(CNCL_MEDIASUPPLY, (char*)gtk_entry_get_text(GTK_ENTRY(entry))); UpdateMenuLink(CNCL_MEDIASUPPLY, value); UpdateWidgets(window, "media_supply_combo"); #ifdef GUI_WITH_PIXMAPS UpdateDrawingArea(window, "basic_draw_area"); #endif g_media_supply_entry_changed = FALSE; }
static void confirm_media_supply_change(short old_supply_value) { int ret; gchar* alert_msg = LookupText(g_keytext_list, "paper_supply_change_alert"); gchar* supply_str = GetCurrentString(CNCL_MEDIASUPPLY); gchar* message = (gchar*)g_malloc(strlen(alert_msg) + strlen(supply_str)); sprintf(message, alert_msg, supply_str); ret = UtilMessageBox(message, g_window_title, MB_OK | MB_CANCEL | MB_ICON_INFORMATION); g_free(message); if( ret == ID_CANCEL ) { UpdateMenuLink(CNCL_MEDIASUPPLY, old_supply_value); } }
/* OK button */ void on_setconfig_type003_button1_clicked (GtkButton *button, gpointer user_data) { LPSETCONFIGCOMPTYPE003WORK lpWk = (LPSETCONFIGCOMPTYPE003WORK)gLPSetConfigWork; GtkWidget *combo; char *type; int index_num = lpWk->lpInkCartridgeMsgInfo->index_num; int currentIndex; combo = LookupWidget(GTK_WIDGET(button), "setconfig_type003_combobox1"); type = (char*)gtk_combo_box_get_active_text( GTK_COMBO_BOX(combo) ); /* Ver.2.80 */ currentIndex = KeyToIndex(lpWk->lpInkCartridgeMsgInfo->type, index_num, type ); gtk_widget_destroy(gtk_widget_get_toplevel(GTK_WIDGET(button))); /* update database */ UpdateMenuLink(CNCL_INKCARTRIDGESETTINGS, lpWk->lpInkCartridgeMsgInfo->nValue[currentIndex]); lpWk->status = US_OK; }
static void update_by_media_size_entry() { GtkWidget* window = UI_DIALOG(g_main_window)->window; GtkWidget* entry = LookupWidget(window, "media_size_entry"); short value = NameToValue(CNCL_PAPERSIZE, (char*)gtk_entry_get_text(GTK_ENTRY(entry))); UpdateMenuLink(CNCL_PAPERSIZE, value); if( CND_SIZE_USER == GetCurrentnValue(CNCL_PAPERSIZE) ) { set_user_paper_size(); } UpdateWidgets(window, "media_size_combo"); #ifdef GUI_WITH_PIXMAPS UpdateDrawingArea(window, "basic_draw_area"); #endif g_media_size_entry_changed = FALSE; }
void HideColorDialog(UIColorDialog* dialog, gboolean apply) { if( apply ) { dialog->cyan_balance = (int)dialog->cyan_adjust->value; dialog->magenta_balance = (int)dialog->magenta_adjust->value; dialog->yellow_balance = (int)dialog->yellow_adjust->value; dialog->black_balance = (int)dialog->black_adjust->value; dialog->density_balance = (int)dialog->density_adjust->value; dialog->vivid = GTK_TOGGLE_BUTTON(LookupWidget(UI_DIALOG(dialog)->window, "color_dialog_vivid_button"))->active; dialog->color_correct = GetColorCorrectCombo(dialog); if( dialog->gamma_list == NULL ) { dialog->gamma = GetTextArrayValueFromCombo(UI_DIALOG(dialog)->window, "color_dialog_gamma_combo", gamma_key, gamma_value); } else { dialog->gamma = GetCurrentnValue(CNCL_INPUT_GAMMA); } } else { if( dialog->gamma_list ) { // Recover parameters. UpdateMenuLink(CNCL_INPUT_GAMMA, dialog->gamma); } } HideDialog((UIDialog*)dialog); }
static short SetGammaCombo(UIColorDialog* dialog, short gamma) { dialog->gamma_list = GetComboList(CNCL_INPUT_GAMMA); if( dialog->gamma_list ) { gchar* name; if( gamma != GetCurrentnValue(CNCL_INPUT_GAMMA) ) UpdateMenuLink(CNCL_INPUT_GAMMA, gamma); name = ValueToName(CNCL_INPUT_GAMMA, gamma); SetGListToCombo(UI_DIALOG(dialog)->window, "color_dialog_gamma_combo", dialog->gamma_list, name); } else { SetTextArrayToCombo(UI_DIALOG(dialog)->window, "color_dialog_gamma_combo", gamma_key, gamma_value, gamma); } return gamma; }
gboolean CheckMediaSizeCombination(LPBJFLTDEVICE bjdev, gboolean* change_item) { MediaSizeTable* table = GetMediaSizeTable(bjdev->bjfltModelID); char* media = ValueToKey(CNCL_MEDIATYPE, bjdev->bjfltMediaType); char* size = ValueToKey(CNCL_PAPERSIZE, bjdev->bjfltPaperSize); int change; gboolean exec_print; int result = TRUE; gchar* applied = NULL; gchar* applied_title = NULL; GtkWidget *window = UI_DIALOG(g_main_window)->window; *change_item = FALSE; if( table == NULL ) return TRUE; while( table->base != NULL ) { if( !strcmp(media, table->base) ) { // Get available media size. applied = GetAvailableSize(table->applied); if( SearchWord(size, applied) == NULL ) { applied_title = GetAvailableSize(table->applied_title); change = UI_MEDIASIZE_CHANGE_SIZE; break; } } else if( !strcmp(size, table->base) ) { // Get available media type. applied = GetAvailableMedia(table->applied); if( SearchWord(media, applied) == NULL ) { applied_title = GetAvailableMedia(table->applied_title); change = UI_MEDIASIZE_CHANGE_MEDIA; break; } } table++; } if( table->base ) { UIMediaSizeDialog* dialog = NULL; int (*show_dialog)(UIMediaSizeDialog*, gchar*) = NULL; switch( table->type ) { case UI_MEDIASIZE_ILLEGAL: if( 1 >= CountWords(applied) ) { dialog = g_mediasize_illegal_dialog; show_dialog = ShowMediaSizeIllegalDialog; } else { dialog = g_mediasize_illegal_select_dialog; show_dialog = ShowMediaSizeIllegalSelectDialog; } break; case UI_MEDIASIZE_RECOMMEND: dialog = g_mediasize_recommend_dialog; show_dialog = ShowMediaSizeRecommendDialog; break; } // Show the dialog when the number of applied item is more than 1. if( dialog && strlen(applied) > 0 ) { dialog->media = media; dialog->size = size; dialog->table = (void*)table; dialog->change = change; // Show dialog. exec_print = show_dialog(dialog, applied_title); if( dialog->apply ) { GtkWidget* analyzer_combo = NULL; char *change_to_value_str = NULL; short change_to_id; if( dialog->item_count > 1 ) /* multiple items -> get value id of chenge item */ { /* Ver.3.20 */ if( table->type == UI_MEDIASIZE_RECOMMEND ) /* recommend */ analyzer_combo = LookupWidget(UI_DIALOG(dialog)->window, "mediasize_recommend_combo"); else /* illegal */ analyzer_combo = LookupWidget(UI_DIALOG(dialog)->window, "mediasize_illegal_combo"); change_to_value_str = (char*)gtk_combo_box_get_active_text(GTK_COMBO_BOX(analyzer_combo)); if( dialog->change == UI_MEDIASIZE_CHANGE_SIZE ) /* change size */ change_to_id = NameToValue( CNCL_PAPERSIZE , change_to_value_str ); else /* change media */ change_to_id = NameToValue( CNCL_MEDIATYPE , change_to_value_str ); dialog->current_change_to_id = change_to_id; if(change_to_value_str){ free(change_to_value_str); change_to_value_str = NULL; } } if( dialog->change == UI_MEDIASIZE_CHANGE_SIZE ) { UpdateMenuLink(CNCL_PAPERSIZE, dialog->current_change_to_id); DisableSignal(); UpdateWidgets(window, NULL); EnableSignal(); } else { // Save current supply value. short supply_value = GetCurrentnValue(CNCL_MEDIASUPPLY); // Change the media type. UpdateMenuLink(CNCL_MEDIATYPE, dialog->current_change_to_id); DisableSignal(); UpdateWidgets(window, NULL); EnableSignal(); if( supply_value != GetCurrentnValue(CNCL_MEDIASUPPLY) ) { // If no supply value for the current media type, // Some alert should be shown. // Only restore the saved supply value in this version. //UpdateMenuLink(CNCL_MEDIASUPPLY, supply_value); } } *change_item = TRUE; } result = exec_print; } } if( applied ) g_free(applied); if( applied_title ) g_free(applied_title); /* Ver.3.00 */ return result; }