glimmer-dsl-swt 4.20.15.3 → 4.21.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,12 +33,12 @@ class HelloCanvas
33
33
  end
34
34
 
35
35
  after_body do
36
- Thread.new {
36
+ Thread.new do
37
37
  'Picasso'.chars.each do |character|
38
38
  sleep(1)
39
39
  self.artist += character
40
40
  end
41
- }
41
+ end
42
42
  end
43
43
 
44
44
  body {
@@ -60,7 +60,7 @@ class HelloCanvas
60
60
  rectangle([:default, -70], :default, :default, [:default, 1]) {
61
61
  foreground :cyan
62
62
  text {
63
- string <=> [self, :artist]
63
+ string <= [self, :artist]
64
64
  x :default, 1 # add 1 pixel to default x (shape centered within parent horizontally)
65
65
  y :default, 1 # add 1 pixel to default y (shape centered within parent vertically)
66
66
  background :yellow
@@ -70,16 +70,16 @@ class HelloCanvas
70
70
  }
71
71
  rectangle(155, 30) { # width and height are assumed to be the default (calculated from children)
72
72
  foreground :yellow
73
- 3.times { |n|
73
+ 3.times do |n|
74
74
  line(45, 70 + n*10, 65 + n*10, 30 + n*10) {
75
75
  foreground :yellow
76
76
  }
77
- }
78
- 10.times {|n|
77
+ end
78
+ 10.times do |n|
79
79
  point(15 + n*5, 50 + n*5) {
80
80
  foreground :yellow
81
81
  }
82
- }
82
+ end
83
83
  polyline(45, 60, 55, 20, 65, 60, 85, 80, 45, 60)
84
84
  image(@image_object, 0, 5)
85
85
  }
@@ -107,71 +107,71 @@ class HelloCanvas
107
107
  menu_item {
108
108
  text 'Change Background Color...'
109
109
  enabled <=> [self, :selected_shape, on_read: ->(shape) { shape.respond_to?(:background) && shape.background }]
110
- on_widget_selected {
110
+ on_widget_selected do
111
111
  @selected_shape&.background = color_dialog.open
112
112
  self.selected_shape = nil
113
- }
113
+ end
114
114
  }
115
115
  menu_item {
116
116
  text 'Change Background Pattern Color 1...'
117
117
  enabled <=> [self, :selected_shape, on_read: ->(shape) { shape.respond_to?(:background_pattern) && shape.background_pattern }]
118
- on_widget_selected {
118
+ on_widget_selected do
119
119
  if @selected_shape
120
120
  background_pattern_args = @selected_shape.background_pattern_args
121
121
  background_pattern_args[5] = color_dialog.open
122
122
  @selected_shape.background_pattern = background_pattern_args
123
123
  self.selected_shape = nil
124
124
  end
125
- }
125
+ end
126
126
  }
127
127
  menu_item {
128
128
  text 'Change Background Pattern Color 2...'
129
129
  enabled <=> [self, :selected_shape, on_read: ->(shape) { shape.respond_to?(:background_pattern) && shape.background_pattern }]
130
- on_widget_selected {
130
+ on_widget_selected do
131
131
  if @selected_shape
132
132
  background_pattern_args = @selected_shape.background_pattern_args
133
133
  background_pattern_args[6] = color_dialog.open
134
134
  @selected_shape.background_pattern = background_pattern_args
135
135
  self.selected_shape = nil
136
136
  end
137
- }
137
+ end
138
138
  }
139
139
  menu_item(:separator)
140
140
  menu_item {
141
141
  text 'Change Foreground Color...'
142
142
  enabled <=> [self, :selected_shape, on_read: ->(shape) { shape.respond_to?(:foreground) && shape.foreground }]
143
- on_widget_selected {
143
+ on_widget_selected do
144
144
  @selected_shape&.foreground = color_dialog.open
145
145
  self.selected_shape = nil
146
- }
146
+ end
147
147
  }
148
148
  }
149
149
 
150
- on_mouse_down { |mouse_event|
150
+ on_mouse_down do |mouse_event|
151
151
  @drag_detected = false
152
152
  @canvas.cursor = :hand
153
153
  self.selected_shape = @canvas.shape_at_location(mouse_event.x, mouse_event.y)
154
- }
154
+ end
155
155
 
156
- on_drag_detected { |drag_detect_event|
156
+ on_drag_detected do |drag_detect_event|
157
157
  @drag_detected = true
158
158
  @drag_current_x = drag_detect_event.x
159
159
  @drag_current_y = drag_detect_event.y
160
- }
160
+ end
161
161
 
162
- on_mouse_move { |mouse_event|
162
+ on_mouse_move do |mouse_event|
163
163
  if @drag_detected
164
164
  @selected_shape&.move_by(mouse_event.x - @drag_current_x, mouse_event.y - @drag_current_y)
165
165
  @drag_current_x = mouse_event.x
166
166
  @drag_current_y = mouse_event.y
167
167
  end
168
- }
168
+ end
169
169
 
170
- on_menu_detected { |menu_detect_event|
170
+ on_menu_detected do |menu_detect_event|
171
171
  @menu_detected = true
172
- }
172
+ end
173
173
 
174
- on_mouse_up { |mouse_event|
174
+ on_mouse_up do |mouse_event|
175
175
  @canvas.cursor = :arrow
176
176
  @drag_detected = false
177
177
  if @menu_detected
@@ -179,7 +179,7 @@ class HelloCanvas
179
179
  else
180
180
  self.selected_shape = nil
181
181
  end
182
- }
182
+ end
183
183
  }
184
184
  }
185
185
  }
@@ -37,10 +37,10 @@ shell {
37
37
  text 'Regenerate'
38
38
  enabled false
39
39
 
40
- on_widget_selected {
40
+ on_widget_selected do
41
41
  @regenerate = true
42
42
  @button.enabled = false
43
- }
43
+ end
44
44
  }
45
45
  canvas {
46
46
  layout_data :fill, :fill, true, true
@@ -71,10 +71,10 @@ shell {
71
71
  }
72
72
  }
73
73
 
74
- on_swt_show {
74
+ on_swt_show do
75
75
  @regenerate = true
76
- @thread = Thread.new {
77
- loop {
76
+ @thread = Thread.new do
77
+ loop do
78
78
  if @regenerate
79
79
  @regenerate = false
80
80
  @path1.clear
@@ -107,14 +107,14 @@ shell {
107
107
  @button.enabled = true
108
108
  end
109
109
  sleep(0.1)
110
- }
110
+ end
111
111
 
112
- }
112
+ end
113
113
 
114
- }
114
+ end
115
115
 
116
- on_widget_disposed {
116
+ on_widget_disposed do
117
117
  @thread.kill # safe to kill since data is in memory only
118
- }
118
+ end
119
119
 
120
120
  }.open
@@ -105,17 +105,17 @@ class HelloTrayItem
105
105
  }
106
106
 
107
107
  # supported tray item listeners (you can try to add actions to them when needed)
108
- # on_swt_Show {
109
- # }
108
+ # on_swt_Show do
109
+ # end
110
110
  #
111
- # on_swt_Hide {
112
- # }
111
+ # on_swt_Hide do
112
+ # end
113
113
  #
114
- # on_widget_selected {
115
- # }
114
+ # on_widget_selected do
115
+ # end
116
116
  #
117
- # on_menu_detected {
118
- # }
117
+ # on_menu_detected do
118
+ # end
119
119
  }
120
120
 
121
121
  label(:center) {
Binary file
Binary file
Binary file
Binary file
Binary file
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.15.3
4
+ version: 4.21.0.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-29 00:00:00.000000000 Z
11
+ date: 2021-09-30 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.1.1
18
+ version: 2.1.5
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.1.1
26
+ version: 2.1.5
27
27
  - !ruby/object:Gem::Dependency
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
@@ -238,6 +238,20 @@ dependencies:
238
238
  - - "<"
239
239
  - !ruby/object:Gem::Version
240
240
  version: 4.0.0
241
+ - !ruby/object:Gem::Dependency
242
+ requirement: !ruby/object:Gem::Requirement
243
+ requirements:
244
+ - - '='
245
+ - !ruby/object:Gem::Version
246
+ version: 3.3.2
247
+ name: psych
248
+ prerelease: false
249
+ type: :runtime
250
+ version_requirements: !ruby/object:Gem::Requirement
251
+ requirements:
252
+ - - '='
253
+ - !ruby/object:Gem::Version
254
+ version: 3.3.2
241
255
  - !ruby/object:Gem::Dependency
242
256
  requirement: !ruby/object:Gem::Requirement
243
257
  requirements:
@@ -362,10 +376,10 @@ description: Glimmer DSL for SWT (JRuby Desktop Development GUI Framework) is a
362
376
  started quickly, Glimmer offers scaffolding options for Apps, Gems, and Custom Widgets.
363
377
  Glimmer also includes native-executable packaging support, sorely lacking in other
364
378
  libraries, thus enabling the delivery of desktop apps written in Ruby as truly native
365
- DMG/PKG/APP files on the Mac + App Store, MSI/EXE files on Windows, and Gem Packaged
366
- Shell Scripts on Linux. Glimmer was the first Ruby gem to bring SWT (Standard Widget
367
- Toolkit) to Ruby, thanks to creator Andy Maleh, EclipseCon/EclipseWorld/RubyConf
368
- speaker and expert.
379
+ DMG/PKG/APP files on the Mac, MSI/EXE files on Windows, and Gem Packaged Shell Scripts
380
+ on Linux. Glimmer was the first Ruby gem to bring SWT (Standard Widget Toolkit)
381
+ to Ruby, thanks to creator Andy Maleh, EclipseCon/EclipseWorld/RubyConf speaker
382
+ and expert.
369
383
  email: andy.am@gmail.com
370
384
  executables:
371
385
  - glimmer
@@ -712,7 +726,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
712
726
  - !ruby/object:Gem::Version
713
727
  version: '0'
714
728
  requirements: []
715
- rubygems_version: 3.1.6
729
+ rubygems_version: 3.2.28
716
730
  signing_key:
717
731
  specification_version: 4
718
732
  summary: Glimmer DSL for SWT (JRuby Desktop Development GUI Framework)