Commit 58993b429b5fe0ff257acc2d4e352ef07536b6f5

Authored by Perry Werneck
1 parent 32cb28e1
Exists in master and in 1 other branch develop

Print dialog updated.

src/dialogs/print/draw.c
@@ -83,6 +83,9 @@ @@ -83,6 +83,9 @@
83 if(columns[col].c) 83 if(columns[col].c)
84 { 84 {
85 // Draw character 85 // Draw character
  86 + if(!operation->show_selection)
  87 + columns[col].attr &= ~LIB3270_ATTR_SELECTED;
  88 +
86 v3270_draw_element( 89 v3270_draw_element(
87 cr, 90 cr,
88 columns[col].c, 91 columns[col].c,
src/dialogs/print/print.c
@@ -59,7 +59,7 @@ @@ -59,7 +59,7 @@
59 59
60 } 60 }
61 61
62 - void font_name_changed(GtkComboBox *widget, V3270PrintOperation *operation) 62 + static void font_name_changed(GtkComboBox *widget, V3270PrintOperation *operation)
63 { 63 {
64 GValue value = { 0, }; 64 GValue value = { 0, };
65 GtkTreeIter iter; 65 GtkTreeIter iter;
@@ -75,6 +75,11 @@ @@ -75,6 +75,11 @@
75 debug("%s=%s",__FUNCTION__,operation->font.name); 75 debug("%s=%s",__FUNCTION__,operation->font.name);
76 } 76 }
77 77
  78 + static void toggle_show_selection(GtkToggleButton *widget, V3270PrintOperation *operation)
  79 + {
  80 + operation->show_selection = gtk_toggle_button_get_active(widget);
  81 + }
  82 +
78 static GtkWidget * create_custom_widget(GtkPrintOperation *prt) 83 static GtkWidget * create_custom_widget(GtkPrintOperation *prt)
79 { 84 {
80 static const gchar * text[] = 85 static const gchar * text[] =
@@ -95,6 +100,7 @@ @@ -95,6 +100,7 @@
95 GtkGrid * grid = GTK_GRID(gtk_grid_new()); 100 GtkGrid * grid = GTK_GRID(gtk_grid_new());
96 GtkWidget * font = v3270_font_selection_new(operation->font.name); 101 GtkWidget * font = v3270_font_selection_new(operation->font.name);
97 GtkWidget * color = v3270_color_scheme_new(); 102 GtkWidget * color = v3270_color_scheme_new();
  103 + GtkWidget * selected = gtk_check_button_new_with_label( _("Print selection box") );
98 104
99 gtk_container_set_border_width(GTK_CONTAINER(grid),10); 105 gtk_container_set_border_width(GTK_CONTAINER(grid),10);
100 gtk_grid_set_row_spacing(grid,5); 106 gtk_grid_set_row_spacing(grid,5);
@@ -103,6 +109,8 @@ @@ -103,6 +109,8 @@
103 v3270_color_scheme_set_rgba(color,operation->colors); 109 v3270_color_scheme_set_rgba(color,operation->colors);
104 g_signal_connect(G_OBJECT(color),"update-colors",G_CALLBACK(color_scheme_changed),operation); 110 g_signal_connect(G_OBJECT(color),"update-colors",G_CALLBACK(color_scheme_changed),operation);
105 g_signal_connect(G_OBJECT(font),"changed",G_CALLBACK(font_name_changed),operation); 111 g_signal_connect(G_OBJECT(font),"changed",G_CALLBACK(font_name_changed),operation);
  112 + g_signal_connect(G_OBJECT(selected),"toggled",G_CALLBACK(toggle_show_selection),operation);
  113 +
106 114
107 for(f=0;f<G_N_ELEMENTS(text);f++) 115 for(f=0;f<G_N_ELEMENTS(text);f++)
108 { 116 {
@@ -113,6 +121,7 @@ @@ -113,6 +121,7 @@
113 121
114 gtk_grid_attach(grid,font,1,0,1,1); 122 gtk_grid_attach(grid,font,1,0,1,1);
115 gtk_grid_attach(grid,color,1,1,1,1); 123 gtk_grid_attach(grid,color,1,1,1,1);
  124 + gtk_grid_attach(grid,selected,1,2,1,1);
116 125
117 gtk_widget_show_all(GTK_WIDGET(grid)); 126 gtk_widget_show_all(GTK_WIDGET(grid));
118 return GTK_WIDGET(grid); 127 return GTK_WIDGET(grid);
@@ -128,6 +137,7 @@ @@ -128,6 +137,7 @@
128 g_signal_emit(operation->widget, v3270_widget_signal[SIGNAL_PRINT_APPLY], 0, prt); 137 g_signal_emit(operation->widget, v3270_widget_signal[SIGNAL_PRINT_APPLY], 0, prt);
129 138
130 } 139 }
  140 +
131 #endif // _WIN32 141 #endif // _WIN32
132 142
133 static void dispose(GObject *object) 143 static void dispose(GObject *object)
src/dialogs/print/private.h
@@ -54,14 +54,15 @@ @@ -54,14 +54,15 @@
54 v3270 * widget; 54 v3270 * widget;
55 H3270 * session; 55 H3270 * session;
56 56
57 - size_t lpp; ///< @brief Lines per page (in rows).  
58 - size_t pages; ///< @brief Number of pages. 57 + size_t lpp; ///< @brief Lines per page (in rows).
  58 + size_t pages; ///< @brief Number of pages.
  59 + gboolean show_selection; ///< @brief Print selection box?
59 60
60 struct 61 struct
61 { 62 {
62 - size_t width; ///< @brief Width of the contents (in columns);  
63 - size_t height; ///< @brief Height of the contents (in rows);  
64 - column **text; ///< @brief Report contents. 63 + size_t width; ///< @brief Width of the contents (in columns);
  64 + size_t height; ///< @brief Height of the contents (in rows);
  65 + column **text; ///< @brief Report contents.
65 } contents; 66 } contents;
66 67
67 struct 68 struct
@@ -70,8 +71,6 @@ @@ -70,8 +71,6 @@
70 v3270FontInfo info; 71 v3270FontInfo info;
71 } font; 72 } font;
72 73
73 - gboolean show_selection;  
74 -  
75 }; 74 };
76 75
77 /*--[ Prototypes ]-----------------------------------------------------------------------------------*/ 76 /*--[ Prototypes ]-----------------------------------------------------------------------------------*/