glimmer-dsl-opal 0.17.0 → 0.18.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 +5 -0
- data/README.md +4 -4
- data/VERSION +1 -1
- data/lib/glimmer-dsl-opal/samples/hello/hello_c_combo.rb +67 -0
- data/lib/glimmer/swt/c_combo_proxy.rb +51 -0
- data/lib/glimmer/swt/combo_proxy.rb +3 -0
- data/lib/glimmer/swt/widget_proxy.rb +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ab5de6b12c9bf8235c4be10e8dd721c49e529a73febec568959dcbd7820f463
|
4
|
+
data.tar.gz: 706a679e3791114993c964a43d54332b7941f30c513ae4f03c5ce114c2b97014
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dd624ce1693ec8094b8518b0c9c1f73c3362cbca7e72d03313baeac082413b4cbea245ec2593cb8e70296e11651bb20cd14f16ddb003091ef1da18f48bae044
|
7
|
+
data.tar.gz: cc6b2ea990fedec4b9bd70e8b5a030117a5d8cb828d9ca65c23055e4b90af9e2360dff795c22d44650083a1ec6aca6b61e408f87def3e4fea17986372cb004d3
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for Opal
|
1
|
+
# [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for Opal [Alpha] (Pure Ruby Web GUI)
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/glimmer-dsl-opal.svg)](http://badge.fury.io/rb/glimmer-dsl-opal)
|
3
3
|
[![Join the chat at https://gitter.im/AndyObtiva/glimmer](https://badges.gitter.im/AndyObtiva/glimmer.svg)](https://gitter.im/AndyObtiva/glimmer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
4
4
|
|
@@ -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.18.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)
|
@@ -153,7 +153,7 @@ Other [Glimmer](https://github.com/AndyObtiva/glimmer) DSL gems:
|
|
153
153
|
|
154
154
|
## Table of Contents
|
155
155
|
|
156
|
-
- [Glimmer DSL for Opal
|
156
|
+
- [Glimmer DSL for Opal [Alpha] (Pure Ruby Web GUI)](#-glimmer-dsl-for-opal-alpha-pure-ruby-web-gui)
|
157
157
|
- [Principles](#principles)
|
158
158
|
- [Background](#background)
|
159
159
|
- [Pre-requisites](#pre-requisites)
|
@@ -257,7 +257,7 @@ gem 'opal', '1.0.4'
|
|
257
257
|
gem 'opal-rails', '1.1.2'
|
258
258
|
gem 'opal-async', '~> 1.2.0'
|
259
259
|
gem 'opal-jquery', '~> 0.4.4'
|
260
|
-
gem 'glimmer-dsl-opal', '~> 0.
|
260
|
+
gem 'glimmer-dsl-opal', '~> 0.18.0'
|
261
261
|
gem 'glimmer-dsl-xml', '~> 1.2.0', require: false
|
262
262
|
gem 'glimmer-dsl-css', '~> 1.2.0', require: false
|
263
263
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.18.0
|
@@ -0,0 +1,67 @@
|
|
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
|
+
# This is a sample for the c_combo widget, a more customizable version of combo
|
23
|
+
class HelloCCombo
|
24
|
+
class Person
|
25
|
+
attr_accessor :country, :country_options
|
26
|
+
|
27
|
+
def initialize
|
28
|
+
self.country_options = ['', 'Canada', 'US', 'Mexico']
|
29
|
+
reset_country!
|
30
|
+
end
|
31
|
+
|
32
|
+
def reset_country!
|
33
|
+
self.country = 'Canada'
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
include Glimmer::UI::CustomShell
|
38
|
+
|
39
|
+
before_body do
|
40
|
+
@person = Person.new
|
41
|
+
end
|
42
|
+
|
43
|
+
body {
|
44
|
+
shell {
|
45
|
+
row_layout(:vertical) {
|
46
|
+
fill true
|
47
|
+
}
|
48
|
+
|
49
|
+
text 'Hello, C Combo!'
|
50
|
+
|
51
|
+
c_combo(:read_only) {
|
52
|
+
selection <=> [@person, :country] # also binds to country_options by convention
|
53
|
+
font height: 45 # unlike `combo`, `c_combo` changes height when setting the font height
|
54
|
+
}
|
55
|
+
|
56
|
+
button {
|
57
|
+
text 'Reset Selection'
|
58
|
+
|
59
|
+
on_widget_selected do
|
60
|
+
@person.reset_country!
|
61
|
+
end
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
67
|
+
HelloCCombo.launch
|
@@ -0,0 +1,51 @@
|
|
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
|
+
require 'glimmer/swt/combo_proxy'
|
24
|
+
|
25
|
+
module Glimmer
|
26
|
+
module SWT
|
27
|
+
class CComboProxy < ComboProxy
|
28
|
+
def post_add_content
|
29
|
+
`$(#{path}).selectmenu()`
|
30
|
+
c_combo_dom_element.css('width', 'initial')
|
31
|
+
end
|
32
|
+
|
33
|
+
def font=(value)
|
34
|
+
@font = value.is_a?(FontProxy) ? value : FontProxy.new(self, value)
|
35
|
+
c_combo_dom_element.css('font-family', @font.name) unless @font.nil?
|
36
|
+
c_combo_dom_element.css('font-style', 'italic') if @font&.style == :italic
|
37
|
+
c_combo_dom_element.css('font-weight', 'bold') if @font&.style == :bold
|
38
|
+
c_combo_dom_element.css('font-size', "#{@font.height}px") unless @font.nil?
|
39
|
+
end
|
40
|
+
|
41
|
+
def c_combo_path
|
42
|
+
"##{id}-button"
|
43
|
+
end
|
44
|
+
|
45
|
+
def c_combo_dom_element
|
46
|
+
Document.find(c_combo_path)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
@@ -962,6 +962,7 @@ require 'glimmer/swt/browser_proxy'
|
|
962
962
|
require 'glimmer/swt/button_proxy'
|
963
963
|
require 'glimmer/swt/arrow_proxy'
|
964
964
|
require 'glimmer/swt/combo_proxy'
|
965
|
+
require 'glimmer/swt/c_combo_proxy'
|
965
966
|
require 'glimmer/swt/checkbox_proxy'
|
966
967
|
require 'glimmer/swt/composite_proxy'
|
967
968
|
require 'glimmer/swt/dialog_proxy'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AndyMaleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-08-
|
11
|
+
date: 2021-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glimmer
|
@@ -287,6 +287,7 @@ files:
|
|
287
287
|
- lib/glimmer-dsl-opal/samples/hello/hello_arrow.rb
|
288
288
|
- lib/glimmer-dsl-opal/samples/hello/hello_browser.rb
|
289
289
|
- lib/glimmer-dsl-opal/samples/hello/hello_button.rb
|
290
|
+
- lib/glimmer-dsl-opal/samples/hello/hello_c_combo.rb
|
290
291
|
- lib/glimmer-dsl-opal/samples/hello/hello_checkbox.rb
|
291
292
|
- lib/glimmer-dsl-opal/samples/hello/hello_checkbox_group.rb
|
292
293
|
- lib/glimmer-dsl-opal/samples/hello/hello_combo.rb
|
@@ -374,6 +375,7 @@ files:
|
|
374
375
|
- lib/glimmer/swt/arrow_proxy.rb
|
375
376
|
- lib/glimmer/swt/browser_proxy.rb
|
376
377
|
- lib/glimmer/swt/button_proxy.rb
|
378
|
+
- lib/glimmer/swt/c_combo_proxy.rb
|
377
379
|
- lib/glimmer/swt/checkbox_proxy.rb
|
378
380
|
- lib/glimmer/swt/color_proxy.rb
|
379
381
|
- lib/glimmer/swt/combo_proxy.rb
|