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.
Files changed (120) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +0 -0
  3. data/.autotest +23 -0
  4. data/.gitignore +15 -0
  5. data/.rubocop.yml +3 -0
  6. data/Gemfile +13 -0
  7. data/History.txt +6 -0
  8. data/LICENSE.txt +21 -0
  9. data/README.md +51 -0
  10. data/Rakefile +12 -0
  11. data/config/i18n-tasks.yml +193 -0
  12. data/exe/mcc2 +18 -0
  13. data/exe/mcc2-generate-preview +17 -0
  14. data/exe/mcc2print +6 -0
  15. data/lib/libguib16.rb +1620 -0
  16. data/lib/mcc2/advanced_data_edit_dlg.rb +139 -0
  17. data/lib/mcc2/cc_dialogbox.rb +52 -0
  18. data/lib/mcc2/constants.rb +154 -0
  19. data/lib/mcc2/dataman/base.rb +61 -0
  20. data/lib/mcc2/dataman/csv.rb +49 -0
  21. data/lib/mcc2/dataman/database.rb +8 -0
  22. data/lib/mcc2/dataman/dbf.rb +45 -0
  23. data/lib/mcc2/dataman/none.rb +25 -0
  24. data/lib/mcc2/dataview.rb +348 -0
  25. data/lib/mcc2/dataview_dlg.rb +232 -0
  26. data/lib/mcc2/debug_tools.rb +20 -0
  27. data/lib/mcc2/fx_colored_item.rb +101 -0
  28. data/lib/mcc2/generate_preview.rb +68 -0
  29. data/lib/mcc2/gui/advanced_data_edit_dlg.rbin +0 -0
  30. data/lib/mcc2/gui/dataview_dlg.pp +522 -0
  31. data/lib/mcc2/gui/layoutview_dlg.pp +5115 -0
  32. data/lib/mcc2/gui/mcc2_mainwin.pp +838 -0
  33. data/lib/mcc2/gui/picture_data_edit_dlg.rbin +0 -0
  34. data/lib/mcc2/gui/printerview_dlg.pp +3311 -0
  35. data/lib/mcc2/images/Image-Arrow-Left.gif +0 -0
  36. data/lib/mcc2/images/Image-Arrow-Right.gif +0 -0
  37. data/lib/mcc2/images/Image-FastArrowLeft.gif +0 -0
  38. data/lib/mcc2/images/Image-FastArrowRight.bmp +0 -0
  39. data/lib/mcc2/images/Image-FastArrowRight.gif +0 -0
  40. data/lib/mcc2/images/application-exit.png +0 -0
  41. data/lib/mcc2/images/copy.png +0 -0
  42. data/lib/mcc2/images/country_de.png +0 -0
  43. data/lib/mcc2/images/country_gb.png +0 -0
  44. data/lib/mcc2/images/country_rs.png +0 -0
  45. data/lib/mcc2/images/cut.png +0 -0
  46. data/lib/mcc2/images/distribute-horizontal-baseline.png +0 -0
  47. data/lib/mcc2/images/distribute-vertical-baseline.png +0 -0
  48. data/lib/mcc2/images/document-close.png +0 -0
  49. data/lib/mcc2/images/document-edit.png +0 -0
  50. data/lib/mcc2/images/document-new.png +0 -0
  51. data/lib/mcc2/images/document-open.png +0 -0
  52. data/lib/mcc2/images/document-print-frame.png +0 -0
  53. data/lib/mcc2/images/document-print.png +0 -0
  54. data/lib/mcc2/images/document-save-as.png +0 -0
  55. data/lib/mcc2/images/document-save.png +0 -0
  56. data/lib/mcc2/images/documentation.png +0 -0
  57. data/lib/mcc2/images/draw-rectangle.png +0 -0
  58. data/lib/mcc2/images/dummy.gif +0 -0
  59. data/lib/mcc2/images/exchange-positions.png +0 -0
  60. data/lib/mcc2/images/insert-image.png +0 -0
  61. data/lib/mcc2/images/insert-text.png +0 -0
  62. data/lib/mcc2/images/libreoffice-oasis-master-document.png +0 -0
  63. data/lib/mcc2/images/measure.png +0 -0
  64. data/lib/mcc2/images/messagebox_warning.png +0 -0
  65. data/lib/mcc2/images/paste.png +0 -0
  66. data/lib/mcc2/images/process-stop.png +0 -0
  67. data/lib/mcc2/images/zoom-in.png +0 -0
  68. data/lib/mcc2/layout.rb +323 -0
  69. data/lib/mcc2/layout_file.rb +794 -0
  70. data/lib/mcc2/layout_object/barcode.rb +33 -0
  71. data/lib/mcc2/layout_object/box.rb +18 -0
  72. data/lib/mcc2/layout_object/chip.rb +54 -0
  73. data/lib/mcc2/layout_object/embed.rb +16 -0
  74. data/lib/mcc2/layout_object/go_attribut.rb +16 -0
  75. data/lib/mcc2/layout_object/graphic.rb +59 -0
  76. data/lib/mcc2/layout_object/magstripe.rb +13 -0
  77. data/lib/mcc2/layout_object/picture.rb +22 -0
  78. data/lib/mcc2/layout_object/text.rb +29 -0
  79. data/lib/mcc2/layout_win.rb +2052 -0
  80. data/lib/mcc2/layoutview.rb +845 -0
  81. data/lib/mcc2/layoutview_dlg.rb +2058 -0
  82. data/lib/mcc2/locales.rb +27 -0
  83. data/lib/mcc2/mcc2_mainwin.rb +453 -0
  84. data/lib/mcc2/mcc2gui.rb +295 -0
  85. data/lib/mcc2/mcc2print.rb +54 -0
  86. data/lib/mcc2/picture_data_edit_dlg.rb +139 -0
  87. data/lib/mcc2/print_dlg.rb +520 -0
  88. data/lib/mcc2/printer/base.rb +148 -0
  89. data/lib/mcc2/printer/card_printer.rb +45 -0
  90. data/lib/mcc2/printer/file_printer.rb +135 -0
  91. data/lib/mcc2/printer/gdi_card_printer.rb +14 -0
  92. data/lib/mcc2/printer/gdi_printer.rb +197 -0
  93. data/lib/mcc2/printer/linux_cups_printer.rb +92 -0
  94. data/lib/mcc2/printer/preview.rb +277 -0
  95. data/lib/mcc2/printer/printer_cab.rb +118 -0
  96. data/lib/mcc2/printer/printer_cx320_direct.rb +286 -0
  97. data/lib/mcc2/printer/printer_epl.rb +118 -0
  98. data/lib/mcc2/printer/printer_ttp34x.rb +124 -0
  99. data/lib/mcc2/printer/printer_zebra.rb +324 -0
  100. data/lib/mcc2/printer/svg_drawer.rb +689 -0
  101. data/lib/mcc2/printerview.rb +604 -0
  102. data/lib/mcc2/printerview_dlg.rb +1248 -0
  103. data/lib/mcc2/version.rb +3 -0
  104. data/lib/mcc2.rb +11 -0
  105. data/locales/de.yml +6 -0
  106. data/locales/en.yml +502 -0
  107. data/locales/rs.yml +502 -0
  108. data/mcc2.gemspec +41 -0
  109. data/test/dummy.rb +19 -0
  110. data/test/layouts/bart_simpson.png +0 -0
  111. data/test/layouts/color_test.xml +151 -0
  112. data/test/layouts/ms.xml +67 -0
  113. data/test/ruby_print.rb +380 -0
  114. data/test/test.csv +4 -0
  115. data/test/test.dbf +0 -0
  116. data/test/test.str +4 -0
  117. data/test/test_mcc2.rb +8 -0
  118. data.tar.gz.sig +6 -0
  119. metadata +421 -0
  120. metadata.gz.sig +0 -0
@@ -0,0 +1,520 @@
1
+ # source generated by foxGUIb 0.7.1
2
+
3
+ class PrintDialogBox
4
+ def initialize(parent)
5
+ construct_widget_tree(parent)
6
+ init if respond_to? :init
7
+ end
8
+
9
+ def construct_widget_tree(parent)
10
+ @topwin =
11
+ FX::DialogBox.new(parent) { |w|
12
+ @printDialogBox = w
13
+ w.wdg_name = "printDialogBox"
14
+ w.width = 800
15
+ w.shown = true
16
+ w.y = 373
17
+ w.height = 600
18
+ w.title = "Druckdialog"
19
+ w.layoutHints = 768
20
+ w.x = 45
21
+ FX::Splitter.new(@printDialogBox) { |w|
22
+ @splitter1 = w
23
+ w.wdg_name = "splitter1"
24
+ w.width = 800
25
+ w.height = 600
26
+ FX::VerticalFrame.new(@splitter1) { |w|
27
+ @verticalframe_datalist = w
28
+ w.wdg_name = "verticalframe_datalist"
29
+ w.frameStyle = 16384
30
+ w.width = 164
31
+ w.height = 600
32
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
33
+ w.layoutHints = 2304
34
+ FX::IconList.new(@verticalframe_datalist) { |w|
35
+ @iconlist_data = w
36
+ w.wdg_name = "iconlist_data"
37
+ w.font = FX::Font.new.from_s("Arial|90|40|5|0|0|0").to_FXFont
38
+ w.width = 160
39
+ w.y = 2
40
+ w.height = 575
41
+ w.iconListStyle = 3145728
42
+ w.x = 2
43
+ }
44
+ FX::HorizontalFrame.new(@verticalframe_datalist) { |w|
45
+ @horizontalframe4 = w
46
+ w.wdg_name = "horizontalframe4"
47
+ w.width = 160
48
+ w.y = 577
49
+ w.height = 21
50
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
51
+ w.layoutHints = 1024
52
+ w.x = 2
53
+ FX::Button.new(@horizontalframe4) { |w|
54
+ @button_top = w
55
+ w.wdg_name = "button_top"
56
+ w.text = "<<"
57
+ w.width = 40
58
+ w.height = 21
59
+ w.layoutHints = 256
60
+ }
61
+ FX::Button.new(@horizontalframe4) { |w|
62
+ @button_prev = w
63
+ w.wdg_name = "button_prev"
64
+ w.text = "<"
65
+ w.width = 40
66
+ w.height = 21
67
+ w.layoutHints = 256
68
+ w.x = 40
69
+ }
70
+ FX::Button.new(@horizontalframe4) { |w|
71
+ @button_next = w
72
+ w.wdg_name = "button_next"
73
+ w.text = ">"
74
+ w.width = 40
75
+ w.height = 21
76
+ w.layoutHints = 256
77
+ w.x = 80
78
+ }
79
+ FX::Button.new(@horizontalframe4) { |w|
80
+ @button_bottom = w
81
+ w.wdg_name = "button_bottom"
82
+ w.text = ">>"
83
+ w.width = 40
84
+ w.height = 21
85
+ w.layoutHints = 256
86
+ w.x = 120
87
+ }
88
+ }
89
+ }
90
+ FX::HorizontalFrame.new(@splitter1) { |w|
91
+ @horizontalframe1 = w
92
+ w.wdg_name = "horizontalframe1"
93
+ w.width = 632
94
+ w.height = 600
95
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
96
+ w.x = 168
97
+ FX::Splitter.new(@horizontalframe1) { |w|
98
+ @splitter2 = w
99
+ w.wdg_name = "splitter2"
100
+ w.width = 632
101
+ w.height = 600
102
+ w.splitterStyle = 32768
103
+ FX::VerticalFrame.new(@splitter2) { |w|
104
+ @verticalframe2 = w
105
+ w.wdg_name = "verticalframe2"
106
+ w.frameStyle = 16384
107
+ w.width = 632
108
+ w.height = 385
109
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
110
+ FX::Matrix.new(@verticalframe2) { |w|
111
+ @matrix2 = w
112
+ w.wdg_name = "matrix2"
113
+ w.numRows = 7
114
+ w.padLeft = 10
115
+ w.width = 628
116
+ w.y = 2
117
+ w.height = 216
118
+ w.matrixStyle = 131072
119
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
120
+ w.numColumns = 3
121
+ w.padTop = 30
122
+ w.x = 2
123
+ FX::Label.new(@matrix2) { |w|
124
+ @label122 = w
125
+ w.wdg_name = "label122"
126
+ w.text = "Datens\303\244tze:"
127
+ w.width = 63
128
+ w.y = 30
129
+ w.height = 17
130
+ w.x = 10
131
+ }
132
+ FX::Label.new(@matrix2) { |w|
133
+ @label_rows = w
134
+ w.wdg_name = "label_rows"
135
+ w.text = ""
136
+ w.width = 4
137
+ w.y = 30
138
+ w.height = 4
139
+ w.x = 80
140
+ }
141
+ FX::Label.new(@matrix2) { |w|
142
+ @label120 = w
143
+ w.wdg_name = "label120"
144
+ w.text = ""
145
+ w.width = 4
146
+ w.y = 30
147
+ w.height = 40
148
+ w.layoutHints = 512
149
+ w.x = 234
150
+ }
151
+ FX::Label.new(@matrix2) { |w|
152
+ @label12 = w
153
+ w.wdg_name = "label12"
154
+ w.text = "von"
155
+ w.font = FX::Font.new.from_s("arial|90|0|0|0|0|0").to_FXFont
156
+ w.width = 23
157
+ w.y = 74
158
+ w.height = 19
159
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
160
+ w.x = 10
161
+ }
162
+ FX::TextField.new(@matrix2) { |w|
163
+ @textfield_print_from = w
164
+ w.wdg_name = "textfield_print_from"
165
+ w.font = FX::Font.new.from_s("arial|90|0|0|0|0|0").to_FXFont
166
+ w.width = 76
167
+ w.y = 74
168
+ w.height = 21
169
+ w.textFieldTextStyle = 1048576
170
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
171
+ w.numColumns = 10
172
+ w.x = 80
173
+ }
174
+ FX::Label.new(@matrix2) { |w|
175
+ @label13 = w
176
+ w.wdg_name = "label13"
177
+ w.text = ""
178
+ w.font = FX::Font.new.from_s("helvetica|90|0|0|0|0|0").to_FXFont
179
+ w.width = 4
180
+ w.y = 74
181
+ w.height = 4
182
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
183
+ w.x = 234
184
+ }
185
+ FX::Label.new(@matrix2) { |w|
186
+ @label14 = w
187
+ w.wdg_name = "label14"
188
+ w.text = "bis"
189
+ w.font = FX::Font.new.from_s("arial|90|0|0|0|0|0").to_FXFont
190
+ w.width = 21
191
+ w.y = 99
192
+ w.height = 19
193
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
194
+ w.x = 10
195
+ }
196
+ FX::TextField.new(@matrix2) { |w|
197
+ @textfield_print_to = w
198
+ w.wdg_name = "textfield_print_to"
199
+ w.font = FX::Font.new.from_s("arial|90|0|0|0|0|0").to_FXFont
200
+ w.width = 76
201
+ w.y = 99
202
+ w.height = 21
203
+ w.textFieldTextStyle = 1048576
204
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
205
+ w.numColumns = 10
206
+ w.x = 80
207
+ }
208
+ FX::Label.new(@matrix2) { |w|
209
+ @label15 = w
210
+ w.wdg_name = "label15"
211
+ w.text = ""
212
+ w.font = FX::Font.new.from_s("helvetica|90|0|0|0|0|0").to_FXFont
213
+ w.width = 4
214
+ w.y = 99
215
+ w.height = 4
216
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
217
+ w.x = 234
218
+ }
219
+ FX::Packer.new(@matrix2) { |w|
220
+ @packer3 = w
221
+ w.wdg_name = "packer3"
222
+ w.width = 66
223
+ w.y = 124
224
+ w.height = 40
225
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
226
+ w.layoutHints = 1536
227
+ w.x = 10
228
+ }
229
+ FX::Label.new(@matrix2) { |w|
230
+ @label16 = w
231
+ w.wdg_name = "label16"
232
+ w.text = ""
233
+ w.font = FX::Font.new.from_s("helvetica|90|0|0|0|0|0").to_FXFont
234
+ w.width = 4
235
+ w.y = 124
236
+ w.height = 4
237
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
238
+ w.x = 80
239
+ }
240
+ FX::Label.new(@matrix2) { |w|
241
+ @label17 = w
242
+ w.wdg_name = "label17"
243
+ w.text = ""
244
+ w.font = FX::Font.new.from_s("helvetica|90|0|0|0|0|0").to_FXFont
245
+ w.width = 4
246
+ w.y = 124
247
+ w.height = 4
248
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
249
+ w.x = 234
250
+ }
251
+ FX::Label.new(@matrix2) { |w|
252
+ @label18 = w
253
+ w.wdg_name = "label18"
254
+ w.text = "Suchbegriff"
255
+ w.font = FX::Font.new.from_s("arial|90|0|0|0|0|0").to_FXFont
256
+ w.width = 66
257
+ w.y = 168
258
+ w.height = 19
259
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
260
+ w.x = 10
261
+ }
262
+ FX::TextField.new(@matrix2) { |w|
263
+ @textfield_search = w
264
+ w.wdg_name = "textfield_search"
265
+ w.tipText = "hier einen Text eingeben und auf Suchen klicken. Dann wird in allen angezeigten Feldern gesucht"
266
+ w.font = FX::Font.new.from_s("arial|90|0|0|0|0|0").to_FXFont
267
+ w.width = 150
268
+ w.helpText = "hier einen Text eingeben und auf Suchen klicken. Dann wird in allen angezeigten Feldern gesucht"
269
+ w.y = 168
270
+ w.height = 21
271
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
272
+ w.numColumns = 10
273
+ w.layoutHints = 256
274
+ w.x = 80
275
+ }
276
+ FX::Button.new(@matrix2) { |w|
277
+ @button_search = w
278
+ w.wdg_name = "button_search"
279
+ w.text = "Suchen"
280
+ w.tipText = "hier einen Text eingeben und auf Suchen klicken. Dann wird in allen angezeigten Feldern gesucht"
281
+ w.font = FX::Font.new.from_s("arial|90|0|0|0|0|0").to_FXFont
282
+ w.width = 50
283
+ w.helpText = "hier einen Text eingeben und auf Suchen klicken. Dann wird in allen angezeigten Feldern gesucht"
284
+ w.y = 168
285
+ w.height = 23
286
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
287
+ w.x = 234
288
+ }
289
+ FX::Packer.new(@matrix2) { |w|
290
+ @packer4 = w
291
+ w.wdg_name = "packer4"
292
+ w.width = 66
293
+ w.y = 195
294
+ w.height = 20
295
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
296
+ w.layoutHints = 1536
297
+ w.x = 10
298
+ }
299
+ FX::Label.new(@matrix2) { |w|
300
+ @label19 = w
301
+ w.wdg_name = "label19"
302
+ w.text = ""
303
+ w.font = FX::Font.new.from_s("helvetica|90|0|0|0|0|0").to_FXFont
304
+ w.width = 4
305
+ w.y = 195
306
+ w.height = 4
307
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
308
+ w.x = 80
309
+ }
310
+ FX::Label.new(@matrix2) { |w|
311
+ @label20 = w
312
+ w.wdg_name = "label20"
313
+ w.text = ""
314
+ w.font = FX::Font.new.from_s("helvetica|90|0|0|0|0|0").to_FXFont
315
+ w.width = 4
316
+ w.y = 195
317
+ w.height = 4
318
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
319
+ w.x = 234
320
+ }
321
+ FX::Label.new(@matrix2) { |w|
322
+ @label21 = w
323
+ w.wdg_name = "label21"
324
+ w.text = "Vorschau"
325
+ w.font = FX::Font.new.from_s("helvetica|90|0|0|0|0|0").to_FXFont
326
+ w.width = 56
327
+ w.y = 219
328
+ w.height = 18
329
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
330
+ w.x = 10
331
+ }
332
+ FX::CheckButton.new(@matrix2) { |w|
333
+ @checkbutton2 = w
334
+ w.wdg_name = "checkbutton2"
335
+ w.text = ""
336
+ w.font = FX::Font.new.from_s("helvetica|90|0|0|0|0|0").to_FXFont
337
+ w.width = 17
338
+ w.iconPosition = 0
339
+ w.y = 219
340
+ w.height = 17
341
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
342
+ w.state = true
343
+ w.x = 80
344
+ }
345
+ FX::Label.new(@matrix2) { |w|
346
+ @label42 = w
347
+ w.wdg_name = "label42"
348
+ w.width = 29
349
+ w.y = 219
350
+ w.height = 17
351
+ w.x = 234
352
+ }
353
+ }
354
+ FX::Packer.new(@verticalframe2) { |w|
355
+ @packer13 = w
356
+ w.wdg_name = "packer13"
357
+ w.width = 628
358
+ w.y = 218
359
+ w.height = 20
360
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
361
+ w.layoutHints = 1536
362
+ w.x = 2
363
+ }
364
+ FX::Button.new(@verticalframe2) { |w|
365
+ @button_select_all = w
366
+ w.wdg_name = "button_select_all"
367
+ w.text = "alle markieren"
368
+ w.font = FX::Font.new.from_s("arial|90|0|0|0|0|0").to_FXFont
369
+ w.width = 200
370
+ w.y = 237
371
+ w.height = 23
372
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
373
+ w.layoutHints = 296
374
+ w.x = 216
375
+ }
376
+ FX::Button.new(@verticalframe2) { |w|
377
+ @button_deselect_all = w
378
+ w.wdg_name = "button_deselect_all"
379
+ w.text = "alle Markierungen entfernen"
380
+ w.font = FX::Font.new.from_s("arial|90|0|0|0|0|0").to_FXFont
381
+ w.width = 200
382
+ w.y = 258
383
+ w.height = 23
384
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
385
+ w.layoutHints = 296
386
+ w.x = 216
387
+ }
388
+ FX::Packer.new(@verticalframe2) { |w|
389
+ @packer6 = w
390
+ w.wdg_name = "packer6"
391
+ w.width = 628
392
+ w.y = 280
393
+ w.height = 20
394
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
395
+ w.layoutHints = 1536
396
+ w.x = 2
397
+ }
398
+ FX::Button.new(@verticalframe2) { |w|
399
+ @button_print_selected = w
400
+ w.wdg_name = "button_print_selected"
401
+ w.text = "markierte drucken"
402
+ w.font = FX::Font.new.from_s("arial|90|0|0|0|0|0").to_FXFont
403
+ w.width = 200
404
+ w.y = 299
405
+ w.height = 23
406
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
407
+ w.layoutHints = 296
408
+ w.x = 216
409
+ }
410
+ FX::Button.new(@verticalframe2) { |w|
411
+ @button_print_all = w
412
+ w.wdg_name = "button_print_all"
413
+ w.text = "alle drucken"
414
+ w.font = FX::Font.new.from_s("arial|90|0|0|0|0|0").to_FXFont
415
+ w.width = 200
416
+ w.y = 319
417
+ w.height = 23
418
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
419
+ w.layoutHints = 296
420
+ w.x = 216
421
+ }
422
+ FX::Button.new(@verticalframe2) { |w|
423
+ @button_stop_printing = w
424
+ w.wdg_name = "button_stop_printing"
425
+ w.text = "anhalten"
426
+ w.tipText = "Druck anhalten"
427
+ w.font = FX::Font.new.from_s("arial|90|0|0|0|0|0").to_FXFont
428
+ w.width = 200
429
+ w.helpText = "Druck anhalten"
430
+ w.y = 340
431
+ w.height = 23
432
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
433
+ w.layoutHints = 296
434
+ w.x = 216
435
+ }
436
+ FX::Button.new(@verticalframe2) { |w|
437
+ @button_exit = w
438
+ w.wdg_name = "button_exit"
439
+ w.text = "beenden"
440
+ w.tipText = "Druckdialog schlie\303\237en"
441
+ w.font = FX::Font.new.from_s("arial|90|0|0|0|0|0").to_FXFont
442
+ w.width = 200
443
+ w.helpText = "Druckdialog schlie\303\237en"
444
+ w.y = 361
445
+ w.height = 23
446
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
447
+ w.layoutHints = 296
448
+ w.x = 216
449
+ }
450
+ }
451
+ FX::HorizontalFrame.new(@splitter2) { |w|
452
+ @horizontalframe3 = w
453
+ w.wdg_name = "horizontalframe3"
454
+ w.frameStyle = 16384
455
+ w.width = 632
456
+ w.y = 389
457
+ w.height = 211
458
+ w.shadowColor = Fox::FXRGBA(139, 137, 132, 255)
459
+ w.layoutHints = 1024
460
+ }
461
+ }
462
+ }
463
+ }
464
+ }
465
+ end
466
+ attr_reader :topwin
467
+ attr_reader :printDialogBox
468
+ attr_reader :splitter1
469
+ attr_reader :verticalframe_datalist
470
+ attr_reader :iconlist_data
471
+ attr_reader :horizontalframe4
472
+ attr_reader :button_top
473
+ attr_reader :button_prev
474
+ attr_reader :button_next
475
+ attr_reader :button_bottom
476
+ attr_reader :horizontalframe1
477
+ attr_reader :splitter2
478
+ attr_reader :verticalframe2
479
+ attr_reader :matrix2
480
+ attr_reader :label122
481
+ attr_reader :label_rows
482
+ attr_reader :label120
483
+ attr_reader :label12
484
+ attr_reader :textfield_print_from
485
+ attr_reader :label13
486
+ attr_reader :label14
487
+ attr_reader :textfield_print_to
488
+ attr_reader :label15
489
+ attr_reader :packer3
490
+ attr_reader :label16
491
+ attr_reader :label17
492
+ attr_reader :label18
493
+ attr_reader :textfield_search
494
+ attr_reader :button_search
495
+ attr_reader :packer4
496
+ attr_reader :label19
497
+ attr_reader :label20
498
+ attr_reader :label21
499
+ attr_reader :checkbutton2
500
+ attr_reader :label42
501
+ attr_reader :packer13
502
+ attr_reader :button_select_all
503
+ attr_reader :button_deselect_all
504
+ attr_reader :packer6
505
+ attr_reader :button_print_selected
506
+ attr_reader :button_print_all
507
+ attr_reader :button_stop_printing
508
+ attr_reader :button_exit
509
+ attr_reader :horizontalframe3
510
+ end
511
+
512
+ # unit test
513
+ if __FILE__ == $0
514
+ require "libGUIb16"
515
+ app = FX::App.new
516
+ w = PrintDialogBox.new app
517
+ w.topwin.show(Fox::PLACEMENT_SCREEN)
518
+ app.create
519
+ app.run
520
+ end
@@ -0,0 +1,148 @@
1
+ module Mcc2
2
+ module Printer
3
+ class Base
4
+ class PrintError < RuntimeError
5
+ end
6
+
7
+ class ResourceNotFoundError < PrintError
8
+ end
9
+
10
+ class InvalidBarcodeData < PrintError
11
+ end
12
+
13
+ class DpiDoesntMatch < PrintError
14
+ end
15
+
16
+ class Transformation
17
+ def initialize(x = 0.0, y = 0.0, a = 0.0)
18
+ @x = x
19
+ @y = y
20
+ @a = a
21
+ end
22
+
23
+ def translate(x, y)
24
+ self.class.new @x + x * Math.cos(@a * Math::PI / 180) - y * Math.sin(@a * Math::PI / 180),
25
+ @y + y * Math.cos(@a * Math::PI / 180) + x * Math.sin(@a * Math::PI / 180),
26
+ @a
27
+ end
28
+
29
+ # rotate by 'a' degree
30
+ def rotate(a)
31
+ self.class.new @x, @y, @a + a
32
+ end
33
+
34
+ def vector2d
35
+ Vector2d.new(@x, @y)
36
+ end
37
+
38
+ def inverse
39
+ i = self.class.new 0.0, 0.0, -a
40
+ i.translate(x, y).rotate(a)
41
+ end
42
+
43
+ attr_reader :x
44
+ attr_reader :y
45
+ attr_reader :a
46
+ end
47
+
48
+ class Vector2d
49
+ def initialize(x, y)
50
+ @x = x
51
+ @y = y
52
+ end
53
+
54
+ attr_reader :x
55
+ attr_reader :y
56
+ end
57
+
58
+ attr_reader :default_width
59
+ attr_reader :default_height
60
+ attr_reader :default_x_offset
61
+ attr_reader :default_y_offset
62
+ attr_reader :dpi
63
+ attr_accessor :layout_file
64
+
65
+ def initialize
66
+ @dpi = 300
67
+ @default_x_offset = 0.0
68
+ @default_y_offset = 0.0
69
+ end
70
+
71
+ def dpi=(v)
72
+ v = v.to_f
73
+ if layout_file
74
+ barcode_dpi = layout_file.get_attr_value(S_BARCODE_DPI).to_f
75
+ unless ((barcode_dpi - 0.009)..(barcode_dpi + 0.009)) === v
76
+ raise DpiDoesntMatch, I18n.t(:preview_dpi_and_print_differ, default: "Barcode-DPI in der Vorschau (%{preview_dpi}) und vom Druck (%{print_dpi}) sind verschieden. Bitte DPI anpassen und Barcodes neu prüfen!", preview_dpi: format("%0.1f", barcode_dpi), print_dpi: format("%0.1f", v))
77
+ end
78
+ end
79
+ @dpi = v
80
+ end
81
+
82
+ # mm to px
83
+ def mm(l)
84
+ @dpi / 25.4 * l
85
+ end
86
+
87
+ # points to px
88
+ def pt(l)
89
+ @dpi / 72.0 * l
90
+ end
91
+
92
+ def mm_to_pt(mm)
93
+ mm / 25.4 * 72.0
94
+ end
95
+
96
+ def px_to_mm(px)
97
+ px * 25.4 / @dpi
98
+ end
99
+
100
+ def print_page(hPrinter, layout_file, row, page_nr, page_width = default_width, page_height = default_height)
101
+ raise "not implemented"
102
+ end
103
+
104
+ def max_pages
105
+ 1
106
+ end
107
+
108
+ def can_duplex?
109
+ false
110
+ end
111
+
112
+ def has_magstripe_engine?
113
+ false
114
+ end
115
+ #--------------------------------------------------------------------------------------------------------------
116
+
117
+ def has_contactless_engine?
118
+ false
119
+ end
120
+ #--------------------------------------------------------------------------------------------------------------
121
+
122
+ def has_contact_engine?
123
+ false
124
+ end
125
+ #--------------------------------------------------------------------------------------------------------------
126
+
127
+ # dies ist nur ein Platzhalter, die eigentlichen Methoden müssen bei den jeweiligen Druckern definiert werden
128
+ def personalize_ms(hPrinter)
129
+ end
130
+ #--------------------------------------------------------------------------------------------------------------
131
+
132
+ def set_duplex(hPrinter, state)
133
+ raise "not implemented"
134
+ end
135
+
136
+ def svg_builder(**kwargs)
137
+ Nokogiri::XML::Builder.new do |svg|
138
+ svg.svg(xmlns: 'http://www.w3.org/2000/svg', **kwargs ) do
139
+ yield svg
140
+ end
141
+ end.to_xml(save_with: Nokogiri::XML::Node::SaveOptions::NO_DECLARATION)
142
+ end
143
+
144
+ def close
145
+ end
146
+ end
147
+ end
148
+ end
@@ -0,0 +1,45 @@
1
+ require "mcc2/printer/base" # die Basisklasse für die Printer
2
+
3
+ module Mcc2
4
+ module Printer
5
+ module CardPrinting
6
+ def default_width
7
+ LAYOUT_DEFAULT_WIDTH
8
+ end
9
+
10
+ def default_height
11
+ LAYOUT_DEFAULT_HEIGHT
12
+ end
13
+
14
+ def max_dpi
15
+ 300
16
+ end
17
+
18
+ # die Ränder außerhalb der Karte, auf den maximal gedruckt werden darf (für vollflächige Bilder notwendig)
19
+ #
20
+ def card_margin_left
21
+ 5.0
22
+ end
23
+
24
+ def card_margin_right
25
+ 5.0
26
+ end
27
+
28
+ def card_margin_top
29
+ 5.0
30
+ end
31
+
32
+ def card_margin_bottom
33
+ 5.0
34
+ end
35
+
36
+ def max_pages
37
+ 2
38
+ end
39
+ end
40
+
41
+ class CardPrinter < Base
42
+ include CardPrinting
43
+ end
44
+ end
45
+ end