glimmer-dsl-swt 4.20.13.16 → 4.20.14.1

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: dcbde18522dded899e463ea9f5e1d94325707b9403392717e624b7475e6e6725
4
- data.tar.gz: 53c6de1396110f443afca9378642c66b8813e7fd329ba3f860951ccc4ec11793
3
+ metadata.gz: ec68532348a4c8220d559e24a66c7cc99267435e0b72c4f8a679892dd7694f25
4
+ data.tar.gz: aa9aa58f9016734f4fa8357c6002f8be6243e474163b612922cc7127bd349dd9
5
5
  SHA512:
6
- metadata.gz: 186a4ebb62c01d54c91470623ea689e52b984e5fb01137bc78cc3113a2599fbfe20113b40e1afaa1adf1648af08e6df2f3bada47bb8afd2ab73730a1eb218a2b
7
- data.tar.gz: e837367673f9b8964d97e34e5a1aa4162618b312aadf341808e3a50653dadaf1f387b4d7845caf584519c24a1d7c6b3cc9aa59c7f0f4be574875f3ac579be98e
6
+ metadata.gz: 0e8174b81dd1ce045649be34d1c46507020b659904fb981c51175920c0909d1bfa1f68d3e9087a3fe6c3d7509da030abe166bbbb4eea44d297a6ad1fc93c33f7
7
+ data.tar.gz: 698085d81b8f2e071101fcb0ed58a5b14a346a80f15ad3a195048278a54737c1550e3cc4007a4c75649fef23689e25b2f8721ab66fb40300d9d3c76f47a71078
data/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
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
+
18
+ ### 4.20.13.17
19
+
20
+ - Hello, Slider! sample
21
+
3
22
  ### 4.20.13.16
4
23
 
5
24
  - Fix issue with setting app name (via `Display.app_name=`) when app is not packaged (always gets set to Glimmer)
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.16
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
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.16 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.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).
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.16
324
+ jgem install glimmer-dsl-swt -v 4.20.14.1
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.16'
352
+ gem 'glimmer-dsl-swt', '~> 4.20.14.1'
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.16
373
+ Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.20.14.1
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.16
1
+ 4.20.14.1
@@ -19,6 +19,7 @@
19
19
  - [Hello, Drag and Drop!](#hello-drag-and-drop)
20
20
  - [Hello, Menu Bar!](#hello-menu-bar)
21
21
  - [Hello, Pop Up Context Menu!](#hello-pop-up-context-menu)
22
+ - [Hello, Arrow!](#hello-arrow)
22
23
  - [Hello, Custom Widget!](#hello-custom-widget)
23
24
  - [Hello, Custom Shell!](#hello-custom-shell)
24
25
  - [Hello, Sash Form!](#hello-sash-form)
@@ -33,6 +34,7 @@
33
34
  - [Hello, File Dialog!](#hello-file-dialog)
34
35
  - [Hello, Date Time!](#hello-date-time)
35
36
  - [Hello, Scale!](#hello-scale)
37
+ - [Hello, Slider!](#hello-slider)
36
38
  - [Hello, Spinner!](#hello-spinner)
37
39
  - [Hello, Table!](#hello-table)
38
40
  - [Hello, Link!](#hello-link)
@@ -399,6 +401,20 @@ Code:
399
401
  ![Hello Pop Up Context Menu](/images/glimmer-hello-pop-up-context-menu.png)
400
402
  ![Hello Pop Up Context Menu Popped Up](/images/glimmer-hello-pop-up-context-menu-popped-up.png)
401
403
 
404
+ #### Hello, Arrow!
405
+
406
+ This sample demonstrates `arrow` button (aka `button(:arrow)`).
407
+
408
+ Code:
409
+
410
+ [samples/hello/hello_arrow.rb](/samples/hello/hello_arrow.rb)
411
+
412
+ ![Hello Arrow](/images/glimmer-hello-arrow.png)
413
+
414
+ ![Hello Arrow Menu](/images/glimmer-hello-arrow-menu.png)
415
+
416
+ ![Hello Arrow Item Selected](/images/glimmer-hello-arrow-item-selected.png)
417
+
402
418
  #### Hello, Custom Widget!
403
419
 
404
420
  This sample demonstrates the use of a custom widget in Glimmer.
@@ -614,6 +630,18 @@ Hello, Scale!
614
630
 
615
631
  ![Hello Scale](/images/glimmer-hello-scale.png)
616
632
 
633
+ #### Hello, Slider!
634
+
635
+ This sample demonstrates the use of `slider` widget in Glimmer
636
+
637
+ Code:
638
+
639
+ [samples/hello/hello_slider.rb](/samples/hello/hello_slider.rb)
640
+
641
+ Hello, Slider!
642
+
643
+ ![Hello Slider](/images/glimmer-hello-slider.png)
644
+
617
645
  #### Hello, Spinner!
618
646
 
619
647
  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
@@ -0,0 +1,58 @@
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 HelloSlider
25
+ include Glimmer::UI::CustomShell
26
+
27
+ attr_accessor :value
28
+
29
+ before_body do
30
+ @value = 50
31
+ end
32
+
33
+ body {
34
+ shell {
35
+ row_layout(:vertical) {
36
+ fill true
37
+ center true
38
+ }
39
+
40
+ text 'Hello, Slider!'
41
+
42
+ label(:center) {
43
+ text <= [self, :value]
44
+ }
45
+
46
+ slider { # optionally takes :vertical or :horizontal (default) SWT style
47
+ minimum 0
48
+ maximum 110 # leave room for 10 extra (slider stops at 100)
49
+ page_increment 10 # page increment occurs when clicking area between slider and beginning or end
50
+ selection <=> [self, :value]
51
+ }
52
+
53
+ }
54
+
55
+ }
56
+ end
57
+
58
+ HelloSlider.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.16
4
+ version: 4.20.14.1
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-07 00:00:00.000000000 Z
11
+ date: 2021-08-08 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
@@ -652,6 +653,7 @@ files:
652
653
  - samples/hello/hello_scale.rb
653
654
  - samples/hello/hello_shape.rb
654
655
  - samples/hello/hello_shell.rb
656
+ - samples/hello/hello_slider.rb
655
657
  - samples/hello/hello_spinner.rb
656
658
  - samples/hello/hello_styled_text.rb
657
659
  - samples/hello/hello_tab.rb