glimmer-dsl-opal 0.9.3 → 0.11.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 +28 -0
- data/LICENSE.txt +1 -1
- data/README.md +114 -49
- data/VERSION +1 -1
- data/lib/display.rb +1 -1
- data/lib/glimmer-dsl-opal.rb +3 -2
- data/lib/glimmer-dsl-opal/ext/file.rb +1 -1
- data/lib/glimmer-dsl-opal/ext/glimmer/dsl/engine.rb +8 -4
- data/lib/glimmer-dsl-opal/samples/elaborate/contact_manager/contact_repository.rb +4 -4
- data/lib/glimmer-dsl-opal/samples/elaborate/login.rb +7 -7
- data/lib/glimmer-dsl-opal/samples/elaborate/tic_tac_toe.rb +3 -3
- data/lib/glimmer-dsl-opal/samples/hello/hello_browser.rb +1 -1
- data/lib/glimmer-dsl-opal/samples/hello/hello_button.rb +2 -2
- data/lib/glimmer-dsl-opal/samples/hello/hello_checkbox.rb +5 -5
- data/lib/glimmer-dsl-opal/samples/hello/hello_checkbox_group.rb +1 -1
- data/lib/glimmer-dsl-opal/samples/hello/hello_combo.rb +2 -2
- data/lib/glimmer-dsl-opal/samples/hello/hello_computed.rb +6 -6
- data/lib/glimmer-dsl-opal/samples/hello/hello_computed/contact.rb +1 -1
- data/lib/glimmer-dsl-opal/samples/hello/hello_custom_shell.rb +1 -1
- data/lib/glimmer-dsl-opal/samples/hello/hello_custom_widget.rb +1 -1
- data/lib/glimmer-dsl-opal/samples/hello/hello_date_time.rb +5 -5
- data/lib/glimmer-dsl-opal/samples/hello/hello_dialog.rb +78 -0
- data/lib/glimmer-dsl-opal/samples/hello/hello_group.rb +7 -7
- data/lib/glimmer-dsl-opal/samples/hello/hello_list_multi_selection.rb +2 -2
- data/lib/glimmer-dsl-opal/samples/hello/hello_list_single_selection.rb +2 -2
- data/lib/glimmer-dsl-opal/samples/hello/hello_menu_bar.rb +1 -1
- data/lib/glimmer-dsl-opal/samples/hello/hello_message_box.rb +1 -1
- data/lib/glimmer-dsl-opal/samples/hello/hello_pop_up_context_menu.rb +1 -1
- data/lib/glimmer-dsl-opal/samples/hello/hello_radio.rb +7 -7
- data/lib/glimmer-dsl-opal/samples/hello/hello_radio_group.rb +1 -1
- data/lib/glimmer-dsl-opal/samples/hello/hello_tab.rb +1 -1
- data/lib/glimmer-dsl-opal/samples/hello/hello_table.rb +1 -1
- data/lib/glimmer-dsl-opal/samples/hello/hello_world.rb +1 -1
- data/lib/glimmer-dsl-swt.rb +1 -1
- data/lib/glimmer/data_binding/table_items_binding.rb +2 -1
- data/lib/glimmer/dsl/opal/async_exec_expression.rb +1 -1
- data/lib/glimmer/dsl/opal/bind_expression.rb +24 -25
- data/lib/glimmer/dsl/opal/block_property_expression.rb +1 -1
- data/lib/glimmer/dsl/opal/checkbox_group_selection_data_binding_expression.rb +1 -1
- data/lib/glimmer/dsl/opal/color_expression.rb +1 -1
- data/lib/glimmer/dsl/opal/custom_widget_expression.rb +7 -7
- data/lib/glimmer/dsl/opal/dialog_expression.rb +20 -0
- data/lib/glimmer/dsl/opal/display_expression.rb +1 -1
- data/lib/glimmer/dsl/opal/dsl.rb +5 -1
- data/lib/glimmer/dsl/opal/exec_expression.rb +1 -1
- data/lib/glimmer/dsl/opal/font_expression.rb +1 -1
- data/lib/glimmer/dsl/opal/menu_bar_expression.rb +1 -1
- data/lib/glimmer/dsl/opal/menu_expression.rb +2 -2
- data/lib/glimmer/dsl/opal/message_box_expression.rb +1 -1
- data/lib/glimmer/dsl/opal/property_expression.rb +2 -1
- data/lib/glimmer/dsl/opal/radio_group_selection_data_binding_expression.rb +1 -1
- data/lib/glimmer/dsl/opal/rgb_expression.rb +1 -1
- data/lib/glimmer/dsl/opal/rgba_expression.rb +1 -1
- data/lib/glimmer/dsl/opal/shape_expression.rb +26 -0
- data/lib/glimmer/dsl/opal/shell_expression.rb +1 -1
- data/lib/glimmer/dsl/opal/shine_data_binding_expression.rb +49 -0
- data/lib/glimmer/dsl/opal/swt_expression.rb +4 -4
- data/lib/glimmer/dsl/opal/sync_exec_expression.rb +1 -1
- data/lib/glimmer/dsl/opal/widget_expression.rb +1 -1
- data/lib/glimmer/swt.rb +1 -1
- data/lib/glimmer/swt/color_proxy.rb +1 -1
- data/lib/glimmer/swt/combo_proxy.rb +1 -0
- data/lib/glimmer/swt/composite_proxy.rb +18 -2
- data/lib/glimmer/swt/control_editor.rb +1 -1
- data/lib/glimmer/swt/custom/checkbox_group.rb +1 -1
- data/lib/glimmer/swt/custom/radio_group.rb +1 -1
- data/lib/glimmer/swt/dialog_proxy.rb +188 -0
- data/lib/glimmer/swt/display_proxy.rb +132 -9
- data/lib/glimmer/swt/font_proxy.rb +1 -1
- data/lib/glimmer/swt/grid_layout_proxy.rb +28 -33
- data/lib/glimmer/swt/label_proxy.rb +1 -1
- data/lib/glimmer/swt/latest_dialog_proxy.rb +44 -0
- data/lib/glimmer/swt/latest_message_box_proxy.rb +4 -2
- data/lib/glimmer/swt/latest_shell_proxy.rb +7 -3
- data/lib/glimmer/swt/layout_data_proxy.rb +4 -0
- data/lib/glimmer/swt/layout_proxy.rb +9 -6
- data/lib/glimmer/swt/make_shift_shell_proxy.rb +1 -1
- data/lib/glimmer/swt/menu_item_proxy.rb +1 -1
- data/lib/glimmer/swt/menu_proxy.rb +1 -1
- data/lib/glimmer/swt/message_box_proxy.rb +23 -17
- data/lib/glimmer/swt/row_layout_proxy.rb +34 -7
- data/lib/glimmer/swt/shell_proxy.rb +43 -9
- data/lib/glimmer/swt/style_constantizable.rb +1 -1
- data/lib/glimmer/swt/swt_proxy.rb +1 -1
- data/lib/glimmer/swt/tab_folder_proxy.rb +1 -1
- data/lib/glimmer/swt/table_editor.rb +1 -1
- data/lib/glimmer/swt/table_item_proxy.rb +1 -1
- data/lib/glimmer/swt/table_proxy.rb +1 -1
- data/lib/glimmer/swt/widget_proxy.rb +53 -21
- data/lib/glimmer/ui/custom_shell.rb +17 -3
- data/lib/glimmer/ui/custom_widget.rb +1 -1
- data/lib/glimmer/util/proc_tracker.rb +17 -6
- data/lib/net/http.rb +1 -1
- data/lib/os.rb +1 -1
- metadata +17 -11
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2020-2021 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
|
@@ -33,7 +33,7 @@ class HelloButton
|
|
33
33
|
text 'Hello, Button!'
|
34
34
|
|
35
35
|
button {
|
36
|
-
text
|
36
|
+
text <= [self, :count, on_read: ->(value) { "Click To Increment: #{value} " }]
|
37
37
|
|
38
38
|
on_widget_selected {
|
39
39
|
self.count += 1
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2020 Andy Maleh
|
1
|
+
# Copyright (c) 2020-2021 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
|
@@ -52,22 +52,22 @@ class HelloCheckbox
|
|
52
52
|
composite {
|
53
53
|
checkbox {
|
54
54
|
text 'Skiing'
|
55
|
-
selection
|
55
|
+
selection <=> [person, :skiing]
|
56
56
|
}
|
57
57
|
|
58
58
|
checkbox {
|
59
59
|
text 'Snowboarding'
|
60
|
-
selection
|
60
|
+
selection <=> [person, :snowboarding]
|
61
61
|
}
|
62
62
|
|
63
63
|
checkbox {
|
64
64
|
text 'Snowmobiling'
|
65
|
-
selection
|
65
|
+
selection <=> [person, :snowmobiling]
|
66
66
|
}
|
67
67
|
|
68
68
|
checkbox {
|
69
69
|
text 'Snowshoeing'
|
70
|
-
selection
|
70
|
+
selection <=> [person, :snowshoeing]
|
71
71
|
}
|
72
72
|
}
|
73
73
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2020 Andy Maleh
|
1
|
+
# Copyright (c) 2020-2021 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
|
@@ -46,7 +46,7 @@ class HelloCombo
|
|
46
46
|
text 'Hello, Combo!'
|
47
47
|
|
48
48
|
combo(:read_only) {
|
49
|
-
selection
|
49
|
+
selection <=> [person, :country]
|
50
50
|
}
|
51
51
|
|
52
52
|
button {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2020 Andy Maleh
|
1
|
+
# Copyright (c) 2020-2021 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
|
@@ -46,7 +46,7 @@ class HelloComputed
|
|
46
46
|
|
47
47
|
label {text 'First &Name: '}
|
48
48
|
text {
|
49
|
-
text
|
49
|
+
text <=> [@contact, :first_name]
|
50
50
|
layout_data {
|
51
51
|
horizontal_alignment :fill
|
52
52
|
grab_excess_horizontal_space true
|
@@ -55,7 +55,7 @@ class HelloComputed
|
|
55
55
|
|
56
56
|
label {text '&Last Name: '}
|
57
57
|
text {
|
58
|
-
text
|
58
|
+
text <=> [@contact, :last_name]
|
59
59
|
layout_data {
|
60
60
|
horizontal_alignment :fill
|
61
61
|
grab_excess_horizontal_space true
|
@@ -64,7 +64,7 @@ class HelloComputed
|
|
64
64
|
|
65
65
|
label {text '&Year of Birth: '}
|
66
66
|
text {
|
67
|
-
text
|
67
|
+
text <=> [@contact, :year_of_birth]
|
68
68
|
layout_data {
|
69
69
|
horizontal_alignment :fill
|
70
70
|
grab_excess_horizontal_space true
|
@@ -73,7 +73,7 @@ class HelloComputed
|
|
73
73
|
|
74
74
|
label {text 'Name: '}
|
75
75
|
label {
|
76
|
-
text
|
76
|
+
text <= [@contact, :name, computed_by: [:first_name, :last_name]]
|
77
77
|
layout_data {
|
78
78
|
horizontal_alignment :fill
|
79
79
|
grab_excess_horizontal_space true
|
@@ -82,7 +82,7 @@ class HelloComputed
|
|
82
82
|
|
83
83
|
label {text 'Age: '}
|
84
84
|
label {
|
85
|
-
text
|
85
|
+
text <= [@contact, :age, on_write: :to_i, computed_by: [:year_of_birth]]
|
86
86
|
layout_data {
|
87
87
|
horizontal_alignment :fill
|
88
88
|
grab_excess_horizontal_space true
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2020 Andy Maleh
|
1
|
+
# Copyright (c) 2020-2021 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
|
@@ -42,19 +42,19 @@ class HelloDateTime
|
|
42
42
|
}
|
43
43
|
|
44
44
|
date { # alias for date_time(:date)
|
45
|
-
date_time
|
45
|
+
date_time <=> [person, :date_of_birth]
|
46
46
|
}
|
47
47
|
|
48
48
|
date_drop_down { # alias for date_time(:date, :drop_down)
|
49
|
-
date_time
|
49
|
+
date_time <=> [person, :date_of_birth]
|
50
50
|
}
|
51
51
|
|
52
52
|
time { # alias for date_time(:time)
|
53
|
-
date_time
|
53
|
+
date_time <=> [person, :date_of_birth]
|
54
54
|
}
|
55
55
|
|
56
56
|
calendar { # alias for date_time(:calendar)
|
57
|
-
date_time
|
57
|
+
date_time <=> [person, :date_of_birth]
|
58
58
|
}
|
59
59
|
}.open
|
60
60
|
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# Copyright (c) 2020-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
|
+
include Glimmer
|
23
|
+
|
24
|
+
shell {
|
25
|
+
row_layout :vertical
|
26
|
+
|
27
|
+
text 'Hello, Dialog!'
|
28
|
+
|
29
|
+
7.times { |n|
|
30
|
+
dialog_number = n + 1
|
31
|
+
|
32
|
+
button {
|
33
|
+
layout_data {
|
34
|
+
width 200
|
35
|
+
height 50
|
36
|
+
}
|
37
|
+
text "Dialog #{dialog_number}"
|
38
|
+
|
39
|
+
on_widget_selected {
|
40
|
+
dialog { |dialog_proxy|
|
41
|
+
row_layout(:vertical) {
|
42
|
+
center true
|
43
|
+
}
|
44
|
+
|
45
|
+
text "Dialog #{dialog_number}"
|
46
|
+
|
47
|
+
label {
|
48
|
+
text "Given `dialog` is modal, you cannot interact with the main window till the dialog is closed."
|
49
|
+
}
|
50
|
+
composite {
|
51
|
+
row_layout {
|
52
|
+
margin_height 0
|
53
|
+
margin_top 0
|
54
|
+
margin_bottom 0
|
55
|
+
}
|
56
|
+
|
57
|
+
label {
|
58
|
+
text "Unlike `message_box`, `dialog` can contain arbitrary widgets:"
|
59
|
+
}
|
60
|
+
radio {
|
61
|
+
text 'Radio'
|
62
|
+
}
|
63
|
+
checkbox {
|
64
|
+
text 'Checkbox'
|
65
|
+
}
|
66
|
+
}
|
67
|
+
button {
|
68
|
+
text 'Close'
|
69
|
+
|
70
|
+
on_widget_selected {
|
71
|
+
dialog_proxy.close
|
72
|
+
}
|
73
|
+
}
|
74
|
+
}.open
|
75
|
+
}
|
76
|
+
}
|
77
|
+
}
|
78
|
+
}.open
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2020 Andy Maleh
|
1
|
+
# Copyright (c) 2020-2021 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
|
@@ -54,12 +54,12 @@ class HelloGroup
|
|
54
54
|
|
55
55
|
radio {
|
56
56
|
text 'Male'
|
57
|
-
selection
|
57
|
+
selection <=> [person, :male]
|
58
58
|
}
|
59
59
|
|
60
60
|
radio {
|
61
61
|
text 'Female'
|
62
|
-
selection
|
62
|
+
selection <=> [person, :female]
|
63
63
|
}
|
64
64
|
}
|
65
65
|
|
@@ -71,22 +71,22 @@ class HelloGroup
|
|
71
71
|
|
72
72
|
radio {
|
73
73
|
text 'Child'
|
74
|
-
selection
|
74
|
+
selection <=> [person, :child]
|
75
75
|
}
|
76
76
|
|
77
77
|
radio {
|
78
78
|
text 'Teen'
|
79
|
-
selection
|
79
|
+
selection <=> [person, :teen]
|
80
80
|
}
|
81
81
|
|
82
82
|
radio {
|
83
83
|
text 'Adult'
|
84
|
-
selection
|
84
|
+
selection <=> [person, :adult]
|
85
85
|
}
|
86
86
|
|
87
87
|
radio {
|
88
88
|
text 'Senior'
|
89
|
-
selection
|
89
|
+
selection <=> [person, :senior]
|
90
90
|
}
|
91
91
|
}
|
92
92
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2020 Andy Maleh
|
1
|
+
# Copyright (c) 2020-2021 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
|
@@ -59,7 +59,7 @@ class HelloListMultiSelection
|
|
59
59
|
text 'Hello, List Multi Selection!'
|
60
60
|
|
61
61
|
list(:multi) {
|
62
|
-
selection
|
62
|
+
selection <=> [person, :provinces]
|
63
63
|
}
|
64
64
|
|
65
65
|
button {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c)
|
1
|
+
# Copyright (c) 2020-2021 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
|
@@ -44,7 +44,7 @@ class HelloListSingleSelection
|
|
44
44
|
text 'Hello, List Single Selection!'
|
45
45
|
|
46
46
|
list {
|
47
|
-
selection
|
47
|
+
selection <=> [person, :country]
|
48
48
|
}
|
49
49
|
|
50
50
|
button {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (c) 2020 Andy Maleh
|
1
|
+
# Copyright (c) 2020-2021 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
|
@@ -56,12 +56,12 @@ class HelloRadio
|
|
56
56
|
|
57
57
|
radio {
|
58
58
|
text 'Male'
|
59
|
-
selection
|
59
|
+
selection <=> [person, :male]
|
60
60
|
}
|
61
61
|
|
62
62
|
radio {
|
63
63
|
text 'Female'
|
64
|
-
selection
|
64
|
+
selection <=> [person, :female]
|
65
65
|
}
|
66
66
|
}
|
67
67
|
|
@@ -75,22 +75,22 @@ class HelloRadio
|
|
75
75
|
|
76
76
|
radio {
|
77
77
|
text 'Child'
|
78
|
-
selection
|
78
|
+
selection <=> [person, :child]
|
79
79
|
}
|
80
80
|
|
81
81
|
radio {
|
82
82
|
text 'Teen'
|
83
|
-
selection
|
83
|
+
selection <=> [person, :teen]
|
84
84
|
}
|
85
85
|
|
86
86
|
radio {
|
87
87
|
text 'Adult'
|
88
|
-
selection
|
88
|
+
selection <=> [person, :adult]
|
89
89
|
}
|
90
90
|
|
91
91
|
radio {
|
92
92
|
text 'Senior'
|
93
|
-
selection
|
93
|
+
selection <=> [person, :senior]
|
94
94
|
}
|
95
95
|
}
|
96
96
|
|
data/lib/glimmer-dsl-swt.rb
CHANGED
@@ -11,10 +11,11 @@ module Glimmer
|
|
11
11
|
include DataBinding::Observable
|
12
12
|
include DataBinding::Observer
|
13
13
|
|
14
|
-
def initialize(parent, model_binding, column_properties)
|
14
|
+
def initialize(parent, model_binding, column_properties = nil)
|
15
15
|
@last_populated_model_collection = nil
|
16
16
|
@table = parent
|
17
17
|
@model_binding = model_binding
|
18
|
+
# @column_properties = model_binding.binding_options[:column_attributes] || model_binding.binding_options[:column_properties] || column_properties # TODO
|
18
19
|
@column_properties = column_properties
|
19
20
|
@table.data = @model_binding
|
20
21
|
##@table.on_widget_disposed do |dispose_event| # doesn't seem needed within Opal
|