diff --git a/src/dialogs/print/draw.c b/src/dialogs/print/draw.c index 8f4e9b5..dd0239c 100644 --- a/src/dialogs/print/draw.c +++ b/src/dialogs/print/draw.c @@ -83,6 +83,9 @@ if(columns[col].c) { // Draw character + if(!operation->show_selection) + columns[col].attr &= ~LIB3270_ATTR_SELECTED; + v3270_draw_element( cr, columns[col].c, diff --git a/src/dialogs/print/print.c b/src/dialogs/print/print.c index 52a03cc..e7a7503 100644 --- a/src/dialogs/print/print.c +++ b/src/dialogs/print/print.c @@ -59,7 +59,7 @@ } - void font_name_changed(GtkComboBox *widget, V3270PrintOperation *operation) + static void font_name_changed(GtkComboBox *widget, V3270PrintOperation *operation) { GValue value = { 0, }; GtkTreeIter iter; @@ -75,6 +75,11 @@ debug("%s=%s",__FUNCTION__,operation->font.name); } + static void toggle_show_selection(GtkToggleButton *widget, V3270PrintOperation *operation) + { + operation->show_selection = gtk_toggle_button_get_active(widget); + } + static GtkWidget * create_custom_widget(GtkPrintOperation *prt) { static const gchar * text[] = @@ -95,6 +100,7 @@ GtkGrid * grid = GTK_GRID(gtk_grid_new()); GtkWidget * font = v3270_font_selection_new(operation->font.name); GtkWidget * color = v3270_color_scheme_new(); + GtkWidget * selected = gtk_check_button_new_with_label( _("Print selection box") ); gtk_container_set_border_width(GTK_CONTAINER(grid),10); gtk_grid_set_row_spacing(grid,5); @@ -103,6 +109,8 @@ v3270_color_scheme_set_rgba(color,operation->colors); g_signal_connect(G_OBJECT(color),"update-colors",G_CALLBACK(color_scheme_changed),operation); g_signal_connect(G_OBJECT(font),"changed",G_CALLBACK(font_name_changed),operation); + g_signal_connect(G_OBJECT(selected),"toggled",G_CALLBACK(toggle_show_selection),operation); + for(f=0;fwidget, v3270_widget_signal[SIGNAL_PRINT_APPLY], 0, prt); } + #endif // _WIN32 static void dispose(GObject *object) diff --git a/src/dialogs/print/private.h b/src/dialogs/print/private.h index 23ef8c3..8c82ab6 100644 --- a/src/dialogs/print/private.h +++ b/src/dialogs/print/private.h @@ -54,14 +54,15 @@ v3270 * widget; H3270 * session; - size_t lpp; ///< @brief Lines per page (in rows). - size_t pages; ///< @brief Number of pages. + size_t lpp; ///< @brief Lines per page (in rows). + size_t pages; ///< @brief Number of pages. + gboolean show_selection; ///< @brief Print selection box? struct { - size_t width; ///< @brief Width of the contents (in columns); - size_t height; ///< @brief Height of the contents (in rows); - column **text; ///< @brief Report contents. + size_t width; ///< @brief Width of the contents (in columns); + size_t height; ///< @brief Height of the contents (in rows); + column **text; ///< @brief Report contents. } contents; struct @@ -70,8 +71,6 @@ v3270FontInfo info; } font; - gboolean show_selection; - }; /*--[ Prototypes ]-----------------------------------------------------------------------------------*/ -- libgit2 0.21.2