glimmer-dsl-swt 4.20.0.5 → 4.20.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/README.md +13 -7
  4. data/VERSION +1 -1
  5. data/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md +5 -2
  6. data/glimmer-dsl-swt.gemspec +0 -0
  7. data/lib/glimmer-dsl-swt.rb +1 -0
  8. data/lib/glimmer/data_binding/table_items_binding.rb +2 -2
  9. data/lib/glimmer/data_binding/tree_items_binding.rb +2 -2
  10. data/lib/glimmer/dsl/swt/bind_expression.rb +5 -25
  11. data/lib/glimmer/dsl/swt/custom_widget_expression.rb +1 -1
  12. data/lib/glimmer/dsl/swt/radio_group_selection_data_binding_expression.rb +1 -1
  13. data/lib/glimmer/dsl/swt/shine_data_binding_expression.rb +6 -5
  14. data/lib/glimmer/dsl/swt/table_items_data_binding_expression.rb +2 -2
  15. data/lib/glimmer/dsl/swt/tree_items_data_binding_expression.rb +17 -12
  16. data/lib/glimmer/rake_task/scaffold.rb +2 -2
  17. data/lib/glimmer/swt/custom/animation.rb +6 -0
  18. data/lib/glimmer/swt/custom/checkbox_group.rb +1 -1
  19. data/lib/glimmer/swt/custom/radio_group.rb +2 -1
  20. data/lib/glimmer/swt/proxy_properties.rb +7 -6
  21. data/lib/glimmer/swt/table_proxy.rb +15 -8
  22. data/lib/glimmer/swt/widget_proxy.rb +4 -1
  23. data/lib/glimmer/ui/custom_shape.rb +1 -1
  24. data/lib/glimmer/ui/custom_widget.rb +1 -1
  25. data/samples/elaborate/calculator.rb +1 -1
  26. data/samples/elaborate/contact_manager.rb +2 -2
  27. data/samples/elaborate/meta_sample.rb +5 -5
  28. data/samples/elaborate/tetris.rb +2 -2
  29. data/samples/elaborate/tetris/view/bevel.rb +11 -11
  30. data/samples/elaborate/tetris/view/block.rb +1 -1
  31. data/samples/elaborate/tetris/view/high_score_dialog.rb +4 -4
  32. data/samples/elaborate/tetris/view/score_lane.rb +3 -3
  33. data/samples/elaborate/tetris/view/tetris_menu_bar.rb +9 -9
  34. data/samples/elaborate/timer.rb +8 -8
  35. data/samples/hello/hello_canvas_animation_data_binding.rb +1 -1
  36. data/samples/hello/hello_checkbox_group.rb +1 -1
  37. data/samples/hello/hello_code_text.rb +3 -3
  38. data/samples/hello/hello_cool_bar.rb +1 -1
  39. data/samples/hello/hello_cursor.rb +1 -1
  40. data/samples/hello/hello_custom_shell.rb +1 -1
  41. data/samples/hello/hello_directory_dialog.rb +1 -1
  42. data/samples/hello/hello_radio_group.rb +2 -2
  43. data/samples/hello/hello_table.rb +4 -4
  44. data/samples/hello/hello_tool_bar.rb +1 -1
  45. data/samples/hello/hello_tree.rb +11 -11
  46. metadata +44 -25
  47. data/lib/glimmer/data_binding/shine.rb +0 -59
@@ -64,7 +64,7 @@ class HelloRadioGroup
64
64
 
65
65
  radio_group {
66
66
  row_layout :horizontal
67
- selection bind(@person, :gender)
67
+ selection <=> [@person, :gender]
68
68
  }
69
69
 
70
70
  label {
@@ -74,7 +74,7 @@ class HelloRadioGroup
74
74
 
75
75
  radio_group {
76
76
  row_layout :horizontal
77
- selection bind(@person, :age_group)
77
+ selection <=> [@person, :age_group]
78
78
  }
79
79
 
80
80
  button {
@@ -206,7 +206,7 @@ class HelloTable
206
206
 
207
207
  combo(:read_only) {
208
208
  layout_data :center, :center, true, false
209
- selection bind(BaseballGame, :playoff_type)
209
+ selection <=> [BaseballGame, :playoff_type]
210
210
  font height: 14
211
211
  }
212
212
 
@@ -247,10 +247,10 @@ class HelloTable
247
247
  }
248
248
 
249
249
  # Data-bind table items (rows) to a model collection property, specifying column properties ordering per nested model
250
- items bind(BaseballGame, :schedule), column_properties(:game_date, :game_time, :ballpark, :home_team, :away_team, :promotion)
250
+ items <=> [BaseballGame, :schedule, column_properties: [:game_date, :game_time, :ballpark, :home_team, :away_team, :promotion]]
251
251
 
252
252
  # Data-bind table selection
253
- selection bind(BaseballGame, :selected_game)
253
+ selection <=> [BaseballGame, :selected_game]
254
254
 
255
255
  # Default initial sort property
256
256
  sort_property :date
@@ -273,7 +273,7 @@ class HelloTable
273
273
  text 'Book Selected Game'
274
274
  layout_data :center, :center, true, false
275
275
  font height: 14
276
- enabled bind(BaseballGame, :selected_game)
276
+ enabled <= [BaseballGame, :selected_game]
277
277
 
278
278
  on_widget_selected {
279
279
  book_selected_game
@@ -71,7 +71,7 @@ class HelloToolBar
71
71
  }
72
72
  # a combo can be nested in a tool_bar (it auto-generates a tool_item for itself behind the scenes)
73
73
  combo {
74
- selection bind(self, :font_size)
74
+ selection <=> [self, :font_size]
75
75
  }
76
76
  }
77
77
 
@@ -314,8 +314,8 @@ class HelloTree
314
314
  margin_height 5
315
315
  }
316
316
  @tree = tree {
317
- items bind(Employee, :ceo), tree_properties(children: :subordinates, text: :to_s)
318
- selection bind(Employee, :selected_employee)
317
+ items <= [Employee, :ceo, tree_properties: {children: :subordinates, text: :to_s}]
318
+ selection <=> [Employee, :selected_employee]
319
319
  }
320
320
  }
321
321
 
@@ -329,7 +329,7 @@ class HelloTree
329
329
  }
330
330
  text {
331
331
  layout_data(:fill, :center, true, false)
332
- text bind(Employee, "selected_employee.first_name")
332
+ text <=> [Employee, "selected_employee.first_name"]
333
333
  font height: 16
334
334
  }
335
335
 
@@ -340,7 +340,7 @@ class HelloTree
340
340
  }
341
341
  text {
342
342
  layout_data(:fill, :center, true, false)
343
- text bind(Employee, "selected_employee.last_name")
343
+ text <=> [Employee, "selected_employee.last_name"]
344
344
  font height: 16
345
345
  }
346
346
 
@@ -351,7 +351,7 @@ class HelloTree
351
351
  }
352
352
  combo {
353
353
  layout_data(:fill, :center, true, false)
354
- selection bind(Employee, "selected_employee.position")
354
+ selection <=> [Employee, "selected_employee.position"]
355
355
  font height: 16
356
356
  }
357
357
 
@@ -373,7 +373,7 @@ class HelloTree
373
373
  spinner {
374
374
  maximum 999_999
375
375
  minimum 0
376
- selection bind(Employee, "selected_employee.salary")
376
+ selection <=> [Employee, "selected_employee.salary"]
377
377
  font height: 16
378
378
  }
379
379
  }
@@ -385,7 +385,7 @@ class HelloTree
385
385
  }
386
386
  combo(:read_only) {
387
387
  layout_data(:fill, :center, true, false)
388
- selection bind(Employee, "selected_employee.health_insurance")
388
+ selection <=> [Employee, "selected_employee.health_insurance"]
389
389
  font height: 16
390
390
  }
391
391
 
@@ -396,7 +396,7 @@ class HelloTree
396
396
  }
397
397
  combo(:read_only) {
398
398
  layout_data(:fill, :center, true, false)
399
- selection bind(Employee, "selected_employee.desk_location")
399
+ selection <=> [Employee, "selected_employee.desk_location"]
400
400
  font height: 16
401
401
  }
402
402
 
@@ -414,7 +414,7 @@ class HelloTree
414
414
  spinner {
415
415
  maximum 100
416
416
  minimum 0
417
- selection bind(Employee, "selected_employee.sales_bonus_percentage")
417
+ selection <=> [Employee, "selected_employee.sales_bonus_percentage"]
418
418
  font height: 16
419
419
  }
420
420
  label {
@@ -441,7 +441,7 @@ class HelloTree
441
441
  spinner {
442
442
  maximum 999_999
443
443
  minimum 0
444
- selection bind(Employee, "selected_employee.merit_bonus")
444
+ selection <=> [Employee, "selected_employee.merit_bonus"]
445
445
  font height: 16
446
446
  }
447
447
  }
@@ -467,7 +467,7 @@ class HelloTree
467
467
  maximum 999_999_00
468
468
  minimum 0
469
469
  increment 100
470
- selection bind(Employee, "selected_employee.#{attribute}", on_read: ->(v) {v.to_f * 100}, on_write: ->(v) {v.to_f / 100})
470
+ selection <=> [Employee, "selected_employee.#{attribute}", on_read: ->(v) {v.to_f * 100}, on_write: ->(v) {v.to_f / 100}]
471
471
  font height: 16
472
472
  }
473
473
  }
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.20.0.5
4
+ version: 4.20.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-05 00:00:00.000000000 Z
11
+ date: 2021-07-08 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.3.1
18
+ version: 2.0.0
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.3.1
26
+ version: 2.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
@@ -104,6 +104,46 @@ dependencies:
104
104
  - - "<"
105
105
  - !ruby/object:Gem::Version
106
106
  version: 2.0.0
107
+ - !ruby/object:Gem::Dependency
108
+ requirement: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: 1.1.7
113
+ - - "<"
114
+ - !ruby/object:Gem::Version
115
+ version: 2.0.0
116
+ name: concurrent-ruby
117
+ prerelease: false
118
+ type: :runtime
119
+ version_requirements: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: 1.1.7
124
+ - - "<"
125
+ - !ruby/object:Gem::Version
126
+ version: 2.0.0
127
+ - !ruby/object:Gem::Dependency
128
+ requirement: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: 0.8.5
133
+ - - "<"
134
+ - !ruby/object:Gem::Version
135
+ version: 2.0.0
136
+ name: jruby-win32ole
137
+ prerelease: false
138
+ type: :runtime
139
+ version_requirements: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - ">="
142
+ - !ruby/object:Gem::Version
143
+ version: 0.8.5
144
+ - - "<"
145
+ - !ruby/object:Gem::Version
146
+ version: 2.0.0
107
147
  - !ruby/object:Gem::Dependency
108
148
  requirement: !ruby/object:Gem::Requirement
109
149
  requirements:
@@ -198,26 +238,6 @@ dependencies:
198
238
  - - "<"
199
239
  - !ruby/object:Gem::Version
200
240
  version: 4.0.0
201
- - !ruby/object:Gem::Dependency
202
- requirement: !ruby/object:Gem::Requirement
203
- requirements:
204
- - - ">="
205
- - !ruby/object:Gem::Version
206
- version: 0.8.5
207
- - - "<"
208
- - !ruby/object:Gem::Version
209
- version: 2.0.0
210
- name: jruby-win32ole
211
- prerelease: false
212
- type: :runtime
213
- version_requirements: !ruby/object:Gem::Requirement
214
- requirements:
215
- - - ">="
216
- - !ruby/object:Gem::Version
217
- version: 0.8.5
218
- - - "<"
219
- - !ruby/object:Gem::Version
220
- version: 2.0.0
221
241
  - !ruby/object:Gem::Dependency
222
242
  requirement: !ruby/object:Gem::Requirement
223
243
  requirements:
@@ -390,7 +410,6 @@ files:
390
410
  - lib/glimmer/Rakefile
391
411
  - lib/glimmer/data_binding/list_selection_binding.rb
392
412
  - lib/glimmer/data_binding/observable_widget.rb
393
- - lib/glimmer/data_binding/shine.rb
394
413
  - lib/glimmer/data_binding/table_items_binding.rb
395
414
  - lib/glimmer/data_binding/tree_items_binding.rb
396
415
  - lib/glimmer/data_binding/widget_binding.rb
@@ -1,59 +0,0 @@
1
- # Copyright (c) 2007-2021 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
- module Glimmer
23
- module DataBinding
24
- class Shine
25
- include Glimmer
26
-
27
- def initialize(parent, parent_attribute)
28
- @parent = parent
29
- @parent_attribute = parent_attribute
30
- end
31
-
32
- alias original_compare <=>
33
-
34
- def <=>(other)
35
- if other.is_a?(Array)
36
- @parent.content {
37
- send(@parent_attribute, bind(*other))
38
- }
39
- else # || other.is_a?(Hash) # TODO support hash e.g. {model: model_obj, attribute: :some_attribute, more-options...}
40
- original_compare(other)
41
- end
42
- end
43
-
44
- def <=(other)
45
- if other.is_a?(Array)
46
- args_clone = other.clone
47
- if args_clone.last.is_a?(Hash)
48
- args_clone.last[:read_only] = true
49
- else # || other.is_a?(Hash) # TODO support hash e.g. {model: model_obj, attribute: :some_attribute, more-options...}
50
- args_clone << {read_only: true}
51
- end
52
- @parent.content {
53
- send(@parent_attribute, bind(*args_clone))
54
- }
55
- end
56
- end
57
- end
58
- end
59
- end