Commit 58993b429b5fe0ff257acc2d4e352ef07536b6f5
1 parent
32cb28e1
Exists in
master
and in
1 other branch
Print dialog updated.
Showing
3 changed files
with
20 additions
and
8 deletions
Show diff stats
src/dialogs/print/draw.c
src/dialogs/print/print.c
... | ... | @@ -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 | 64 | GValue value = { 0, }; |
65 | 65 | GtkTreeIter iter; |
... | ... | @@ -75,6 +75,11 @@ |
75 | 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 | 83 | static GtkWidget * create_custom_widget(GtkPrintOperation *prt) |
79 | 84 | { |
80 | 85 | static const gchar * text[] = |
... | ... | @@ -95,6 +100,7 @@ |
95 | 100 | GtkGrid * grid = GTK_GRID(gtk_grid_new()); |
96 | 101 | GtkWidget * font = v3270_font_selection_new(operation->font.name); |
97 | 102 | GtkWidget * color = v3270_color_scheme_new(); |
103 | + GtkWidget * selected = gtk_check_button_new_with_label( _("Print selection box") ); | |
98 | 104 | |
99 | 105 | gtk_container_set_border_width(GTK_CONTAINER(grid),10); |
100 | 106 | gtk_grid_set_row_spacing(grid,5); |
... | ... | @@ -103,6 +109,8 @@ |
103 | 109 | v3270_color_scheme_set_rgba(color,operation->colors); |
104 | 110 | g_signal_connect(G_OBJECT(color),"update-colors",G_CALLBACK(color_scheme_changed),operation); |
105 | 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 | 115 | for(f=0;f<G_N_ELEMENTS(text);f++) |
108 | 116 | { |
... | ... | @@ -113,6 +121,7 @@ |
113 | 121 | |
114 | 122 | gtk_grid_attach(grid,font,1,0,1,1); |
115 | 123 | gtk_grid_attach(grid,color,1,1,1,1); |
124 | + gtk_grid_attach(grid,selected,1,2,1,1); | |
116 | 125 | |
117 | 126 | gtk_widget_show_all(GTK_WIDGET(grid)); |
118 | 127 | return GTK_WIDGET(grid); |
... | ... | @@ -128,6 +137,7 @@ |
128 | 137 | g_signal_emit(operation->widget, v3270_widget_signal[SIGNAL_PRINT_APPLY], 0, prt); |
129 | 138 | |
130 | 139 | } |
140 | + | |
131 | 141 | #endif // _WIN32 |
132 | 142 | |
133 | 143 | static void dispose(GObject *object) | ... | ... |
src/dialogs/print/private.h
... | ... | @@ -54,14 +54,15 @@ |
54 | 54 | v3270 * widget; |
55 | 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 | 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 | 66 | } contents; |
66 | 67 | |
67 | 68 | struct |
... | ... | @@ -70,8 +71,6 @@ |
70 | 71 | v3270FontInfo info; |
71 | 72 | } font; |
72 | 73 | |
73 | - gboolean show_selection; | |
74 | - | |
75 | 74 | }; |
76 | 75 | |
77 | 76 | /*--[ Prototypes ]-----------------------------------------------------------------------------------*/ | ... | ... |