glimmer-dsl-swt 4.20.13.17 → 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: 1cc6c92bf35a9a28f26f3a34a735f5e900f294b70ffcd7ee7dc3ff9cd4a6b360
4
- data.tar.gz: 900a03b90b78756a42a8407438ab380a2e856194ee1346651780049bc678bced
3
+ metadata.gz: 3563ef87997628bd87b78de0900279aefcde38f911e2be4a786dfd8a48d5c2f7
4
+ data.tar.gz: aab8501a3e614bafa0cf6e9cbae5b326dd0d9acdeb201a41799734f7d322bbae
5
5
  SHA512:
6
- metadata.gz: d5cd116baea369efa9131cf6ee45b44b40e6ac7c4e1a5a79f6572b4d69f61885edd291c38b2b83b5cdbdabbb17d660559025891649bbb580acff4d30bdae1758
7
- data.tar.gz: 99c8aa855ec1a72923c7c9725a92f81bd5d5c5c568b7defc9a02ac3bcfc26fa82c6233cc0832ec578400b2131c13a679d8a0e04a0ec10ff37aaca1bc44d41086
6
+ metadata.gz: 660347ec9199923ab6b12021b5bc920b83cacc67f76f50f883ace45b5cb3fb2523638a513b45e33bcea250fdd69376d508db26de69534662dfdcd6e5dd524a30
7
+ data.tar.gz: 4f490bd3cf9035acf624e83dfd0a071385796d4cebcacb205bdd9c3113f96d7f7ca9c0e625ffaed96c8a17fa4d78b04153eb6d0bc1ef7fc269c29334bd679f52
data/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Change Log
2
2
 
3
+ ### 4.20.14.1
4
+
5
+ - Upgrade to Glimmer 2.1.1
6
+ - Correct Hello, Slider! sample class name
7
+
8
+ ### 4.20.14.0
9
+
10
+ - Extract ObserveExpression into Glimmer
11
+ - Upgrade to Glimmer 2.1.0
12
+
13
+ ### 4.20.13.18
14
+
15
+ - Change `arrow` widget default SWT style to include `:down`
16
+ - Hello, Arrow! sample
17
+
3
18
  ### 4.20.13.17
4
19
 
5
20
  - Hello, Slider! sample
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.13.17
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.13.17 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.13.17
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.13.17'
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.13.17
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.13.17
1
+ 4.20.14.2
@@ -14,11 +14,13 @@
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)
20
21
  - [Hello, Menu Bar!](#hello-menu-bar)
21
22
  - [Hello, Pop Up Context Menu!](#hello-pop-up-context-menu)
23
+ - [Hello, Arrow!](#hello-arrow)
22
24
  - [Hello, Custom Widget!](#hello-custom-widget)
23
25
  - [Hello, Custom Shell!](#hello-custom-shell)
24
26
  - [Hello, Sash Form!](#hello-sash-form)
@@ -33,6 +35,7 @@
33
35
  - [Hello, File Dialog!](#hello-file-dialog)
34
36
  - [Hello, Date Time!](#hello-date-time)
35
37
  - [Hello, Scale!](#hello-scale)
38
+ - [Hello, Slider!](#hello-slider)
36
39
  - [Hello, Spinner!](#hello-spinner)
37
40
  - [Hello, Table!](#hello-table)
38
41
  - [Hello, Link!](#hello-link)
@@ -313,6 +316,30 @@ Code:
313
316
 
314
317
  ![Hello Browser](/images/glimmer-hello-computed.png)
315
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
+
316
343
  #### Hello, Message Box!
317
344
 
318
345
  This sample demonstrates a `message_box` dialog.
@@ -399,6 +426,20 @@ Code:
399
426
  ![Hello Pop Up Context Menu](/images/glimmer-hello-pop-up-context-menu.png)
400
427
  ![Hello Pop Up Context Menu Popped Up](/images/glimmer-hello-pop-up-context-menu-popped-up.png)
401
428
 
429
+ #### Hello, Arrow!
430
+
431
+ This sample demonstrates `arrow` button (aka `button(:arrow)`).
432
+
433
+ Code:
434
+
435
+ [samples/hello/hello_arrow.rb](/samples/hello/hello_arrow.rb)
436
+
437
+ ![Hello Arrow](/images/glimmer-hello-arrow.png)
438
+
439
+ ![Hello Arrow Menu](/images/glimmer-hello-arrow-menu.png)
440
+
441
+ ![Hello Arrow Item Selected](/images/glimmer-hello-arrow-item-selected.png)
442
+
402
443
  #### Hello, Custom Widget!
403
444
 
404
445
  This sample demonstrates the use of a custom widget in Glimmer.
@@ -614,6 +655,18 @@ Hello, Scale!
614
655
 
615
656
  ![Hello Scale](/images/glimmer-hello-scale.png)
616
657
 
658
+ #### Hello, Slider!
659
+
660
+ This sample demonstrates the use of `slider` widget in Glimmer
661
+
662
+ Code:
663
+
664
+ [samples/hello/hello_slider.rb](/samples/hello/hello_slider.rb)
665
+
666
+ Hello, Slider!
667
+
668
+ ![Hello Slider](/images/glimmer-hello-slider.png)
669
+
617
670
  #### Hello, Spinner!
618
671
 
619
672
  This sample demonstrates the use of `spinner` widget in Glimmer
Binary file
@@ -21,7 +21,6 @@
21
21
 
22
22
  require 'glimmer/dsl/static_expression'
23
23
  require 'glimmer/dsl/bind_expression'
24
- require 'glimmer/data_binding/model_binding'
25
24
 
26
25
  module Glimmer
27
26
  module DSL
@@ -21,8 +21,7 @@
21
21
 
22
22
  require 'glimmer/dsl/static_expression'
23
23
  require 'glimmer/dsl/top_level_expression'
24
- require 'glimmer/data_binding/observer'
25
- require 'glimmer/data_binding/model_binding'
24
+ require 'glimmer/dsl/observe_expression'
26
25
  require 'glimmer/ui/custom_widget'
27
26
 
28
27
  module Glimmer
@@ -30,23 +29,10 @@ module Glimmer
30
29
  module SWT
31
30
  class ObserveExpression < StaticExpression
32
31
  include TopLevelExpression
32
+ include Glimmer::DSL::ObserveExpression
33
33
 
34
- REGEX_NESTED_OR_INDEXED_PROPERTY = /([^\[]+)(\[[^\]]+\])?/
35
-
36
- def can_interpret?(parent, keyword, *args, &block)
37
- keyword == 'observe' and
38
- block_given? and
39
- (args.size == 2) and
40
- textual?(args[1])
41
- end
42
-
43
34
  def interpret(parent, keyword, *args, &block)
44
- observer = DataBinding::Observer.proc(&block)
45
- if args[1].to_s.match(REGEX_NESTED_OR_INDEXED_PROPERTY)
46
- observer_registration = observer.observe(DataBinding::ModelBinding.new(args[0], args[1]))
47
- else
48
- observer_registration = observer.observe(args[0], args[1])
49
- end
35
+ observer_registration = super
50
36
  Glimmer::UI::CustomWidget.current_custom_widgets.last&.observer_registrations&.push(observer_registration)
51
37
  observer_registration
52
38
  end
@@ -48,7 +48,7 @@ module Glimmer
48
48
  include Custom::Drawable
49
49
 
50
50
  DEFAULT_STYLES = {
51
- 'arrow' => [:arrow],
51
+ 'arrow' => [:arrow, :down],
52
52
  'button' => [:push],
53
53
  'canvas' => ([:double_buffered] unless OS.mac?),
54
54
  'ccombo' => [:border],
@@ -0,0 +1,67 @@
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
+ include Glimmer
25
+
26
+ shell {
27
+ row_layout(:vertical) {
28
+ fill true
29
+ center true
30
+ }
31
+
32
+ text 'Hello, Arrow!'
33
+
34
+ label(:center) {
35
+ text 'Click the arrow to get a menu.'
36
+ }
37
+
38
+ arrow { # can be customized by passing `:arrow` SWT style + `:left`, `:right`, `:up`, or `:down` (default)
39
+ menu {
40
+ menu_item {
41
+ text 'Item &1'
42
+
43
+ on_widget_selected do
44
+ message_box {
45
+ text 'Item 1'
46
+ message 'Item 1 selected!'
47
+ }.open
48
+ end
49
+ }
50
+ menu_item {
51
+ text 'Item &2'
52
+
53
+ on_widget_selected do
54
+ message_box {
55
+ text 'Item 2'
56
+ message 'Item 2 selected!'
57
+ }.open
58
+ end
59
+ }
60
+ }
61
+
62
+ on_widget_selected do |event|
63
+ event.widget.menu.visible = true
64
+ end
65
+ }
66
+
67
+ }.open
@@ -21,7 +21,7 @@
21
21
 
22
22
  require 'glimmer-dsl-swt'
23
23
 
24
- class HelloScale
24
+ class HelloSlider
25
25
  include Glimmer::UI::CustomShell
26
26
 
27
27
  attr_accessor :value
@@ -55,4 +55,4 @@ class HelloScale
55
55
  }
56
56
  end
57
57
 
58
- HelloScale.launch
58
+ HelloSlider.launch
@@ -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,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.13.17
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
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 2.0.0
18
+ version: 2.1.1
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: 2.0.0
26
+ version: 2.1.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
@@ -605,6 +605,7 @@ files:
605
605
  - samples/elaborate/timer/sounds/alarm1.wav
606
606
  - samples/elaborate/user_profile.rb
607
607
  - samples/elaborate/weather.rb
608
+ - samples/hello/hello_arrow.rb
608
609
  - samples/hello/hello_browser.rb
609
610
  - samples/hello/hello_button.rb
610
611
  - samples/hello/hello_c_combo.rb
@@ -659,6 +660,7 @@ files:
659
660
  - samples/hello/hello_table.rb
660
661
  - samples/hello/hello_table/baseball_park.png
661
662
  - samples/hello/hello_text.rb
663
+ - samples/hello/hello_toggle.rb
662
664
  - samples/hello/hello_tool_bar.rb
663
665
  - samples/hello/hello_tray_item.rb
664
666
  - samples/hello/hello_tree.rb