glimmer-dsl-swt 4.21.2.1 → 4.21.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +5 -5
- data/VERSION +1 -1
- data/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md +3 -3
- data/glimmer-dsl-swt.gemspec +0 -0
- data/lib/glimmer/swt/custom/drawable.rb +2 -0
- data/samples/hello/hello_drag_and_drop.rb +37 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac84d860e3995bd827c544c39a56b25411a835c8c52eec18c551792f94f0edfc
|
4
|
+
data.tar.gz: 70539769efda38c06bc336b1c18c1184f6087d3b1b499ed94690e0efa09130a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94809b5aa46629262c19108d3200844bf6da24db786c7e9a8238d49378c67171c7aac275b37dc010bc3f3fe2c9df2f0e4dae93b5293eede4acc3abe1dbdbdaab
|
7
|
+
data.tar.gz: a74f71dce3ec4226fcc689a26e0cbe563999049624e79ca9835bc2008b736123f626bf0bcf83d7b2cf418430b15d5cded09e032bc363e8fff09194bc333f1e55
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
### 4.21.2.2
|
4
|
+
|
5
|
+
- Demo file drag and drop in Hello, Drag and Drop!
|
6
|
+
- Make shapes added inside a widget with `:default` or `:max` dimensions auto-resize as the widget resizes
|
7
|
+
- Upgrade to glimmer 2.5.0
|
8
|
+
|
3
9
|
### 4.21.2.1
|
4
10
|
|
5
11
|
- Update Hello, Drag and Drop! to include `list`, `label`, `text`, and `spinner` examples
|
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.21.2.
|
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.21.2.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.21.2.
|
18
|
+
[Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.21.2.2 includes [SWT 4.21](https://download.eclipse.org/eclipse/downloads/drops4/R-4.21-202109060500/), which was released on September 6, 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
|
|
@@ -323,7 +323,7 @@ jgem install glimmer-dsl-swt
|
|
323
323
|
|
324
324
|
Or this command if you want a specific version:
|
325
325
|
```
|
326
|
-
jgem install glimmer-dsl-swt -v 4.21.2.
|
326
|
+
jgem install glimmer-dsl-swt -v 4.21.2.2
|
327
327
|
```
|
328
328
|
|
329
329
|
`jgem` is JRuby's version of `gem` command.
|
@@ -351,7 +351,7 @@ Note: if you're using activerecord or activesupport, keep in mind that Glimmer u
|
|
351
351
|
|
352
352
|
Add the following to `Gemfile`:
|
353
353
|
```
|
354
|
-
gem 'glimmer-dsl-swt', '~> 4.21.2.
|
354
|
+
gem 'glimmer-dsl-swt', '~> 4.21.2.2'
|
355
355
|
```
|
356
356
|
|
357
357
|
And, then run:
|
@@ -372,7 +372,7 @@ glimmer
|
|
372
372
|
```
|
373
373
|
|
374
374
|
```
|
375
|
-
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.21.2.
|
375
|
+
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.21.2.2
|
376
376
|
|
377
377
|
Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
|
378
378
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.21.2.
|
1
|
+
4.21.2.2
|
@@ -1600,7 +1600,7 @@ Screenshot:
|
|
1600
1600
|
|
1601
1601
|
If you specify the x and y coordinates as `:default`, `nil`, or leave them out, they get calculated automatically by centering the shape within its parent `canvas`.
|
1602
1602
|
|
1603
|
-
If you specify the `width` and `height` parameters as `:max`, they get calculated from the parent's size, filling the parent maximally.
|
1603
|
+
If you specify the `width` and `height` parameters as `:max`, they get calculated from the parent's size, filling the parent maximally (and they are auto-calculated on parent resize).
|
1604
1604
|
|
1605
1605
|
Note that you could shift a shape off its centered position within its parent `canvas` by setting `x` to `[:default, x_delta]` and `y` to `[:default, y_delta]`
|
1606
1606
|
|
@@ -1759,11 +1759,11 @@ Shapes can be nested within each other. If you nest a shape within another, its
|
|
1759
1759
|
|
1760
1760
|
As such, if you move the parent, it moves all its children with it.
|
1761
1761
|
|
1762
|
-
If you specify the `x` and `y` coordinates as `:default`, `nil`, or leave them out, they get calculated automatically by centering the shape within its parent shape relatively.
|
1762
|
+
If you specify the `x` and `y` coordinates as `:default`, `nil`, or leave them out, they get calculated automatically by centering the shape within its parent shape relatively (and auto-recalculated on parent resize).
|
1763
1763
|
|
1764
1764
|
If you specify the `width` and `height` parameters as `:default`, `nil`, or leave them out, they get calculated automatically from the shape's nested children shapes if any (e.g calculating the dimensions of a text from its extent according to its font size) or from the parent's size otherwise.
|
1765
1765
|
|
1766
|
-
If you specify the `width` and `height` parameters as `:max`, they get calculated from the parent's size, filling the parent maximally.
|
1766
|
+
If you specify the `width` and `height` parameters as `:max`, they get calculated from the parent's size, filling the parent maximally (and auto-recalculated on parent resize).
|
1767
1767
|
|
1768
1768
|
Note that you could shift a shape off its centered position within its parent shape by setting `x` to `[:default, x_delta]` and `y` to `[:default, y_delta]`
|
1769
1769
|
|
data/glimmer-dsl-swt.gemspec
CHANGED
Binary file
|
@@ -110,6 +110,7 @@ module Glimmer
|
|
110
110
|
|
111
111
|
def deregister_shape_painting
|
112
112
|
@paint_listener_proxy&.deregister
|
113
|
+
@resize_listener_proxy&.deregister
|
113
114
|
end
|
114
115
|
|
115
116
|
def setup_shape_painting
|
@@ -143,6 +144,7 @@ module Glimmer
|
|
143
144
|
shape_painter.call(self) # treat self as paint event since image has its own gc and doesn't do repaints (it's a one time deal for now though could be adjusted in the future.)
|
144
145
|
else
|
145
146
|
@paint_listener_proxy = on_swt_paint(&shape_painter)
|
147
|
+
@resize_listener_proxy = on_swt_Resize { shapes.each(&:calculated_args_changed!) }
|
146
148
|
end
|
147
149
|
else
|
148
150
|
redraw if respond_to?(:redraw) && @finished_add_content && !is_disposed
|
@@ -76,8 +76,8 @@ shell {
|
|
76
76
|
|
77
77
|
list {
|
78
78
|
# Option 1: Automatic Drop Data Consumption
|
79
|
-
# drop_target :unique # does not add same data twice
|
80
79
|
drop_target true
|
80
|
+
# drop_target :unique # setting drop_target to :unique makes the list not add the same data twice
|
81
81
|
|
82
82
|
# Option 2: Manual Drop Data Consumption
|
83
83
|
# on_drop do |event|
|
@@ -91,6 +91,7 @@ shell {
|
|
91
91
|
# transfer :text # options: :text, :file, :rtf
|
92
92
|
#
|
93
93
|
# on_drag_enter do |event|
|
94
|
+
# ### event.detail = DND::DROP_NONE # To reject a drop, you can set event.detail to DND::DROP_NONE
|
94
95
|
# drop_widget = event.widget.control.data('proxy') # obtain Glimmer widget proxy since it permits nicer syntax for setting background via symbol
|
95
96
|
# drop_widget.background = :red
|
96
97
|
# end
|
@@ -209,5 +210,40 @@ shell {
|
|
209
210
|
drop_target true
|
210
211
|
}
|
211
212
|
}
|
213
|
+
tab_item {
|
214
|
+
fill_layout
|
215
|
+
text 'File'
|
216
|
+
|
217
|
+
@drop_zone_label = label(:center, :wrap) {
|
218
|
+
text 'Drop One File Or More Here'
|
219
|
+
background :white
|
220
|
+
|
221
|
+
rectangle {
|
222
|
+
foreground :black
|
223
|
+
line_width 4
|
224
|
+
line_style :dash
|
225
|
+
}
|
226
|
+
|
227
|
+
drop_target(:drop_copy) {
|
228
|
+
transfer :file
|
229
|
+
|
230
|
+
on_drag_enter do |event|
|
231
|
+
drop_widget = event.widget.control.data('proxy') # obtain Glimmer widget proxy since it permits nicer syntax for setting background via symbol
|
232
|
+
drop_widget.background = :yellow
|
233
|
+
end
|
234
|
+
|
235
|
+
on_drag_leave do |event|
|
236
|
+
drop_widget = event.widget.control.data('proxy') # obtain Glimmer widget proxy since it permits nicer syntax for setting background via symbol
|
237
|
+
drop_widget.background = :white
|
238
|
+
end
|
239
|
+
|
240
|
+
on_drop do |event|
|
241
|
+
drop_widget = event.widget.control.data('proxy') # obtain Glimmer widget proxy since it permits nicer syntax for setting background/cursor via symbol
|
242
|
+
drop_widget.background = :white
|
243
|
+
@drop_zone_label.text = event.data.to_a.join("\n")
|
244
|
+
end
|
245
|
+
}
|
246
|
+
}
|
247
|
+
}
|
212
248
|
}
|
213
249
|
}.open
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimmer-dsl-swt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.21.2.
|
4
|
+
version: 4.21.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Maleh
|
@@ -15,7 +15,7 @@ dependencies:
|
|
15
15
|
requirements:
|
16
16
|
- - "~>"
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: 2.
|
18
|
+
version: 2.5.0
|
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.
|
26
|
+
version: 2.5.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
29
29
|
requirements:
|