glimmer-dsl-swt 4.20.13.1 → 4.20.13.5

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: 52a35ca793ca95839f0f328a465b2d9dafc008d5434520b92e2411ce19bde4ad
4
- data.tar.gz: 7ec9d1550c1aedcb265761bb3f8c6b295a7d1d28af1944b81dcd4c8a4eb9e0f3
3
+ metadata.gz: b15c41b36b1464cbcf34e302e630fce0a9e63f5512754c095d14e646dcc2c2b7
4
+ data.tar.gz: 02addc76d6e2f275a1c79741f30bf6ba89087fc68e03cbb7ef29eb051cbd8b87
5
5
  SHA512:
6
- metadata.gz: bf6b815412f32c1a8d986c2f927f845abbebdc051adf9edfb64dfa4472715ef08970bc05dd69833de7311e596b01dc21735570175ffb74b08bc8c1888ebe46d0
7
- data.tar.gz: fb05c6d864f98d744e57507c0c00145d1b19f689f76b4970d1c6901390ff94a8c4eea0bc81c6b7c3fb27371c3b46e23c28a9911853654d9adb97a77dbffa62d6
6
+ metadata.gz: 2e7595726d4f5c1657b547f2a893a1c83e1469b9ef20d336adb1f7e50a06ea6af69e71a30272dc24a6a50bf9d85cfa9fea558ddc9e1112ef1a6c43d53b011d3f
7
+ data.tar.gz: 9ccd2bedd1040f95b1e12fdb4dbfac53bf96ade95290e4e1b3e168643843cb4340dc5ca892f3f405a91c77ac81032508a9a256d6eac3798dfdb70518d3804453
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Change Log
2
2
 
3
+ ### 4.20.13.5
4
+
5
+ - Fix issue occurring with shape drag & drop when the dragged shape is a drop target too, thus getting dropped back to itself.
6
+
7
+ ### 4.20.13.4
8
+
9
+ - Improved shape drag and drop checking for inclusion in drop target when there are multiple drop targets
10
+
11
+ ### 4.20.13.3
12
+
13
+ - Fix issue regarding `nil` calculated_width/calculated_height encountered in Shape#contain?
14
+
15
+ ### 4.20.13.2
16
+
17
+ - Support `drop_event.doit = false` to deny dropping and move dragged shape back to where it was
18
+
3
19
  ### 4.20.13.1
4
20
 
5
21
  - Supporting having a `drag_source` that is dragged and not dropped at a target go back to its original position
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.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.13.4
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.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 (report any issues you may encounter).
18
+ [Glimmer DSL for SWT](https://rubygems.org/gems/glimmer-dsl-swt) 4.20.13.4 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 (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
 
@@ -326,7 +326,7 @@ jgem install glimmer-dsl-swt
326
326
 
327
327
  Or this command if you want a specific version:
328
328
  ```
329
- jgem install glimmer-dsl-swt -v 4.20.13.1
329
+ jgem install glimmer-dsl-swt -v 4.20.13.4
330
330
  ```
331
331
 
332
332
  `jgem` is JRuby's version of `gem` command.
@@ -354,7 +354,7 @@ Note: if you're using activerecord or activesupport, keep in mind that Glimmer u
354
354
 
355
355
  Add the following to `Gemfile`:
356
356
  ```
357
- gem 'glimmer-dsl-swt', '~> 4.20.13.1'
357
+ gem 'glimmer-dsl-swt', '~> 4.20.13.4'
358
358
  ```
359
359
 
360
360
  And, then run:
@@ -375,7 +375,7 @@ glimmer
375
375
  ```
376
376
 
377
377
  ```
378
- Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.20.13.1
378
+ Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.20.13.4
379
379
 
380
380
  Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
381
381
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.20.13.1
1
+ 4.20.13.5
Binary file
@@ -62,7 +62,7 @@ module Glimmer
62
62
  class Shape
63
63
  include Properties
64
64
 
65
- DropEvent = Struct.new(:x, :y, :dragged_shape, :dragged_shape_original_x, :dragged_shape_original_y, :dragging_x, :dragging_y, :drop_shapes, keyword_init: true)
65
+ DropEvent = Struct.new(:doit, :x, :y, :dragged_shape, :dragged_shape_original_x, :dragged_shape_original_y, :dragging_x, :dragging_y, :drop_shapes, keyword_init: true)
66
66
 
67
67
  class << self
68
68
  attr_accessor :dragging, :dragging_x, :dragging_y, :dragged_shape, :dragged_shape_original_x, :dragged_shape_original_y
@@ -217,7 +217,7 @@ module Glimmer
217
217
  # some shapes may choose to provide a fuzz factor to make usage of this method for mouse clicking more user friendly
218
218
  def contain?(x, y)
219
219
  # assume a rectangular filled shape by default (works for several shapes like image, text, and focus)
220
- x.between?(self.absolute_x, self.absolute_x + calculated_width) && y.between?(self.absolute_y, self.absolute_y + calculated_height)
220
+ x.between?(self.absolute_x, self.absolute_x + calculated_width.to_f) && y.between?(self.absolute_y, self.absolute_y + calculated_height.to_f)
221
221
  end
222
222
 
223
223
  # Returns if shape includes a point. When the shape is filled, this is the same as contain. When the shape is drawn, it only returns true if the point lies on the edge (boundary/border)
@@ -592,8 +592,9 @@ module Glimmer
592
592
  if observation_request == 'on_drop'
593
593
  Shape.drop_shapes << self
594
594
  handle_observation_request('on_mouse_up') do |event|
595
- if Shape.dragged_shape
595
+ if Shape.dragging && !expanded_shapes.include?(Shape.dragged_shape) && include_with_children?(event.x, event.y)
596
596
  drop_event = DropEvent.new(
597
+ doit: true,
597
598
  dragged_shape: Shape.dragged_shape,
598
599
  dragged_shape_original_x: Shape.dragged_shape_original_x,
599
600
  dragged_shape_original_y: Shape.dragged_shape_original_y,
@@ -604,11 +605,15 @@ module Glimmer
604
605
  y: event.y
605
606
  )
606
607
  begin
607
- shape_block.call(drop_event)
608
+ block.call(drop_event)
608
609
  rescue => e
609
610
  Glimmer::Config.logger.error e.full_message
610
611
  ensure
611
612
  Shape.dragging = false
613
+ if !drop_event.doit && Shape.dragged_shape
614
+ Shape.dragged_shape.x = Shape.dragged_shape_original_x
615
+ Shape.dragged_shape.y = Shape.dragged_shape_original_y
616
+ end
612
617
  Shape.dragged_shape = nil
613
618
  end
614
619
  end
@@ -776,6 +781,7 @@ module Glimmer
776
781
  shapes.dup.each {|shape| shape.dispose(dispose_images: dispose_images, dispose_patterns: dispose_patterns, redraw: false) }
777
782
  end
778
783
  end
784
+ alias dispose_shapes clear_shapes
779
785
 
780
786
  # Indicate if this is a container shape (meaning a shape bag that is just there to contain nested shapes, but doesn't render anything of its own)
781
787
  def container?
@@ -63,6 +63,7 @@ class HelloCanvasDragAndDrop
63
63
 
64
64
  on_drop do |drop_event|
65
65
  # drop_event attributes: :x, :y, :dragged_shape, :dragged_shape_original_x, :dragged_shape_original_y, :dragging_x, :dragging_y, :drop_shapes
66
+ # drop_event.doit = false # drop event can be cancelled by setting doit attribute to false
66
67
  ball_count = @number_shape.string.to_i
67
68
  @number_shape.dispose
68
69
  @drop_square.content {
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.13.1
4
+ version: 4.20.13.5
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-07-28 00:00:00.000000000 Z
11
+ date: 2021-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement