mcc2 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data/.autotest +23 -0
- data/.gitignore +15 -0
- data/.rubocop.yml +3 -0
- data/Gemfile +13 -0
- data/History.txt +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +51 -0
- data/Rakefile +12 -0
- data/config/i18n-tasks.yml +193 -0
- data/exe/mcc2 +18 -0
- data/exe/mcc2-generate-preview +17 -0
- data/exe/mcc2print +6 -0
- data/lib/libguib16.rb +1620 -0
- data/lib/mcc2/advanced_data_edit_dlg.rb +139 -0
- data/lib/mcc2/cc_dialogbox.rb +52 -0
- data/lib/mcc2/constants.rb +154 -0
- data/lib/mcc2/dataman/base.rb +61 -0
- data/lib/mcc2/dataman/csv.rb +49 -0
- data/lib/mcc2/dataman/database.rb +8 -0
- data/lib/mcc2/dataman/dbf.rb +45 -0
- data/lib/mcc2/dataman/none.rb +25 -0
- data/lib/mcc2/dataview.rb +348 -0
- data/lib/mcc2/dataview_dlg.rb +232 -0
- data/lib/mcc2/debug_tools.rb +20 -0
- data/lib/mcc2/fx_colored_item.rb +101 -0
- data/lib/mcc2/generate_preview.rb +68 -0
- data/lib/mcc2/gui/advanced_data_edit_dlg.rbin +0 -0
- data/lib/mcc2/gui/dataview_dlg.pp +522 -0
- data/lib/mcc2/gui/layoutview_dlg.pp +5115 -0
- data/lib/mcc2/gui/mcc2_mainwin.pp +838 -0
- data/lib/mcc2/gui/picture_data_edit_dlg.rbin +0 -0
- data/lib/mcc2/gui/printerview_dlg.pp +3311 -0
- data/lib/mcc2/images/Image-Arrow-Left.gif +0 -0
- data/lib/mcc2/images/Image-Arrow-Right.gif +0 -0
- data/lib/mcc2/images/Image-FastArrowLeft.gif +0 -0
- data/lib/mcc2/images/Image-FastArrowRight.bmp +0 -0
- data/lib/mcc2/images/Image-FastArrowRight.gif +0 -0
- data/lib/mcc2/images/application-exit.png +0 -0
- data/lib/mcc2/images/copy.png +0 -0
- data/lib/mcc2/images/country_de.png +0 -0
- data/lib/mcc2/images/country_gb.png +0 -0
- data/lib/mcc2/images/country_rs.png +0 -0
- data/lib/mcc2/images/cut.png +0 -0
- data/lib/mcc2/images/distribute-horizontal-baseline.png +0 -0
- data/lib/mcc2/images/distribute-vertical-baseline.png +0 -0
- data/lib/mcc2/images/document-close.png +0 -0
- data/lib/mcc2/images/document-edit.png +0 -0
- data/lib/mcc2/images/document-new.png +0 -0
- data/lib/mcc2/images/document-open.png +0 -0
- data/lib/mcc2/images/document-print-frame.png +0 -0
- data/lib/mcc2/images/document-print.png +0 -0
- data/lib/mcc2/images/document-save-as.png +0 -0
- data/lib/mcc2/images/document-save.png +0 -0
- data/lib/mcc2/images/documentation.png +0 -0
- data/lib/mcc2/images/draw-rectangle.png +0 -0
- data/lib/mcc2/images/dummy.gif +0 -0
- data/lib/mcc2/images/exchange-positions.png +0 -0
- data/lib/mcc2/images/insert-image.png +0 -0
- data/lib/mcc2/images/insert-text.png +0 -0
- data/lib/mcc2/images/libreoffice-oasis-master-document.png +0 -0
- data/lib/mcc2/images/measure.png +0 -0
- data/lib/mcc2/images/messagebox_warning.png +0 -0
- data/lib/mcc2/images/paste.png +0 -0
- data/lib/mcc2/images/process-stop.png +0 -0
- data/lib/mcc2/images/zoom-in.png +0 -0
- data/lib/mcc2/layout.rb +323 -0
- data/lib/mcc2/layout_file.rb +794 -0
- data/lib/mcc2/layout_object/barcode.rb +33 -0
- data/lib/mcc2/layout_object/box.rb +18 -0
- data/lib/mcc2/layout_object/chip.rb +54 -0
- data/lib/mcc2/layout_object/embed.rb +16 -0
- data/lib/mcc2/layout_object/go_attribut.rb +16 -0
- data/lib/mcc2/layout_object/graphic.rb +59 -0
- data/lib/mcc2/layout_object/magstripe.rb +13 -0
- data/lib/mcc2/layout_object/picture.rb +22 -0
- data/lib/mcc2/layout_object/text.rb +29 -0
- data/lib/mcc2/layout_win.rb +2052 -0
- data/lib/mcc2/layoutview.rb +845 -0
- data/lib/mcc2/layoutview_dlg.rb +2058 -0
- data/lib/mcc2/locales.rb +27 -0
- data/lib/mcc2/mcc2_mainwin.rb +453 -0
- data/lib/mcc2/mcc2gui.rb +295 -0
- data/lib/mcc2/mcc2print.rb +54 -0
- data/lib/mcc2/picture_data_edit_dlg.rb +139 -0
- data/lib/mcc2/print_dlg.rb +520 -0
- data/lib/mcc2/printer/base.rb +148 -0
- data/lib/mcc2/printer/card_printer.rb +45 -0
- data/lib/mcc2/printer/file_printer.rb +135 -0
- data/lib/mcc2/printer/gdi_card_printer.rb +14 -0
- data/lib/mcc2/printer/gdi_printer.rb +197 -0
- data/lib/mcc2/printer/linux_cups_printer.rb +92 -0
- data/lib/mcc2/printer/preview.rb +277 -0
- data/lib/mcc2/printer/printer_cab.rb +118 -0
- data/lib/mcc2/printer/printer_cx320_direct.rb +286 -0
- data/lib/mcc2/printer/printer_epl.rb +118 -0
- data/lib/mcc2/printer/printer_ttp34x.rb +124 -0
- data/lib/mcc2/printer/printer_zebra.rb +324 -0
- data/lib/mcc2/printer/svg_drawer.rb +689 -0
- data/lib/mcc2/printerview.rb +604 -0
- data/lib/mcc2/printerview_dlg.rb +1248 -0
- data/lib/mcc2/version.rb +3 -0
- data/lib/mcc2.rb +11 -0
- data/locales/de.yml +6 -0
- data/locales/en.yml +502 -0
- data/locales/rs.yml +502 -0
- data/mcc2.gemspec +41 -0
- data/test/dummy.rb +19 -0
- data/test/layouts/bart_simpson.png +0 -0
- data/test/layouts/color_test.xml +151 -0
- data/test/layouts/ms.xml +67 -0
- data/test/ruby_print.rb +380 -0
- data/test/test.csv +4 -0
- data/test/test.dbf +0 -0
- data/test/test.str +4 -0
- data/test/test_mcc2.rb +8 -0
- data.tar.gz.sig +6 -0
- metadata +421 -0
- metadata.gz.sig +0 -0
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
module Mcc2
|
|
2
|
+
require "mcc2/dataview_dlg"
|
|
3
|
+
|
|
4
|
+
class Dataview < Dialogbox_dataview
|
|
5
|
+
include Fox
|
|
6
|
+
|
|
7
|
+
def initialize parent, layout
|
|
8
|
+
@layout = layout
|
|
9
|
+
@parent = parent
|
|
10
|
+
|
|
11
|
+
super(parent)
|
|
12
|
+
@splitter_dataview.reparent parent, nil
|
|
13
|
+
@dialogbox_dataview.close
|
|
14
|
+
|
|
15
|
+
@search_pos = 0
|
|
16
|
+
@visible = false
|
|
17
|
+
|
|
18
|
+
# .............................................................................................
|
|
19
|
+
# alle Aktionen definieren
|
|
20
|
+
|
|
21
|
+
@textfield_datasource.connect(SEL_COMMAND) do
|
|
22
|
+
@layout_file.set_attr_value(S_DATASOURCE, @textfield_datasource.text)
|
|
23
|
+
changed_attributes
|
|
24
|
+
end
|
|
25
|
+
# Button für das Auswählen einer Datenquelle an Textfeld knüpfen
|
|
26
|
+
@layout.connect_filebutton_to_textfield(@button_datasource, @textfield_datasource,
|
|
27
|
+
filepatterns: ["Semicolon seperated file (*.csv,*.dbf)", "All Files (*)"])
|
|
28
|
+
|
|
29
|
+
@button_select_all.connect(SEL_COMMAND) { select_all }
|
|
30
|
+
@button_deselect_all.connect(SEL_COMMAND) { deselect_all }
|
|
31
|
+
@button_print_selected.connect(SEL_COMMAND) { print_selected }
|
|
32
|
+
@textfield_search.connect(SEL_COMMAND) {
|
|
33
|
+
search
|
|
34
|
+
@textfield_search.setFocus
|
|
35
|
+
}
|
|
36
|
+
@button_print_all.connect(SEL_COMMAND) { print_all }
|
|
37
|
+
@button_stop_printing.connect(SEL_COMMAND) { stop_printing }
|
|
38
|
+
@iconlist_data.connect(SEL_CHANGED) { update_preview }
|
|
39
|
+
@iconlist_data.connect(SEL_SELECTED) { print_list_selection_changed }
|
|
40
|
+
@iconlist_data.connect(SEL_DESELECTED) { print_list_deselected }
|
|
41
|
+
# .............................................................................................
|
|
42
|
+
@printing = false
|
|
43
|
+
disable_all_buttons
|
|
44
|
+
@button_print_all.enabled = true
|
|
45
|
+
@button_select_all.enabled = true
|
|
46
|
+
|
|
47
|
+
@verticalframe_datalist.width = 500
|
|
48
|
+
|
|
49
|
+
fill_datalist_when_visible
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
def dataview_tab_activated(active = true)
|
|
53
|
+
@visible = active
|
|
54
|
+
if @visible
|
|
55
|
+
ensure_datalist_filled
|
|
56
|
+
update_preview
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
attr_reader :layout_file
|
|
61
|
+
def layout_file= file
|
|
62
|
+
@layout_file = file
|
|
63
|
+
@textfield_datasource.text = @layout_file.get_attr_value(S_DATASOURCE)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
attr_reader :dataman
|
|
67
|
+
|
|
68
|
+
# This method is called whenever the datasource has changed.
|
|
69
|
+
def dataman= v
|
|
70
|
+
@dataman = v
|
|
71
|
+
fill_datalist_when_visible
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def fill_datalist_when_visible
|
|
75
|
+
@fill_datalist_triggered = true
|
|
76
|
+
if @visible
|
|
77
|
+
ensure_datalist_filled
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def ensure_datalist_filled
|
|
82
|
+
if @fill_datalist_triggered
|
|
83
|
+
fill_datalist
|
|
84
|
+
@fill_datalist_triggered = false
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
def fill_datalist
|
|
89
|
+
# todo im Moment werden in der Liste der zu druckenden Datensätze alle Felder des Datensatzes angezeigt,
|
|
90
|
+
# eigentlichh soll auswählbar sein, welche Felder angezeigt werden sollen, in den graphischen Objekten ist schon ein Feld vorgesehen, welches dieses Verhalten steuern sollen
|
|
91
|
+
# es ist zu überlegen, welche Daten man dort anzeigt
|
|
92
|
+
@iconlist_data.clearItems
|
|
93
|
+
@iconlist_data.header.clearItems
|
|
94
|
+
|
|
95
|
+
if @dataman && @layout_file
|
|
96
|
+
first_row = @dataman.meta_headers + @dataman.data_headers
|
|
97
|
+
first_col = true
|
|
98
|
+
felder = if first_row
|
|
99
|
+
first_row.map do |feldname|
|
|
100
|
+
@iconlist_data.appendHeader(feldname, nil, first_col ? 60 : 100)
|
|
101
|
+
first_col = false
|
|
102
|
+
feldname
|
|
103
|
+
end
|
|
104
|
+
else
|
|
105
|
+
[]
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
rows = @dataman.rows
|
|
109
|
+
if rows
|
|
110
|
+
big_icon = nil
|
|
111
|
+
mini_icon = nil
|
|
112
|
+
rows.each_with_index do |row, idx|
|
|
113
|
+
itemtext = felder.map do |feld|
|
|
114
|
+
row[feld]
|
|
115
|
+
end.join("\t")
|
|
116
|
+
item = FxColoredItem.new(itemtext, bigIcon: big_icon, miniIcon: mini_icon, data: row)
|
|
117
|
+
@iconlist_data.appendItem item
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
update_preview
|
|
121
|
+
@parent.app.show_on_statusline I18n.t(:dataman_loaded_records, default: "%{count} Datensätze geladen", count: @dataman.rows.length)
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
def draw_preview(row, immediately = false)
|
|
127
|
+
@layout.draw_preview_with_row(row, immediately)
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
#---------------------------------------------------------------------------------------------------------
|
|
131
|
+
|
|
132
|
+
def itemsSelected?
|
|
133
|
+
if @iconlist_data.numItems > 0
|
|
134
|
+
(0..(@iconlist_data.numItems - 1)).each { |it|
|
|
135
|
+
if @iconlist_data.itemSelected?(it)
|
|
136
|
+
return true
|
|
137
|
+
end
|
|
138
|
+
}
|
|
139
|
+
end
|
|
140
|
+
false
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
#---------------------------------------------------------------------------------------------------------
|
|
144
|
+
|
|
145
|
+
def enable_disable_print_select_button(selected = nil)
|
|
146
|
+
if selected == true || (selected.nil? && itemsSelected?)
|
|
147
|
+
@button_print_selected.enabled = true
|
|
148
|
+
@button_deselect_all.enabled = true
|
|
149
|
+
else
|
|
150
|
+
@button_print_selected.enabled = false
|
|
151
|
+
@button_deselect_all.enabled = false
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
#---------------------------------------------------------------------------------------------------------
|
|
155
|
+
|
|
156
|
+
# sucht in allen Feldern nach dem Text, der ins Suchfeld eingegeben wurde
|
|
157
|
+
def search
|
|
158
|
+
search_text = @textfield_search.text
|
|
159
|
+
if @old_search_text != search_text
|
|
160
|
+
@search_pos = -1
|
|
161
|
+
@old_search_text = search_text
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
first_finding = true
|
|
165
|
+
finding_count = 0
|
|
166
|
+
@iconlist_data.each_with_index do |item, itemidx|
|
|
167
|
+
if /#{search_text}/i.match?(item.text)
|
|
168
|
+
|
|
169
|
+
@iconlist_data.selectItem(itemidx)
|
|
170
|
+
finding_count += 1
|
|
171
|
+
|
|
172
|
+
if first_finding && @search_pos < itemidx
|
|
173
|
+
@iconlist_data.setCurrentItem(itemidx, true)
|
|
174
|
+
@iconlist_data.makeItemVisible(itemidx)
|
|
175
|
+
|
|
176
|
+
@search_pos = itemidx
|
|
177
|
+
first_finding = false
|
|
178
|
+
end
|
|
179
|
+
else
|
|
180
|
+
@iconlist_data.deselectItem(itemidx)
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
if first_finding
|
|
184
|
+
@parent.app.show_on_statusline(finding_count > 0 ?
|
|
185
|
+
I18n.t(:dataman_no_further_record, default: "kein weiterer Datensatz gefunden") :
|
|
186
|
+
I18n.t(:dataman_no_record, default: "kein Datensatz gefunden"))
|
|
187
|
+
else
|
|
188
|
+
curr_text = I18n.t(:dataman_current_record, default: "aktueller Datensatz: %{recno}", recno: @search_pos + 1) if @search_pos >= 0
|
|
189
|
+
@parent.app.show_on_statusline I18n.t(:dataman_found_n_records, default: "%{finding_count} Datensätze gefunden \n- %{curr_text}", finding_count:, curr_text:)
|
|
190
|
+
end
|
|
191
|
+
enable_disable_print_select_button(finding_count > 0)
|
|
192
|
+
end
|
|
193
|
+
#---------------------------------------------------------------------------------------------------------
|
|
194
|
+
|
|
195
|
+
def set_label_selected(count = nil)
|
|
196
|
+
count ||= @iconlist_data.inject(0) { |s, i| (s + i.selected?) ? 1 : 0 }
|
|
197
|
+
@parent.app.show_on_statusline I18n.t(:dataman_n_records_marked, default: "%{count} Datensätze markiert", count: )
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
def print_list_selection_changed
|
|
201
|
+
enable_disable_print_select_button
|
|
202
|
+
end
|
|
203
|
+
#---------------------------------------------------------------------------------------------------------
|
|
204
|
+
|
|
205
|
+
def print_list_deselected
|
|
206
|
+
enable_disable_print_select_button
|
|
207
|
+
end
|
|
208
|
+
#---------------------------------------------------------------------------------------------------------
|
|
209
|
+
|
|
210
|
+
def update_preview
|
|
211
|
+
if !@printing # Vorschau nicht während dem Druck, da es sonst zu Druckfehlern kommt und der Druck länger dauert
|
|
212
|
+
row_nr = @iconlist_data.currentItem
|
|
213
|
+
if row_nr >= 0
|
|
214
|
+
@iconlist_data.makeItemVisible(row_nr)
|
|
215
|
+
draw_preview @iconlist_data.getItemData(row_nr)
|
|
216
|
+
end
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
#---------------------------------------------------------------------------------------------------------
|
|
220
|
+
|
|
221
|
+
def deselect_all
|
|
222
|
+
@iconlist_data.killSelection
|
|
223
|
+
@button_select_all.enabled = true
|
|
224
|
+
@button_deselect_all.enabled = false
|
|
225
|
+
@button_print_selected.enabled = false
|
|
226
|
+
end
|
|
227
|
+
#---------------------------------------------------------------------------------------------------------
|
|
228
|
+
|
|
229
|
+
def select_all
|
|
230
|
+
(1..@iconlist_data.numItems).each { |itemnr|
|
|
231
|
+
@iconlist_data.selectItem(itemnr - 1)
|
|
232
|
+
}
|
|
233
|
+
@button_select_all.enabled = false
|
|
234
|
+
@button_deselect_all.enabled = true
|
|
235
|
+
@button_print_selected.enabled = true
|
|
236
|
+
end
|
|
237
|
+
#---------------------------------------------------------------------------------------------------------
|
|
238
|
+
|
|
239
|
+
def print_all
|
|
240
|
+
@button_print_all.enabled = false
|
|
241
|
+
disable_all_buttons
|
|
242
|
+
|
|
243
|
+
enable_all_buttons
|
|
244
|
+
enable_disable_print_select_button
|
|
245
|
+
@button_stop_printing.enabled = true
|
|
246
|
+
@button_print_all.enabled = true
|
|
247
|
+
only_selected = false
|
|
248
|
+
print_cards(only_selected)
|
|
249
|
+
end
|
|
250
|
+
#---------------------------------------------------------------------------------------------------------
|
|
251
|
+
|
|
252
|
+
def print_selected
|
|
253
|
+
only_selected = true
|
|
254
|
+
print_cards(only_selected)
|
|
255
|
+
end
|
|
256
|
+
#---------------------------------------------------------------------------------------------------------
|
|
257
|
+
|
|
258
|
+
def print_cards(only_selected = false)
|
|
259
|
+
disable_all_buttons
|
|
260
|
+
@button_stop_printing.enabled = true
|
|
261
|
+
@printing = true
|
|
262
|
+
|
|
263
|
+
marked_items = (0...@iconlist_data.numRows).select do |i|
|
|
264
|
+
!only_selected || @iconlist_data.itemSelected?(i)
|
|
265
|
+
end.map do |i|
|
|
266
|
+
[@iconlist_data.getItemData(i), i]
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
Thread.new do
|
|
270
|
+
printer = @layout_file.build_printer_instance
|
|
271
|
+
|
|
272
|
+
marked_items.each do |item, itemidx|
|
|
273
|
+
@parent.runOnUiThread do
|
|
274
|
+
@iconlist_data.makeItemVisible(itemidx)
|
|
275
|
+
@iconlist_data.setFocus
|
|
276
|
+
@iconlist_data.setCurrentItem(itemidx, true)
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
erg = printer.print_card(layout_file, item)
|
|
280
|
+
|
|
281
|
+
@parent.runOnUiThread do
|
|
282
|
+
@parent.app.show_on_statusline I18n.t(:dataman_records_printed, default: "%{recno} von %{of} Datensätzen gedruckt", recno: itemidx + 1, of: marked_items.length)
|
|
283
|
+
# den aktuellen Datensatz deselektieren, wenn er erfolgreich gedruckt wurde
|
|
284
|
+
begin
|
|
285
|
+
@iconlist_data.deselectItem(itemidx) if erg
|
|
286
|
+
@iconlist_data.repaint
|
|
287
|
+
rescue RuntimeError => e
|
|
288
|
+
raise unless /already released/.match?(e.to_s)
|
|
289
|
+
end
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
if !erg || !@printing
|
|
293
|
+
# abbrechen, wenn ein Fehler aufgetreten ist, oder wenn der Bediener es gefordert hat
|
|
294
|
+
break
|
|
295
|
+
end
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
printer.close
|
|
299
|
+
|
|
300
|
+
rescue Printer::Base::PrintError => e
|
|
301
|
+
@parent.runOnUiThread do
|
|
302
|
+
FXMessageBox.error(@parent.app, MBOX_OK, *I18n.t(:dataman_error_printing_object, default: [["Fehler beim Erstellen eines Grafikobjekts", "%{e}"]], e: e.to_s))
|
|
303
|
+
end
|
|
304
|
+
rescue Exception => e
|
|
305
|
+
DebugTools.write_exception("print_card_thread", e)
|
|
306
|
+
@parent.runOnUiThread do
|
|
307
|
+
FXMessageBox.error(@parent.app, MBOX_OK, *I18n.t(:dataman_error_printing_exception, default: [["Fehler beim Erstellen des Druckbildes", "%{e}"]], e: DebugTools.unkown_error_message(e)))
|
|
308
|
+
end
|
|
309
|
+
ensure
|
|
310
|
+
@printing = false
|
|
311
|
+
@parent.runOnUiThread do
|
|
312
|
+
enable_all_buttons
|
|
313
|
+
enable_disable_print_select_button
|
|
314
|
+
@button_stop_printing.enabled = false
|
|
315
|
+
end
|
|
316
|
+
end
|
|
317
|
+
end
|
|
318
|
+
#---------------------------------------------------------------------------------------------------------
|
|
319
|
+
|
|
320
|
+
def disable_all_buttons
|
|
321
|
+
@button_print_selected.enabled = false
|
|
322
|
+
@button_print_all.enabled = false
|
|
323
|
+
@button_select_all.enabled = false
|
|
324
|
+
@button_deselect_all.enabled = false
|
|
325
|
+
@button_stop_printing.enabled = false
|
|
326
|
+
end
|
|
327
|
+
#---------------------------------------------------------------------------------------------------------
|
|
328
|
+
|
|
329
|
+
def enable_all_buttons
|
|
330
|
+
@button_print_selected.enabled = true
|
|
331
|
+
@button_print_all.enabled = true
|
|
332
|
+
@button_select_all.enabled = true
|
|
333
|
+
@button_deselect_all.enabled = true
|
|
334
|
+
@button_stop_printing.enabled = true
|
|
335
|
+
end
|
|
336
|
+
#---------------------------------------------------------------------------------------------------------
|
|
337
|
+
|
|
338
|
+
def stop_printing
|
|
339
|
+
@printing = false
|
|
340
|
+
end
|
|
341
|
+
#---------------------------------------------------------------------------------------------------------
|
|
342
|
+
|
|
343
|
+
def changed_attributes(update_preview = true)
|
|
344
|
+
@layout.changed_attributes
|
|
345
|
+
self.update_preview if update_preview
|
|
346
|
+
end
|
|
347
|
+
end
|
|
348
|
+
end
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
# source generated by foxGUIb 1.1.1
|
|
2
|
+
|
|
3
|
+
require 'i18n'
|
|
4
|
+
|
|
5
|
+
class Dialogbox_dataview
|
|
6
|
+
def initialize(parent)
|
|
7
|
+
construct_widget_tree(parent)
|
|
8
|
+
init if respond_to? :init
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def construct_widget_tree(parent)
|
|
12
|
+
@topwin =
|
|
13
|
+
FX::DialogBox.new(parent) { |w_dialogbox_dataview|
|
|
14
|
+
@dialogbox_dataview = w_dialogbox_dataview
|
|
15
|
+
w_dialogbox_dataview.wdg_name = "dialogbox_dataview"
|
|
16
|
+
w_dialogbox_dataview.layoutHints = 768
|
|
17
|
+
w_dialogbox_dataview.shown = true
|
|
18
|
+
w_dialogbox_dataview.x = 699
|
|
19
|
+
w_dialogbox_dataview.y = 1091
|
|
20
|
+
w_dialogbox_dataview.width = 500
|
|
21
|
+
w_dialogbox_dataview.height = 400
|
|
22
|
+
w_dialogbox_dataview.title = I18n.t("dialogbox_dataview_title", scope: "dialogbox_dataview", default: "Entwurfsansicht")
|
|
23
|
+
FX::Splitter.new(@dialogbox_dataview) { |w_splitter_dataview|
|
|
24
|
+
@splitter_dataview = w_splitter_dataview
|
|
25
|
+
w_splitter_dataview.wdg_name = "splitter_dataview"
|
|
26
|
+
w_splitter_dataview.splitterStyle = 163840
|
|
27
|
+
w_splitter_dataview.width = 500
|
|
28
|
+
w_splitter_dataview.height = 400
|
|
29
|
+
FX::VerticalFrame.new(@splitter_dataview) { |w_verticalframe_datalist|
|
|
30
|
+
@verticalframe_datalist = w_verticalframe_datalist
|
|
31
|
+
w_verticalframe_datalist.wdg_name = "verticalframe_datalist"
|
|
32
|
+
w_verticalframe_datalist.frameStyle = 16384
|
|
33
|
+
w_verticalframe_datalist.layoutHints = 2304
|
|
34
|
+
w_verticalframe_datalist.width = 500
|
|
35
|
+
w_verticalframe_datalist.height = 400
|
|
36
|
+
FX::Matrix.new(@verticalframe_datalist) { |w_matrix_printbuttons|
|
|
37
|
+
@matrix_printbuttons = w_matrix_printbuttons
|
|
38
|
+
w_matrix_printbuttons.wdg_name = "matrix_printbuttons"
|
|
39
|
+
w_matrix_printbuttons.layoutHints = 1024
|
|
40
|
+
w_matrix_printbuttons.matrixStyle = 131072
|
|
41
|
+
w_matrix_printbuttons.hSpacing = 0
|
|
42
|
+
w_matrix_printbuttons.vSpacing = 0
|
|
43
|
+
w_matrix_printbuttons.x = 2
|
|
44
|
+
w_matrix_printbuttons.y = 2
|
|
45
|
+
w_matrix_printbuttons.width = 496
|
|
46
|
+
w_matrix_printbuttons.height = 53
|
|
47
|
+
w_matrix_printbuttons.numColumns = 3
|
|
48
|
+
w_matrix_printbuttons.numRows = 2
|
|
49
|
+
FX::Label.new(@matrix_printbuttons) { |w_label_datasource|
|
|
50
|
+
@label_datasource = w_label_datasource
|
|
51
|
+
w_label_datasource.wdg_name = "label_datasource"
|
|
52
|
+
w_label_datasource.layoutHints = 3132
|
|
53
|
+
w_label_datasource.font = FX::Font.new.from_s("Tahoma|80|40|5|0|0|0").to_FXFont
|
|
54
|
+
w_label_datasource.x = 4
|
|
55
|
+
w_label_datasource.y = 4
|
|
56
|
+
w_label_datasource.width = 67
|
|
57
|
+
w_label_datasource.height = 24
|
|
58
|
+
w_label_datasource.text = I18n.t("label_datasource_text", scope: "dialogbox_dataview", default: "Datenquelle")
|
|
59
|
+
w_label_datasource.shadowColor = Fox::FXRGBA(128, 128, 128, 255)
|
|
60
|
+
}
|
|
61
|
+
FX::TextField.new(@matrix_printbuttons) { |w_textfield_datasource|
|
|
62
|
+
@textfield_datasource = w_textfield_datasource
|
|
63
|
+
w_textfield_datasource.wdg_name = "textfield_datasource"
|
|
64
|
+
w_textfield_datasource.layoutHints = 3073
|
|
65
|
+
w_textfield_datasource.font = FX::Font.new.from_s("Tahoma|80|40|5|0|0|0").to_FXFont
|
|
66
|
+
w_textfield_datasource.x = 71
|
|
67
|
+
w_textfield_datasource.y = 4
|
|
68
|
+
w_textfield_datasource.width = 401
|
|
69
|
+
w_textfield_datasource.height = 24
|
|
70
|
+
w_textfield_datasource.numColumns = 30
|
|
71
|
+
w_textfield_datasource.tipText = I18n.t("textfield_datasource_tipText", scope: "dialogbox_dataview", default: "Hier wird die Datendatei angegeben.\nBei statischem Layout kann hier die Anzahl der Seiten angegeben werden.\n\n")
|
|
72
|
+
w_textfield_datasource.shadowColor = Fox::FXRGBA(128, 128, 128, 255)
|
|
73
|
+
}
|
|
74
|
+
FX::Button.new(@matrix_printbuttons) { |w_button_datasource|
|
|
75
|
+
@button_datasource = w_button_datasource
|
|
76
|
+
w_button_datasource.wdg_name = "button_datasource"
|
|
77
|
+
w_button_datasource.layoutHints = 256
|
|
78
|
+
w_button_datasource.font = FX::Font.new.from_s("Tahoma|80|40|5|0|0|0").to_FXFont
|
|
79
|
+
w_button_datasource.x = 472
|
|
80
|
+
w_button_datasource.y = 4
|
|
81
|
+
w_button_datasource.width = 20
|
|
82
|
+
w_button_datasource.height = 24
|
|
83
|
+
w_button_datasource.text = I18n.t("button_datasource_text", scope: "dialogbox_dataview", default: "...")
|
|
84
|
+
w_button_datasource.tipText = I18n.t("button_datasource_tipText", scope: "dialogbox_dataview", default: "CSV-Datei über Dateiauswahl-Dialog laden")
|
|
85
|
+
w_button_datasource.shadowColor = Fox::FXRGBA(128, 128, 128, 255)
|
|
86
|
+
}
|
|
87
|
+
FX::Label.new(@matrix_printbuttons) { |w_label_search|
|
|
88
|
+
@label_search = w_label_search
|
|
89
|
+
w_label_search.wdg_name = "label_search"
|
|
90
|
+
w_label_search.layoutHints = 3072
|
|
91
|
+
w_label_search.font = FX::Font.new.from_s("Tahoma|80|40|5|0|0|0").to_FXFont
|
|
92
|
+
w_label_search.x = 4
|
|
93
|
+
w_label_search.y = 28
|
|
94
|
+
w_label_search.width = 67
|
|
95
|
+
w_label_search.height = 21
|
|
96
|
+
w_label_search.text = I18n.t("label_search_text", scope: "dialogbox_dataview", default: "Suchbegriff")
|
|
97
|
+
}
|
|
98
|
+
FX::TextField.new(@matrix_printbuttons) { |w_textfield_search|
|
|
99
|
+
@textfield_search = w_textfield_search
|
|
100
|
+
w_textfield_search.wdg_name = "textfield_search"
|
|
101
|
+
w_textfield_search.layoutHints = 1025
|
|
102
|
+
w_textfield_search.font = FX::Font.new.from_s("arial|90|0|0|0|0|0").to_FXFont
|
|
103
|
+
w_textfield_search.x = 71
|
|
104
|
+
w_textfield_search.y = 28
|
|
105
|
+
w_textfield_search.width = 401
|
|
106
|
+
w_textfield_search.height = 21
|
|
107
|
+
w_textfield_search.numColumns = 10
|
|
108
|
+
w_textfield_search.tipText = I18n.t("textfield_search_tipText", scope: "dialogbox_dataview", default: "Durch Eingabe einer Zeichenkette werden alle angezeigten Felder\ndurchsucht und markiert. Durch mehrfaches Drücken der Enter-\nTaste wird zur nächsten Fundstelle gesprungen.")
|
|
109
|
+
}
|
|
110
|
+
FX::Label.new(@matrix_printbuttons) { |w_label_selected|
|
|
111
|
+
@label_selected = w_label_selected
|
|
112
|
+
w_label_selected.wdg_name = "label_selected"
|
|
113
|
+
w_label_selected.font = FX::Font.new.from_s("Tahoma|80|40|5|0|0|0").to_FXFont
|
|
114
|
+
w_label_selected.x = 472
|
|
115
|
+
w_label_selected.y = 28
|
|
116
|
+
w_label_selected.width = 4
|
|
117
|
+
w_label_selected.height = 4
|
|
118
|
+
w_label_selected.text = I18n.t("label_selected_text", scope: "dialogbox_dataview", default: "")
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
FX::Matrix.new(@verticalframe_datalist) { |w_matrix18|
|
|
122
|
+
@matrix18 = w_matrix18
|
|
123
|
+
w_matrix18.wdg_name = "matrix18"
|
|
124
|
+
w_matrix18.layoutHints = 1024
|
|
125
|
+
w_matrix18.x = 2
|
|
126
|
+
w_matrix18.y = 55
|
|
127
|
+
w_matrix18.width = 496
|
|
128
|
+
w_matrix18.height = 31
|
|
129
|
+
w_matrix18.numColumns = 5
|
|
130
|
+
FX::Button.new(@matrix18) { |w_button_select_all|
|
|
131
|
+
@button_select_all = w_button_select_all
|
|
132
|
+
w_button_select_all.wdg_name = "button_select_all"
|
|
133
|
+
w_button_select_all.font = FX::Font.new.from_s("arial|90|0|0|0|0|0").to_FXFont
|
|
134
|
+
w_button_select_all.x = 4
|
|
135
|
+
w_button_select_all.y = 4
|
|
136
|
+
w_button_select_all.width = 28
|
|
137
|
+
w_button_select_all.height = 23
|
|
138
|
+
w_button_select_all.text = I18n.t("button_select_all_text", scope: "dialogbox_dataview", default: "alle")
|
|
139
|
+
w_button_select_all.tipText = I18n.t("button_select_all_tipText", scope: "dialogbox_dataview", default: "alle Datensätze markieren")
|
|
140
|
+
}
|
|
141
|
+
FX::Button.new(@matrix18) { |w_button_deselect_all|
|
|
142
|
+
@button_deselect_all = w_button_deselect_all
|
|
143
|
+
w_button_deselect_all.wdg_name = "button_deselect_all"
|
|
144
|
+
w_button_deselect_all.font = FX::Font.new.from_s("arial|90|0|0|0|0|0").to_FXFont
|
|
145
|
+
w_button_deselect_all.x = 36
|
|
146
|
+
w_button_deselect_all.y = 4
|
|
147
|
+
w_button_deselect_all.width = 24
|
|
148
|
+
w_button_deselect_all.height = 23
|
|
149
|
+
w_button_deselect_all.text = I18n.t("button_deselect_all_text", scope: "dialogbox_dataview", default: "nix")
|
|
150
|
+
w_button_deselect_all.tipText = I18n.t("button_deselect_all_tipText", scope: "dialogbox_dataview", default: "alle Datensatz-Markierungen entfernen")
|
|
151
|
+
}
|
|
152
|
+
FX::Button.new(@matrix18) { |w_button_print_selected|
|
|
153
|
+
@button_print_selected = w_button_print_selected
|
|
154
|
+
w_button_print_selected.wdg_name = "button_print_selected"
|
|
155
|
+
w_button_print_selected.font = FX::Font.new.from_s("arial|90|0|0|0|0|0").to_FXFont
|
|
156
|
+
w_button_print_selected.img = "mcc2/images/document-print-frame.png"
|
|
157
|
+
w_button_print_selected.x = 64
|
|
158
|
+
w_button_print_selected.y = 4
|
|
159
|
+
w_button_print_selected.width = 106
|
|
160
|
+
w_button_print_selected.height = 23
|
|
161
|
+
w_button_print_selected.text = I18n.t("button_print_selected_text", scope: "dialogbox_dataview", default: "markierte drucken")
|
|
162
|
+
w_button_print_selected.tipText = I18n.t("button_print_selected_tipText", scope: "dialogbox_dataview", default: "alle markierten Datensätze drucken")
|
|
163
|
+
}
|
|
164
|
+
FX::Button.new(@matrix18) { |w_button_print_all|
|
|
165
|
+
@button_print_all = w_button_print_all
|
|
166
|
+
w_button_print_all.wdg_name = "button_print_all"
|
|
167
|
+
w_button_print_all.font = FX::Font.new.from_s("arial|90|0|0|0|0|0").to_FXFont
|
|
168
|
+
w_button_print_all.img = "mcc2/images/document-print.png"
|
|
169
|
+
w_button_print_all.x = 174
|
|
170
|
+
w_button_print_all.y = 4
|
|
171
|
+
w_button_print_all.width = 75
|
|
172
|
+
w_button_print_all.height = 23
|
|
173
|
+
w_button_print_all.text = I18n.t("button_print_all_text", scope: "dialogbox_dataview", default: "alle drucken")
|
|
174
|
+
w_button_print_all.tipText = I18n.t("button_print_all_tipText", scope: "dialogbox_dataview", default: "Alle Datensätze drucken")
|
|
175
|
+
}
|
|
176
|
+
FX::Button.new(@matrix18) { |w_button_stop_printing|
|
|
177
|
+
@button_stop_printing = w_button_stop_printing
|
|
178
|
+
w_button_stop_printing.wdg_name = "button_stop_printing"
|
|
179
|
+
w_button_stop_printing.font = FX::Font.new.from_s("arial|90|0|0|0|0|0").to_FXFont
|
|
180
|
+
w_button_stop_printing.img = "mcc2/images/process-stop.png"
|
|
181
|
+
w_button_stop_printing.x = 253
|
|
182
|
+
w_button_stop_printing.y = 4
|
|
183
|
+
w_button_stop_printing.width = 40
|
|
184
|
+
w_button_stop_printing.height = 23
|
|
185
|
+
w_button_stop_printing.text = I18n.t("button_stop_printing_text", scope: "dialogbox_dataview", default: "Stopp")
|
|
186
|
+
w_button_stop_printing.tipText = I18n.t("button_stop_printing_tipText", scope: "dialogbox_dataview", default: "Druck nach der aktuellen Karte anhalten")
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
FX::IconList.new(@verticalframe_datalist) { |w_iconlist_data|
|
|
190
|
+
@iconlist_data = w_iconlist_data
|
|
191
|
+
w_iconlist_data.wdg_name = "iconlist_data"
|
|
192
|
+
w_iconlist_data.iconListStyle = 4194304
|
|
193
|
+
w_iconlist_data.font = FX::Font.new.from_s("Arial|90|40|5|0|0|0").to_FXFont
|
|
194
|
+
w_iconlist_data.x = 2
|
|
195
|
+
w_iconlist_data.y = 86
|
|
196
|
+
w_iconlist_data.width = 496
|
|
197
|
+
w_iconlist_data.height = 312
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
@topwin
|
|
203
|
+
end
|
|
204
|
+
attr_reader :topwin
|
|
205
|
+
attr_reader :dialogbox_dataview
|
|
206
|
+
attr_reader :splitter_dataview
|
|
207
|
+
attr_reader :verticalframe_datalist
|
|
208
|
+
attr_reader :matrix_printbuttons
|
|
209
|
+
attr_reader :label_datasource
|
|
210
|
+
attr_reader :textfield_datasource
|
|
211
|
+
attr_reader :button_datasource
|
|
212
|
+
attr_reader :label_search
|
|
213
|
+
attr_reader :textfield_search
|
|
214
|
+
attr_reader :label_selected
|
|
215
|
+
attr_reader :matrix18
|
|
216
|
+
attr_reader :button_select_all
|
|
217
|
+
attr_reader :button_deselect_all
|
|
218
|
+
attr_reader :button_print_selected
|
|
219
|
+
attr_reader :button_print_all
|
|
220
|
+
attr_reader :button_stop_printing
|
|
221
|
+
attr_reader :iconlist_data
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# unit test
|
|
225
|
+
if __FILE__ == $0
|
|
226
|
+
require "libGUIb16"
|
|
227
|
+
app = FX::App.new
|
|
228
|
+
w = Dialogbox_dataview.new app
|
|
229
|
+
w.topwin.show(Fox::PLACEMENT_SCREEN)
|
|
230
|
+
app.create
|
|
231
|
+
app.run
|
|
232
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Mcc2
|
|
2
|
+
module DebugTools
|
|
3
|
+
def self.write_log_file(source, message)
|
|
4
|
+
f_out = $stderr
|
|
5
|
+
f_out.puts "-" * 100
|
|
6
|
+
f_out.puts Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
|
7
|
+
f_out.puts "Programmversion: #{Mcc2::VERSION}"
|
|
8
|
+
f_out.puts "." * 50
|
|
9
|
+
f_out.puts message
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def self.unkown_error_message(e)
|
|
13
|
+
I18n.t(:unknwon_error_message, default: "Es ist leider ein Fehler aufgetreten:\n\n%{e} %{klass}", e:, klass: e.class)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def self.write_exception(source, e)
|
|
17
|
+
write_log_file(source, I18n.t(:unknwon_error_message_exc, default: "Es ist leider ein Fehler aufgetreten:\n\n%{e} (%{klass})\n%{backtrace}", e:, klass: e.class, backtrace: e.backtrace.join("\n")))
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|