glimmer-dsl-opal 0.20.1 → 0.21.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 +7 -0
- data/README.md +52 -2
- data/VERSION +1 -1
- data/lib/glimmer-dsl-opal/samples/hello/hello_scale.rb +55 -0
- data/lib/glimmer-dsl-opal/samples/hello/hello_slider.rb +56 -0
- data/lib/glimmer-dsl-opal/samples/hello/hello_spinner.rb +1 -1
- data/lib/glimmer/swt/scale_proxy.rb +98 -0
- data/lib/glimmer/swt/slider_proxy.rb +100 -0
- data/lib/glimmer/swt/spinner_proxy.rb +21 -2
- data/lib/glimmer/swt/text_proxy.rb +0 -1
- data/lib/glimmer/swt/widget_proxy.rb +16 -7
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4dbe9f418aaf69cea9d11235337a4915e0545e0fcded7591f5b8e04c7195721d
|
4
|
+
data.tar.gz: dabf17fe41390a4ea6d5f4d88d71c27782eaf0ef96948f67845d9d8ab8bdbc0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f84635205c0f8a86575fee0c1b72760052bb3722467196d067f469111f923d4195264ab4563bf3b5e37155d51e061d7d1f35f2b43acd77ca4d922ceabba4255
|
7
|
+
data.tar.gz: 6f6f984e402e801fe336448ab7997ac2dacb40d1fe2a05c35ae4a937394325b48de250c98e4cf6fde8313b3f6d73d88eab180520b889bdd9f146828565baf1af
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -143,7 +143,7 @@ Hello, Table! Game Booked
|
|
143
143
|
|
144
144
|
NOTE: Glimmer DSL for Opal is an alpha project. Please help make better by contributing, adopting for small or low risk projects, and providing feedback. It is still an early alpha, so the more feedback and issues you report the better.
|
145
145
|
|
146
|
-
**Alpha Version** 0.
|
146
|
+
**Alpha Version** 0.21.0 only supports bare-minimum capabilities for the included [samples](https://github.com/AndyObtiva/glimmer-dsl-opal#samples) (originally written for [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt))
|
147
147
|
|
148
148
|
Other [Glimmer](https://github.com/AndyObtiva/glimmer) DSL gems:
|
149
149
|
- [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt): Glimmer DSL for SWT (JRuby Desktop Development GUI Framework)
|
@@ -261,7 +261,7 @@ gem 'opal', '1.0.4'
|
|
261
261
|
gem 'opal-rails', '1.1.2'
|
262
262
|
gem 'opal-async', '~> 1.2.0'
|
263
263
|
gem 'opal-jquery', '~> 0.4.4'
|
264
|
-
gem 'glimmer-dsl-opal', '~> 0.
|
264
|
+
gem 'glimmer-dsl-opal', '~> 0.21.0'
|
265
265
|
gem 'glimmer-dsl-xml', '~> 1.2.0', require: false
|
266
266
|
gem 'glimmer-dsl-css', '~> 1.2.0', require: false
|
267
267
|
|
@@ -799,6 +799,56 @@ You should see "Hello, Arrow!"
|
|
799
799
|
|
800
800
|
![Glimmer DSL for Opal Hello Arrow](images/glimmer-dsl-opal-hello-arrow-item-selected.png)
|
801
801
|
|
802
|
+
#### Hello, Scale!
|
803
|
+
|
804
|
+
Add the following require statement to `app/assets/javascripts/application.rb`
|
805
|
+
|
806
|
+
```ruby
|
807
|
+
require 'glimmer-dsl-opal/samples/hello/hello_scale'
|
808
|
+
```
|
809
|
+
|
810
|
+
Glimmer app on the desktop (using [`glimmer-dsl-swt`](https://github.com/AndyObtiva/glimmer-dsl-swt) gem):
|
811
|
+
|
812
|
+
![Glimmer DSL for SWT Hello Scale](https://github.com/AndyObtiva/glimmer-dsl-swt/raw/master/images/glimmer-hello-scale.png)
|
813
|
+
|
814
|
+
Glimmer app on the web (using `glimmer-dsl-opal` gem):
|
815
|
+
|
816
|
+
Start the Rails server:
|
817
|
+
```
|
818
|
+
rails s
|
819
|
+
```
|
820
|
+
|
821
|
+
Visit `http://localhost:3000`
|
822
|
+
|
823
|
+
You should see "Hello, Scale!"
|
824
|
+
|
825
|
+
![Glimmer DSL for Opal Hello Scale](images/glimmer-dsl-opal-hello-scale.png)
|
826
|
+
|
827
|
+
#### Hello, Slider!
|
828
|
+
|
829
|
+
Add the following require statement to `app/assets/javascripts/application.rb`
|
830
|
+
|
831
|
+
```ruby
|
832
|
+
require 'glimmer-dsl-opal/samples/hello/hello_slider'
|
833
|
+
```
|
834
|
+
|
835
|
+
Glimmer app on the desktop (using [`glimmer-dsl-swt`](https://github.com/AndyObtiva/glimmer-dsl-swt) gem):
|
836
|
+
|
837
|
+
![Glimmer DSL for SWT Hello Slider](https://github.com/AndyObtiva/glimmer-dsl-swt/raw/master/images/glimmer-hello-slider.png)
|
838
|
+
|
839
|
+
Glimmer app on the web (using `glimmer-dsl-opal` gem):
|
840
|
+
|
841
|
+
Start the Rails server:
|
842
|
+
```
|
843
|
+
rails s
|
844
|
+
```
|
845
|
+
|
846
|
+
Visit `http://localhost:3000`
|
847
|
+
|
848
|
+
You should see "Hello, Slider!"
|
849
|
+
|
850
|
+
![Glimmer DSL for Opal Hello Slider](images/glimmer-dsl-opal-hello-slider.png)
|
851
|
+
|
802
852
|
#### Hello, Spinner!
|
803
853
|
|
804
854
|
Add the following require statement to `app/assets/javascripts/application.rb`
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.21.0
|
@@ -0,0 +1,55 @@
|
|
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
|
+
class HelloScale
|
23
|
+
include Glimmer::UI::CustomShell
|
24
|
+
|
25
|
+
attr_accessor :value
|
26
|
+
|
27
|
+
before_body do
|
28
|
+
@value = 50
|
29
|
+
end
|
30
|
+
|
31
|
+
body {
|
32
|
+
shell {
|
33
|
+
row_layout(:vertical) {
|
34
|
+
fill true
|
35
|
+
center true
|
36
|
+
}
|
37
|
+
|
38
|
+
text 'Hello, Scale!'
|
39
|
+
|
40
|
+
label(:center) {
|
41
|
+
text <= [self, :value]
|
42
|
+
}
|
43
|
+
|
44
|
+
scale { # optionally takes :vertical or :horizontal (default) SWT style
|
45
|
+
minimum 0
|
46
|
+
maximum 100
|
47
|
+
selection <=> [self, :value]
|
48
|
+
}
|
49
|
+
|
50
|
+
}
|
51
|
+
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
HelloScale.launch
|
@@ -0,0 +1,56 @@
|
|
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
|
+
class HelloSlider
|
23
|
+
include Glimmer::UI::CustomShell
|
24
|
+
|
25
|
+
attr_accessor :value
|
26
|
+
|
27
|
+
before_body do
|
28
|
+
@value = 50
|
29
|
+
end
|
30
|
+
|
31
|
+
body {
|
32
|
+
shell {
|
33
|
+
row_layout(:vertical) {
|
34
|
+
fill true
|
35
|
+
center true
|
36
|
+
}
|
37
|
+
|
38
|
+
text 'Hello, Slider!'
|
39
|
+
|
40
|
+
label(:center) {
|
41
|
+
text <= [self, :value]
|
42
|
+
}
|
43
|
+
|
44
|
+
slider { # optionally takes :vertical or :horizontal (default) SWT style
|
45
|
+
minimum 0
|
46
|
+
maximum 110 # leave room for 10 extra (slider stops at 100)
|
47
|
+
page_increment 10 # page increment occurs when clicking area between slider and beginning or end
|
48
|
+
selection <=> [self, :value]
|
49
|
+
}
|
50
|
+
|
51
|
+
}
|
52
|
+
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
HelloSlider.launch
|
@@ -0,0 +1,98 @@
|
|
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
|
+
require 'glimmer/swt/widget_proxy'
|
23
|
+
|
24
|
+
module Glimmer
|
25
|
+
module SWT
|
26
|
+
class ScaleProxy < WidgetProxy
|
27
|
+
attr_reader :selection, :minimum, :maximum, :increment
|
28
|
+
|
29
|
+
def initialize(parent, args, block)
|
30
|
+
super(parent, args, block)
|
31
|
+
dom_element.slider
|
32
|
+
end
|
33
|
+
|
34
|
+
def selection=(value)
|
35
|
+
old_value = @selection.to_f
|
36
|
+
@selection = value.to_f
|
37
|
+
dom_element.slider('option', 'value', @selection)
|
38
|
+
end
|
39
|
+
alias set_selection selection=
|
40
|
+
|
41
|
+
def minimum=(value)
|
42
|
+
@minimum = value.to_f
|
43
|
+
dom_element.slider('option', 'min', @minimum)
|
44
|
+
end
|
45
|
+
|
46
|
+
def maximum=(value)
|
47
|
+
@maximum = value.to_f
|
48
|
+
dom_element.slider('option', 'max', @maximum)
|
49
|
+
end
|
50
|
+
|
51
|
+
def increment=(value)
|
52
|
+
@increment = value.to_f
|
53
|
+
dom_element.slider('option', 'step', @increment)
|
54
|
+
end
|
55
|
+
|
56
|
+
def element
|
57
|
+
'div'
|
58
|
+
end
|
59
|
+
|
60
|
+
def observation_request_to_event_mapping
|
61
|
+
{
|
62
|
+
'on_widget_selected' => [
|
63
|
+
{
|
64
|
+
event: 'change',
|
65
|
+
event_handler: -> (event_listener) {
|
66
|
+
-> (event) {
|
67
|
+
self.selection = dom_element.slider('option', 'value')
|
68
|
+
event_listener.call(event)
|
69
|
+
}
|
70
|
+
}
|
71
|
+
},
|
72
|
+
{
|
73
|
+
event: 'slidestop',
|
74
|
+
event_handler: -> (event_listener) {
|
75
|
+
-> (event) {
|
76
|
+
self.selection = dom_element.slider('option', 'value')
|
77
|
+
event_listener.call(event)
|
78
|
+
}
|
79
|
+
}
|
80
|
+
},
|
81
|
+
],
|
82
|
+
}
|
83
|
+
end
|
84
|
+
|
85
|
+
def dom
|
86
|
+
scale_selection = @selection
|
87
|
+
scale_id = id
|
88
|
+
scale_style = css
|
89
|
+
scale_class = name
|
90
|
+
options = {type: 'text', id: scale_id, style: scale_style, class: scale_class, value: scale_selection}
|
91
|
+
options = options.merge('disabled': 'disabled') unless @enabled
|
92
|
+
@dom ||= html {
|
93
|
+
div(options)
|
94
|
+
}.to_s
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
@@ -0,0 +1,100 @@
|
|
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
|
+
require 'glimmer/swt/widget_proxy'
|
23
|
+
|
24
|
+
module Glimmer
|
25
|
+
module SWT
|
26
|
+
class SliderProxy < WidgetProxy
|
27
|
+
attr_reader :selection, :minimum, :maximum, :page_increment
|
28
|
+
|
29
|
+
def initialize(parent, args, block)
|
30
|
+
super(parent, args, block)
|
31
|
+
dom_element.slider
|
32
|
+
self.page_increment = 10 # default page increment
|
33
|
+
end
|
34
|
+
|
35
|
+
def selection=(value)
|
36
|
+
old_value = @selection.to_f
|
37
|
+
@selection = value.to_f
|
38
|
+
dom_element.slider('option', 'value', @selection)
|
39
|
+
end
|
40
|
+
alias set_selection selection=
|
41
|
+
|
42
|
+
def minimum=(value)
|
43
|
+
@minimum = value.to_f
|
44
|
+
dom_element.slider('option', 'min', @minimum)
|
45
|
+
end
|
46
|
+
|
47
|
+
def maximum=(value)
|
48
|
+
# being compatible with slider quirk in Glimmer DSL for SWT (does not reach max yet max - 10)
|
49
|
+
@maximum = value.to_f - 10
|
50
|
+
dom_element.slider('option', 'max', @maximum)
|
51
|
+
end
|
52
|
+
|
53
|
+
def page_increment=(value)
|
54
|
+
@page_increment = value.to_f
|
55
|
+
dom_element.slider('option', 'step', @page_increment)
|
56
|
+
end
|
57
|
+
|
58
|
+
def element
|
59
|
+
'div'
|
60
|
+
end
|
61
|
+
|
62
|
+
def observation_request_to_event_mapping
|
63
|
+
{
|
64
|
+
'on_widget_selected' => [
|
65
|
+
{
|
66
|
+
event: 'change',
|
67
|
+
event_handler: -> (event_listener) {
|
68
|
+
-> (event) {
|
69
|
+
self.selection = dom_element.slider('option', 'value')
|
70
|
+
event_listener.call(event)
|
71
|
+
}
|
72
|
+
}
|
73
|
+
},
|
74
|
+
{
|
75
|
+
event: 'slidestop',
|
76
|
+
event_handler: -> (event_listener) {
|
77
|
+
-> (event) {
|
78
|
+
self.selection = dom_element.slider('option', 'value')
|
79
|
+
event_listener.call(event)
|
80
|
+
}
|
81
|
+
}
|
82
|
+
},
|
83
|
+
],
|
84
|
+
}
|
85
|
+
end
|
86
|
+
|
87
|
+
def dom
|
88
|
+
slider_selection = @selection
|
89
|
+
slider_id = id
|
90
|
+
slider_style = css
|
91
|
+
slider_class = name
|
92
|
+
options = {type: 'text', id: slider_id, style: slider_style, class: slider_class, value: slider_selection}
|
93
|
+
options = options.merge('disabled': 'disabled') unless @enabled
|
94
|
+
@dom ||= html {
|
95
|
+
div(options)
|
96
|
+
}.to_s
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
@@ -1,3 +1,24 @@
|
|
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
|
+
|
1
22
|
require 'glimmer/swt/widget_proxy'
|
2
23
|
|
3
24
|
module Glimmer
|
@@ -179,10 +200,8 @@ module Glimmer
|
|
179
200
|
text_id = id
|
180
201
|
text_style = css
|
181
202
|
text_class = name
|
182
|
-
# TODO support password field
|
183
203
|
options = {type: 'text', id: text_id, style: text_style, class: text_class, value: text_text, style: 'min-width: 27px;'}
|
184
204
|
options = options.merge('disabled': 'disabled') unless @enabled
|
185
|
-
options = options.merge(type: 'password') if has_style?(:password)
|
186
205
|
@dom ||= html {
|
187
206
|
input(options)
|
188
207
|
}.to_s
|
@@ -81,7 +81,6 @@ module Glimmer
|
|
81
81
|
text_id = id
|
82
82
|
text_style = css
|
83
83
|
text_class = name
|
84
|
-
# TODO support password field
|
85
84
|
options = {type: 'text', id: text_id, style: text_style, class: text_class, value: text_text, style: 'min-width: 27px;'}
|
86
85
|
options = options.merge('disabled': 'disabled') unless @enabled
|
87
86
|
options = options.merge(type: 'password') if has_style?(:password)
|
@@ -851,6 +851,20 @@ module Glimmer
|
|
851
851
|
# }
|
852
852
|
# end,
|
853
853
|
# },
|
854
|
+
ScaleProxy => {
|
855
|
+
:selection => lambda do |observer|
|
856
|
+
on_widget_selected { |selection_event|
|
857
|
+
observer.call(selection)
|
858
|
+
}
|
859
|
+
end
|
860
|
+
},
|
861
|
+
SliderProxy => {
|
862
|
+
:selection => lambda do |observer|
|
863
|
+
on_widget_selected { |selection_event|
|
864
|
+
observer.call(selection)
|
865
|
+
}
|
866
|
+
end
|
867
|
+
},
|
854
868
|
SpinnerProxy => {
|
855
869
|
:selection => lambda do |observer|
|
856
870
|
on_widget_selected { |selection_event|
|
@@ -950,13 +964,6 @@ module Glimmer
|
|
950
964
|
# observer.call(getSelection)
|
951
965
|
# }
|
952
966
|
# end
|
953
|
-
# },
|
954
|
-
# Java::OrgEclipseSwtWidgets::Spinner => {
|
955
|
-
# :selection => lambda do |observer|
|
956
|
-
# on_widget_selected { |selection_event|
|
957
|
-
# observer.call(getSelection)
|
958
|
-
# }
|
959
|
-
# end
|
960
967
|
# },
|
961
968
|
}
|
962
969
|
end
|
@@ -990,7 +997,9 @@ require 'glimmer/swt/table_item_proxy'
|
|
990
997
|
require 'glimmer/swt/table_proxy'
|
991
998
|
require 'glimmer/swt/text_proxy'
|
992
999
|
require 'glimmer/swt/radio_proxy'
|
1000
|
+
require 'glimmer/swt/scale_proxy'
|
993
1001
|
require 'glimmer/swt/scrolled_composite_proxy'
|
1002
|
+
require 'glimmer/swt/slider_proxy'
|
994
1003
|
require 'glimmer/swt/spinner_proxy'
|
995
1004
|
require 'glimmer/swt/styled_text_proxy'
|
996
1005
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimmer-dsl-opal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.21.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AndyMaleh
|
@@ -307,6 +307,8 @@ files:
|
|
307
307
|
- lib/glimmer-dsl-opal/samples/hello/hello_pop_up_context_menu.rb
|
308
308
|
- lib/glimmer-dsl-opal/samples/hello/hello_radio.rb
|
309
309
|
- lib/glimmer-dsl-opal/samples/hello/hello_radio_group.rb
|
310
|
+
- lib/glimmer-dsl-opal/samples/hello/hello_scale.rb
|
311
|
+
- lib/glimmer-dsl-opal/samples/hello/hello_slider.rb
|
310
312
|
- lib/glimmer-dsl-opal/samples/hello/hello_spinner.rb
|
311
313
|
- lib/glimmer-dsl-opal/samples/hello/hello_tab.rb
|
312
314
|
- lib/glimmer-dsl-opal/samples/hello/hello_table.rb
|
@@ -419,8 +421,10 @@ files:
|
|
419
421
|
- lib/glimmer/swt/property_owner.rb
|
420
422
|
- lib/glimmer/swt/radio_proxy.rb
|
421
423
|
- lib/glimmer/swt/row_layout_proxy.rb
|
424
|
+
- lib/glimmer/swt/scale_proxy.rb
|
422
425
|
- lib/glimmer/swt/scrolled_composite_proxy.rb
|
423
426
|
- lib/glimmer/swt/shell_proxy.rb
|
427
|
+
- lib/glimmer/swt/slider_proxy.rb
|
424
428
|
- lib/glimmer/swt/spinner_proxy.rb
|
425
429
|
- lib/glimmer/swt/style_constantizable.rb
|
426
430
|
- lib/glimmer/swt/styled_text_proxy.rb
|