glimmer-dsl-swt 4.17.5.0 → 4.17.8.2

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 (41) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +30 -2
  3. data/README.md +250 -83
  4. data/VERSION +1 -1
  5. data/glimmer-dsl-swt.gemspec +20 -5
  6. data/lib/glimmer/data_binding/tree_items_binding.rb +20 -2
  7. data/lib/glimmer/dsl/swt/checkbox_group_selection_data_binding_expression.rb +61 -0
  8. data/lib/glimmer/dsl/swt/custom_widget_expression.rb +2 -0
  9. data/lib/glimmer/dsl/swt/dialog_expression.rb +1 -0
  10. data/lib/glimmer/dsl/swt/directory_dialog_expression.rb +48 -0
  11. data/lib/glimmer/dsl/swt/dsl.rb +2 -0
  12. data/lib/glimmer/dsl/swt/file_dialog_expression.rb +48 -0
  13. data/lib/glimmer/dsl/swt/radio_group_selection_data_binding_expression.rb +61 -0
  14. data/lib/glimmer/dsl/swt/shell_expression.rb +3 -3
  15. data/lib/glimmer/dsl/swt/widget_expression.rb +8 -8
  16. data/lib/glimmer/swt/custom/checkbox_group.rb +181 -0
  17. data/lib/glimmer/swt/custom/code_text.rb +39 -31
  18. data/lib/glimmer/swt/custom/radio_group.rb +176 -0
  19. data/lib/glimmer/swt/directory_dialog_proxy.rb +65 -0
  20. data/lib/glimmer/swt/expand_item_proxy.rb +0 -1
  21. data/lib/glimmer/swt/file_dialog_proxy.rb +66 -0
  22. data/lib/glimmer/swt/menu_proxy.rb +4 -4
  23. data/lib/glimmer/swt/shell_proxy.rb +5 -5
  24. data/lib/glimmer/swt/tab_item_proxy.rb +3 -3
  25. data/lib/glimmer/swt/widget_proxy.rb +27 -27
  26. data/lib/glimmer/ui/custom_shell.rb +3 -3
  27. data/lib/glimmer/ui/custom_widget.rb +3 -0
  28. data/samples/elaborate/meta_sample.rb +24 -19
  29. data/samples/hello/hello_checkbox.rb +85 -0
  30. data/samples/hello/hello_checkbox_group.rb +68 -0
  31. data/samples/hello/hello_combo.rb +12 -12
  32. data/samples/hello/hello_directory_dialog.rb +60 -0
  33. data/samples/hello/hello_expand_bar.rb +3 -1
  34. data/samples/hello/hello_file_dialog.rb +60 -0
  35. data/samples/hello/hello_group.rb +104 -0
  36. data/samples/hello/hello_list_multi_selection.rb +23 -23
  37. data/samples/hello/hello_list_single_selection.rb +18 -17
  38. data/samples/hello/hello_radio.rb +108 -0
  39. data/samples/hello/hello_radio_group.rb +84 -0
  40. data/samples/hello/hello_world.rb +3 -3
  41. metadata +19 -4
@@ -19,30 +19,30 @@
19
19
  # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
20
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
21
 
22
- class Person
23
- attr_accessor :provinces, :provinces_options
24
-
25
- def initialize
26
- self.provinces_options=[
27
- "",
28
- "Quebec",
29
- "Ontario",
30
- "Manitoba",
31
- "Saskatchewan",
32
- "Alberta",
33
- "British Columbia",
34
- "Nova Skotia",
35
- "Newfoundland"
36
- ]
37
- self.provinces = ["Quebec", "Manitoba", "Alberta"]
38
- end
39
-
40
- def reset_provinces
41
- self.provinces = ["Quebec", "Manitoba", "Alberta"]
42
- end
43
- end
44
-
45
22
  class HelloListMultiSelection
23
+ class Person
24
+ attr_accessor :provinces, :provinces_options
25
+
26
+ def initialize
27
+ self.provinces_options=[
28
+ "",
29
+ "Quebec",
30
+ "Ontario",
31
+ "Manitoba",
32
+ "Saskatchewan",
33
+ "Alberta",
34
+ "British Columbia",
35
+ "Nova Skotia",
36
+ "Newfoundland"
37
+ ]
38
+ self.provinces = ["Quebec", "Manitoba", "Alberta"]
39
+ end
40
+
41
+ def reset_provinces
42
+ self.provinces = ["Quebec", "Manitoba", "Alberta"]
43
+ end
44
+ end
45
+
46
46
  include Glimmer
47
47
 
48
48
  def launch
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2007-2020 Andy Maleh
2
- #
2
+ #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
5
5
  # "Software"), to deal in the Software without restriction, including
@@ -7,10 +7,10 @@
7
7
  # distribute, sublicense, and/or sell copies of the Software, and to
8
8
  # permit persons to whom the Software is furnished to do so, subject to
9
9
  # the following conditions:
10
- #
10
+ #
11
11
  # The above copyright notice and this permission notice shall be
12
12
  # included in all copies or substantial portions of the Software.
13
- #
13
+ #
14
14
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
15
  # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
16
  # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -19,21 +19,22 @@
19
19
  # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
20
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
21
 
22
- class Person
23
- attr_accessor :country, :country_options
24
-
25
- def initialize
26
- self.country_options=["", "Canada", "US", "Mexico"]
27
- self.country = "Canada"
28
- end
29
-
30
- def reset_country
31
- self.country = "Canada"
32
- end
33
- end
34
-
35
22
  class HelloListSingleSelection
23
+ class Person
24
+ attr_accessor :country, :country_options
25
+
26
+ def initialize
27
+ self.country_options=["", "Canada", "US", "Mexico"]
28
+ self.country = "Canada"
29
+ end
30
+
31
+ def reset_country
32
+ self.country = "Canada"
33
+ end
34
+ end
35
+
36
36
  include Glimmer
37
+
37
38
  def launch
38
39
  person = Person.new
39
40
 
@@ -55,4 +56,4 @@ class HelloListSingleSelection
55
56
  end
56
57
  end
57
58
 
58
- HelloListSingleSelection.new.launch
59
+ HelloListSingleSelection.new.launch
@@ -0,0 +1,108 @@
1
+ # Copyright (c) 2007-2020 Andy Maleh
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ class HelloRadio
23
+ class Person
24
+ attr_accessor :male, :female, :child, :teen, :adult, :senior
25
+
26
+ def initialize
27
+ reset
28
+ end
29
+
30
+ def reset
31
+ self.male = nil
32
+ self.female = nil
33
+ self.child = nil
34
+ self.teen = nil
35
+ self.adult = true
36
+ self.senior = nil
37
+ end
38
+ end
39
+
40
+ include Glimmer
41
+
42
+ def launch
43
+ person = Person.new
44
+
45
+ shell {
46
+ text 'Hello, Radio!'
47
+ row_layout :vertical
48
+
49
+ label {
50
+ text 'Gender:'
51
+ font style: :bold
52
+ }
53
+
54
+ composite {
55
+ row_layout
56
+
57
+ radio {
58
+ text 'Male'
59
+ selection bind(person, :male)
60
+ }
61
+
62
+ radio {
63
+ text 'Female'
64
+ selection bind(person, :female)
65
+ }
66
+ }
67
+
68
+ label {
69
+ text 'Age Group:'
70
+ font style: :bold
71
+ }
72
+
73
+ composite {
74
+ row_layout
75
+
76
+ radio {
77
+ text 'Child'
78
+ selection bind(person, :child)
79
+ }
80
+
81
+ radio {
82
+ text 'Teen'
83
+ selection bind(person, :teen)
84
+ }
85
+
86
+ radio {
87
+ text 'Adult'
88
+ selection bind(person, :adult)
89
+ }
90
+
91
+ radio {
92
+ text 'Senior'
93
+ selection bind(person, :senior)
94
+ }
95
+ }
96
+
97
+ button {
98
+ text 'Reset'
99
+
100
+ on_widget_selected do
101
+ person.reset
102
+ end
103
+ }
104
+ }.open
105
+ end
106
+ end
107
+
108
+ HelloRadio.new.launch
@@ -0,0 +1,84 @@
1
+ # Copyright (c) 2007-2020 Andy Maleh
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ class HelloRadioGroup
23
+ class Person
24
+ attr_accessor :gender, :age_group
25
+
26
+ def initialize
27
+ reset
28
+ end
29
+
30
+ def gender_options
31
+ ['Male', 'Female']
32
+ end
33
+
34
+ def age_group_options
35
+ ['Child', 'Teen', 'Adult', 'Senior']
36
+ end
37
+
38
+ def reset
39
+ self.gender = nil
40
+ self.age_group = 'Adult'
41
+ end
42
+ end
43
+
44
+ include Glimmer
45
+
46
+ def launch
47
+ person = Person.new
48
+
49
+ shell {
50
+ text 'Hello, Radio Group!'
51
+ row_layout :vertical
52
+
53
+ label {
54
+ text 'Gender:'
55
+ font style: :bold
56
+ }
57
+
58
+ radio_group {
59
+ row_layout :horizontal
60
+ selection bind(person, :gender)
61
+ }
62
+
63
+ label {
64
+ text 'Age Group:'
65
+ font style: :bold
66
+ }
67
+
68
+ radio_group {
69
+ row_layout :horizontal
70
+ selection bind(person, :age_group)
71
+ }
72
+
73
+ button {
74
+ text 'Reset'
75
+
76
+ on_widget_selected do
77
+ person.reset
78
+ end
79
+ }
80
+ }.open
81
+ end
82
+ end
83
+
84
+ HelloRadioGroup.new.launch
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2007-2020 Andy Maleh
2
- #
2
+ #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
5
5
  # "Software"), to deal in the Software without restriction, including
@@ -7,10 +7,10 @@
7
7
  # distribute, sublicense, and/or sell copies of the Software, and to
8
8
  # permit persons to whom the Software is furnished to do so, subject to
9
9
  # the following conditions:
10
- #
10
+ #
11
11
  # The above copyright notice and this permission notice shall be
12
12
  # included in all copies or substantial portions of the Software.
13
- #
13
+ #
14
14
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
15
  # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
16
  # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
metadata CHANGED
@@ -1,21 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-swt
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.17.5.0
4
+ version: 4.17.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - AndyMaleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-24 00:00:00.000000000 Z
11
+ date: 2020-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 1.0.1
18
+ version: 1.0.2
19
19
  name: glimmer
20
20
  prerelease: false
21
21
  type: :runtime
@@ -23,7 +23,7 @@ dependencies:
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.1
26
+ version: 1.0.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
@@ -345,6 +345,7 @@ files:
345
345
  - lib/glimmer/dsl/swt/async_exec_expression.rb
346
346
  - lib/glimmer/dsl/swt/bind_expression.rb
347
347
  - lib/glimmer/dsl/swt/block_property_expression.rb
348
+ - lib/glimmer/dsl/swt/checkbox_group_selection_data_binding_expression.rb
348
349
  - lib/glimmer/dsl/swt/color_expression.rb
349
350
  - lib/glimmer/dsl/swt/column_properties_expression.rb
350
351
  - lib/glimmer/dsl/swt/combo_selection_data_binding_expression.rb
@@ -352,11 +353,13 @@ files:
352
353
  - lib/glimmer/dsl/swt/custom_widget_expression.rb
353
354
  - lib/glimmer/dsl/swt/data_binding_expression.rb
354
355
  - lib/glimmer/dsl/swt/dialog_expression.rb
356
+ - lib/glimmer/dsl/swt/directory_dialog_expression.rb
355
357
  - lib/glimmer/dsl/swt/display_expression.rb
356
358
  - lib/glimmer/dsl/swt/dnd_expression.rb
357
359
  - lib/glimmer/dsl/swt/dsl.rb
358
360
  - lib/glimmer/dsl/swt/exec_expression.rb
359
361
  - lib/glimmer/dsl/swt/expand_item_expression.rb
362
+ - lib/glimmer/dsl/swt/file_dialog_expression.rb
360
363
  - lib/glimmer/dsl/swt/font_expression.rb
361
364
  - lib/glimmer/dsl/swt/image_expression.rb
362
365
  - lib/glimmer/dsl/swt/layout_data_expression.rb
@@ -367,6 +370,7 @@ files:
367
370
  - lib/glimmer/dsl/swt/message_box_expression.rb
368
371
  - lib/glimmer/dsl/swt/observe_expression.rb
369
372
  - lib/glimmer/dsl/swt/property_expression.rb
373
+ - lib/glimmer/dsl/swt/radio_group_selection_data_binding_expression.rb
370
374
  - lib/glimmer/dsl/swt/rgb_expression.rb
371
375
  - lib/glimmer/dsl/swt/rgba_expression.rb
372
376
  - lib/glimmer/dsl/swt/shell_expression.rb
@@ -385,10 +389,14 @@ files:
385
389
  - lib/glimmer/rake_task/scaffold.rb
386
390
  - lib/glimmer/swt/color_proxy.rb
387
391
  - lib/glimmer/swt/cursor_proxy.rb
392
+ - lib/glimmer/swt/custom/checkbox_group.rb
388
393
  - lib/glimmer/swt/custom/code_text.rb
394
+ - lib/glimmer/swt/custom/radio_group.rb
395
+ - lib/glimmer/swt/directory_dialog_proxy.rb
389
396
  - lib/glimmer/swt/display_proxy.rb
390
397
  - lib/glimmer/swt/dnd_proxy.rb
391
398
  - lib/glimmer/swt/expand_item_proxy.rb
399
+ - lib/glimmer/swt/file_dialog_proxy.rb
392
400
  - lib/glimmer/swt/font_proxy.rb
393
401
  - lib/glimmer/swt/image_proxy.rb
394
402
  - lib/glimmer/swt/layout_data_proxy.rb
@@ -422,18 +430,25 @@ files:
422
430
  - samples/elaborate/tic_tac_toe/cell.rb
423
431
  - samples/elaborate/user_profile.rb
424
432
  - samples/hello/hello_browser.rb
433
+ - samples/hello/hello_checkbox.rb
434
+ - samples/hello/hello_checkbox_group.rb
425
435
  - samples/hello/hello_combo.rb
426
436
  - samples/hello/hello_computed.rb
427
437
  - samples/hello/hello_computed/contact.rb
428
438
  - samples/hello/hello_custom_shell.rb
429
439
  - samples/hello/hello_custom_widget.rb
440
+ - samples/hello/hello_directory_dialog.rb
430
441
  - samples/hello/hello_drag_and_drop.rb
431
442
  - samples/hello/hello_expand_bar.rb
443
+ - samples/hello/hello_file_dialog.rb
444
+ - samples/hello/hello_group.rb
432
445
  - samples/hello/hello_list_multi_selection.rb
433
446
  - samples/hello/hello_list_single_selection.rb
434
447
  - samples/hello/hello_menu_bar.rb
435
448
  - samples/hello/hello_message_box.rb
436
449
  - samples/hello/hello_pop_up_context_menu.rb
450
+ - samples/hello/hello_radio.rb
451
+ - samples/hello/hello_radio_group.rb
437
452
  - samples/hello/hello_sash_form.rb
438
453
  - samples/hello/hello_styled_text.rb
439
454
  - samples/hello/hello_tab.rb