glimmer-dsl-swt 4.20.14.1 → 4.20.14.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec68532348a4c8220d559e24a66c7cc99267435e0b72c4f8a679892dd7694f25
4
- data.tar.gz: aa9aa58f9016734f4fa8357c6002f8be6243e474163b612922cc7127bd349dd9
3
+ metadata.gz: 3563ef87997628bd87b78de0900279aefcde38f911e2be4a786dfd8a48d5c2f7
4
+ data.tar.gz: aab8501a3e614bafa0cf6e9cbae5b326dd0d9acdeb201a41799734f7d322bbae
5
5
  SHA512:
6
- metadata.gz: 0e8174b81dd1ce045649be34d1c46507020b659904fb981c51175920c0909d1bfa1f68d3e9087a3fe6c3d7509da030abe166bbbb4eea44d297a6ad1fc93c33f7
7
- data.tar.gz: 698085d81b8f2e071101fcb0ed58a5b14a346a80f15ad3a195048278a54737c1550e3cc4007a4c75649fef23689e25b2f8721ab66fb40300d9d3c76f47a71078
6
+ metadata.gz: 660347ec9199923ab6b12021b5bc920b83cacc67f76f50f883ace45b5cb3fb2523638a513b45e33bcea250fdd69376d508db26de69534662dfdcd6e5dd524a30
7
+ data.tar.gz: 4f490bd3cf9035acf624e83dfd0a071385796d4cebcacb205bdd9c3113f96d7f7ca9c0e625ffaed96c8a17fa4d78b04153eb6d0bc1ef7fc269c29334bd679f52
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 SWT 4.20.14.1
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 SWT 4.20.14.2
2
2
  ## JRuby Desktop Development GUI Framework
3
3
  [![Gem Version](https://badge.fury.io/rb/glimmer-dsl-swt.svg)](http://badge.fury.io/rb/glimmer-dsl-swt)
4
4
  [![Travis CI](https://travis-ci.com/AndyObtiva/glimmer-dsl-swt.svg?branch=master)](https://travis-ci.com/github/AndyObtiva/glimmer-dsl-swt)
@@ -15,7 +15,7 @@
15
15
  [<img src="https://covers.oreillystatic.com/images/9780596519650/lrg.jpg" width=105 /><br />
16
16
  Featured in JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.do) and [Chalmers/Gothenburg University Software Engineering Master's Lecture Material](http://www.cse.chalmers.se/~bergert/slides/guest_lecture_DSLs.pdf)
17
17
 
18
- [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.20.14.1 includes [SWT 4.20](https://download.eclipse.org/eclipse/downloads/drops4/R-4.20-202106111600/), which was released on June 11, 2021. Gem version numbers are in sync with the SWT library versions. The first two digits represent the SWT version number. The last two digits represent the minor and patch versions of Glimmer DSL for SWT. Note that SWT now supports AARCH64 on Mac and Linux, but it is not fully tested in Glimmer DSL for SWT yet, so deem its support experimental for the time being without guarantees for functionality until declared otherwise (please report any issues you may encounter).
18
+ [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.20.14.2 includes [SWT 4.20](https://download.eclipse.org/eclipse/downloads/drops4/R-4.20-202106111600/), which was released on June 11, 2021. Gem version numbers are in sync with the SWT library versions. The first two digits represent the SWT version number. The last two digits represent the minor and patch versions of Glimmer DSL for SWT. Note that SWT now supports AARCH64 on Mac and Linux, but it is not fully tested in Glimmer DSL for SWT yet, so deem its support experimental for the time being without guarantees for functionality until declared otherwise (please report any issues you may encounter).
19
19
 
20
20
  **Starting in version 4.20.0.0, [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) comes with the new [***Shine***](/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md#shine) syntax** for highly intuitive and visually expressive View/Model Attribute Mapping, relying on `<=>` for bidirectional (two-way) data-binding and `<=` for unidirectional (one-way) data-binding, providing an alternative to the `bind` keyword (keep in mind that it is still a beta, so default back to `bind` whenever needed).
21
21
 
@@ -321,7 +321,7 @@ jgem install glimmer-dsl-swt
321
321
 
322
322
  Or this command if you want a specific version:
323
323
  ```
324
- jgem install glimmer-dsl-swt -v 4.20.14.1
324
+ jgem install glimmer-dsl-swt -v 4.20.14.2
325
325
  ```
326
326
 
327
327
  `jgem` is JRuby's version of `gem` command.
@@ -349,7 +349,7 @@ Note: if you're using activerecord or activesupport, keep in mind that Glimmer u
349
349
 
350
350
  Add the following to `Gemfile`:
351
351
  ```
352
- gem 'glimmer-dsl-swt', '~> 4.20.14.1'
352
+ gem 'glimmer-dsl-swt', '~> 4.20.14.2'
353
353
  ```
354
354
 
355
355
  And, then run:
@@ -370,7 +370,7 @@ glimmer
370
370
  ```
371
371
 
372
372
  ```
373
- Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.20.14.1
373
+ Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.20.14.2
374
374
 
375
375
  Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
376
376
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.20.14.1
1
+ 4.20.14.2
@@ -14,6 +14,7 @@
14
14
  - [Hello, List Single Selection!](#hello-list-single-selection)
15
15
  - [Hello, List Multi Selection!](#hello-list-multi-selection)
16
16
  - [Hello, Computed!](#hello-computed)
17
+ - [Hello, Toggle!](#hello-toggle)
17
18
  - [Hello, Message Box!](#hello-message-box)
18
19
  - [Hello, Browser!](#hello-browser)
19
20
  - [Hello, Drag and Drop!](#hello-drag-and-drop)
@@ -315,6 +316,30 @@ Code:
315
316
 
316
317
  ![Hello Browser](/images/glimmer-hello-computed.png)
317
318
 
319
+ #### Hello, Toggle!
320
+
321
+ This sample demonstrates the use of `toggle` button (aka `button(:toggle)`)
322
+
323
+ Code:
324
+
325
+ [samples/hello/hello_toggle.rb](/samples/hello/hello_toggle.rb)
326
+
327
+ ![Hello Toggle](/images/glimmer-hello-toggle.png)
328
+
329
+ ![Hello Toggle Red](/images/glimmer-hello-toggle-red.png)
330
+
331
+ ![Hello Toggle Green](/images/glimmer-hello-toggle-green.png)
332
+
333
+ ![Hello Toggle Blue](/images/glimmer-hello-toggle-blue.png)
334
+
335
+ ![Hello Toggle Red Green](/images/glimmer-hello-toggle-red-green.png)
336
+
337
+ ![Hello Toggle Red Blue](/images/glimmer-hello-toggle-red-blue.png)
338
+
339
+ ![Hello Toggle Green Blue](/images/glimmer-hello-toggle-green-blue.png)
340
+
341
+ ![Hello Toggle Red Green Blue](/images/glimmer-hello-toggle-red-green-blue.png)
342
+
318
343
  #### Hello, Message Box!
319
344
 
320
345
  This sample demonstrates a `message_box` dialog.
Binary file
@@ -0,0 +1,91 @@
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
+ require 'glimmer-dsl-swt'
23
+
24
+ class HelloToggle
25
+ include Glimmer::UI::CustomShell
26
+
27
+ attr_accessor :red, :green, :blue, :final_color_text, :final_color
28
+
29
+ after_body do
30
+ observe(self, :red) do
31
+ update_final_color!
32
+ end
33
+
34
+ observe(self, :green) do
35
+ update_final_color!
36
+ end
37
+
38
+ observe(self, :blue) do
39
+ update_final_color!
40
+ end
41
+ end
42
+
43
+ body {
44
+ shell {
45
+ grid_layout 3, true
46
+
47
+ text 'Hello, Toggle!'
48
+
49
+ toggle {
50
+ layout_data :fill, :center, true, false
51
+ text 'Red'
52
+
53
+ selection <=> [self, :red]
54
+ }
55
+
56
+ toggle {
57
+ layout_data :fill, :center, true, false
58
+ text 'Green'
59
+
60
+ selection <=> [self, :green]
61
+ }
62
+
63
+ toggle {
64
+ layout_data :fill, :center, true, false
65
+ text 'Blue'
66
+
67
+ selection <=> [self, :blue]
68
+ }
69
+
70
+ label(:center) {
71
+ layout_data {
72
+ horizontal_span 3
73
+ horizontal_alignment :fill
74
+ grab_excess_horizontal_space true
75
+ height_hint 20
76
+ }
77
+
78
+ text <= [self, :final_color_text]
79
+ background <= [self, :final_color]
80
+ }
81
+ }
82
+ }
83
+
84
+ def update_final_color!
85
+ final_color_symbols = [:red, :green, :blue].map {|color| send(color) ? color : nil}.compact
86
+ self.final_color_text = final_color_symbols.map {|color_symbol| color_symbol.to_s.capitalize}.join(' + ')
87
+ self.final_color = final_color_symbols.map {|color_symbol| color(color_symbol)}.reduce {|output_color, color| rgb(output_color.red + color.red, output_color.green + color.green, output_color.blue + color.blue) }
88
+ end
89
+ end
90
+
91
+ HelloToggle.launch
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-swt
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.20.14.1
4
+ version: 4.20.14.2
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-08-08 00:00:00.000000000 Z
11
+ date: 2021-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -660,6 +660,7 @@ files:
660
660
  - samples/hello/hello_table.rb
661
661
  - samples/hello/hello_table/baseball_park.png
662
662
  - samples/hello/hello_text.rb
663
+ - samples/hello/hello_toggle.rb
663
664
  - samples/hello/hello_tool_bar.rb
664
665
  - samples/hello/hello_tray_item.rb
665
666
  - samples/hello/hello_tree.rb