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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -0
- data/README.md +13 -7
- data/VERSION +1 -1
- data/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md +5 -2
- data/glimmer-dsl-swt.gemspec +0 -0
- data/lib/glimmer-dsl-swt.rb +1 -0
- data/lib/glimmer/data_binding/table_items_binding.rb +2 -2
- data/lib/glimmer/data_binding/tree_items_binding.rb +2 -2
- data/lib/glimmer/dsl/swt/bind_expression.rb +5 -25
- data/lib/glimmer/dsl/swt/custom_widget_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/radio_group_selection_data_binding_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/shine_data_binding_expression.rb +6 -5
- data/lib/glimmer/dsl/swt/table_items_data_binding_expression.rb +2 -2
- data/lib/glimmer/dsl/swt/tree_items_data_binding_expression.rb +17 -12
- data/lib/glimmer/rake_task/scaffold.rb +2 -2
- data/lib/glimmer/swt/custom/animation.rb +6 -0
- data/lib/glimmer/swt/custom/checkbox_group.rb +1 -1
- data/lib/glimmer/swt/custom/radio_group.rb +2 -1
- data/lib/glimmer/swt/proxy_properties.rb +7 -6
- data/lib/glimmer/swt/table_proxy.rb +15 -8
- data/lib/glimmer/swt/widget_proxy.rb +4 -1
- data/lib/glimmer/ui/custom_shape.rb +1 -1
- data/lib/glimmer/ui/custom_widget.rb +1 -1
- data/samples/elaborate/calculator.rb +1 -1
- data/samples/elaborate/contact_manager.rb +2 -2
- data/samples/elaborate/meta_sample.rb +5 -5
- data/samples/elaborate/tetris.rb +2 -2
- data/samples/elaborate/tetris/view/bevel.rb +11 -11
- data/samples/elaborate/tetris/view/block.rb +1 -1
- data/samples/elaborate/tetris/view/high_score_dialog.rb +4 -4
- data/samples/elaborate/tetris/view/score_lane.rb +3 -3
- data/samples/elaborate/tetris/view/tetris_menu_bar.rb +9 -9
- data/samples/elaborate/timer.rb +8 -8
- data/samples/hello/hello_canvas_animation_data_binding.rb +1 -1
- data/samples/hello/hello_checkbox_group.rb +1 -1
- data/samples/hello/hello_code_text.rb +3 -3
- data/samples/hello/hello_cool_bar.rb +1 -1
- data/samples/hello/hello_cursor.rb +1 -1
- data/samples/hello/hello_custom_shell.rb +1 -1
- data/samples/hello/hello_directory_dialog.rb +1 -1
- data/samples/hello/hello_radio_group.rb +2 -2
- data/samples/hello/hello_table.rb +4 -4
- data/samples/hello/hello_tool_bar.rb +1 -1
- data/samples/hello/hello_tree.rb +11 -11
- metadata +44 -25
- 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
|
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
|
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
|
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
|
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
|
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
|
276
|
+
enabled <= [BaseballGame, :selected_game]
|
277
277
|
|
278
278
|
on_widget_selected {
|
279
279
|
book_selected_game
|
data/samples/hello/hello_tree.rb
CHANGED
@@ -314,8 +314,8 @@ class HelloTree
|
|
314
314
|
margin_height 5
|
315
315
|
}
|
316
316
|
@tree = tree {
|
317
|
-
items
|
318
|
-
selection
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
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-
|
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:
|
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:
|
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
|