glimmer-dsl-swt 4.18.3.5 → 4.18.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -82,6 +82,9 @@ module Glimmer
82
82
  end
83
83
  end
84
84
  end
85
+ on_widget_disposed {
86
+ clear_shapes
87
+ }
85
88
  @display ||= @swt_widget.getDisplay
86
89
  end
87
90
 
@@ -165,6 +165,11 @@ module Glimmer
165
165
  DEFAULT_INITIALIZERS[underscored_widget_name.to_s.to_sym]&.call(@swt_widget)
166
166
  @parent_proxy.post_initialize_child(self)
167
167
  end
168
+ if respond_to?(:on_widget_disposed)
169
+ on_widget_disposed {
170
+ clear_shapes
171
+ }
172
+ end
168
173
  end
169
174
 
170
175
  # Subclasses may override to perform post initialization work on an added child
@@ -204,7 +204,7 @@ class MetaSampleApplication
204
204
  shell(:fill_screen) {
205
205
  minimum_size 1280, 768
206
206
  text 'Glimmer Meta-Sample (The Sample of Samples)'
207
- image File.expand_path('../../icons/scaffold_app.png', __dir__)
207
+ image File.expand_path('meta_sample/meta_sample_logo.png', __dir__)
208
208
 
209
209
  sash_form {
210
210
  composite {
@@ -51,7 +51,7 @@ class Tetris
51
51
  @high_scores = []
52
52
  @show_high_scores = false
53
53
  @beeping = true
54
- @up_arrow_action = :instant_down
54
+ @up_arrow_action = :rotate_left
55
55
  load_high_scores!
56
56
  end
57
57
 
@@ -22,22 +22,22 @@
22
22
  include Glimmer
23
23
 
24
24
  shell {
25
- text 'Hello, Canvas!'
25
+ text 'Hello, Canvas Image Icon!'
26
26
  minimum_size 320, 400
27
27
 
28
28
  canvas {
29
29
  background :yellow
30
- rectangle(0, 0, 220, 400, fill: true) {
30
+ rectangle(0, 0, 220, 400) {
31
31
  background :red
32
32
  }
33
- rectangle(50, 20, 300, 150, 30, 50, round: true) {
33
+ rectangle(50, 20, 300, 150, 30, 50) {
34
34
  background :magenta
35
35
  }
36
- rectangle(150, 200, 100, 70, true, gradient: true) {
36
+ rectangle(150, 200, 100, 70, true) {
37
37
  background :dark_magenta
38
38
  foreground :yellow
39
39
  }
40
- rectangle(50, 200, 30, 70, false, gradient: true) {
40
+ rectangle(50, 200, 30, 70, false) {
41
41
  background :magenta
42
42
  foreground :dark_blue
43
43
  }
@@ -50,7 +50,8 @@ shell {
50
50
  font name: 'Courier', height: 30
51
51
  }
52
52
  oval(110, 310, 100, 100) {
53
- background rgb(128, 138, 248)
53
+ # patterns provide a differnet way to make gradients
54
+ background_pattern 0, 0, 105, 0, :yellow, rgb(128, 138, 248)
54
55
  }
55
56
  arc(210, 210, 100, 100, 30, -77) {
56
57
  background :red
@@ -51,9 +51,9 @@ shell {
51
51
  frame { |index, color| # frame block loops indefinitely (unless frame_count or cycle_count is set to an integer)
52
52
  outside_color = colors[index % 2]
53
53
  inside_color = colors[(index + 1) % 2]
54
-
54
+
55
55
  background outside_color # sets canvas background color
56
-
56
+
57
57
  rectangle(0, 0, 200, 200) {
58
58
  background inside_color # sets rectangle background color
59
59
  }
@@ -28,8 +28,8 @@ shell {
28
28
  tab_folder {
29
29
  tab_item {
30
30
  fill_layout
31
- text 'ruby (glimmer theme)'
32
- code_text(language: 'ruby', theme: 'glimmer') {
31
+ text 'Ruby (glimmer theme)'
32
+ code_text(language: 'ruby', theme: 'glimmer', lines: true) {
33
33
  text <<~CODE
34
34
  greeting = 'Hello, World!'
35
35
 
@@ -42,13 +42,34 @@ shell {
42
42
  text greeting
43
43
  font height: 30, style: :bold
44
44
  }
45
+ }.open
46
+ CODE
47
+ }
48
+ }
49
+ tab_item {
50
+ fill_layout
51
+ text 'JavaScript (pastie theme)'
52
+ code_text(language: 'javascript', theme: 'pastie', lines: {width: 2}) {
53
+ text <<~CODE
54
+ function greet(greeting) {
55
+ alert(greeting);
56
+ }
57
+
58
+ var greetingString = 'Hello, World!';
59
+
60
+ greet(greetingString);
61
+
62
+ var moreGreetings = ['Howdy!', 'Aloha!', 'Hey!']
63
+
64
+ for(var greeting of moreGreetings) {
65
+ greet(greeting)
45
66
  }
46
67
  CODE
47
68
  }
48
69
  }
49
70
  tab_item {
50
71
  fill_layout
51
- text 'html (github theme)'
72
+ text 'HTML (github theme)'
52
73
  code_text(language: 'html', theme: 'github') {
53
74
  text <<~CODE
54
75
  <html>
@@ -67,18 +88,5 @@ shell {
67
88
  CODE
68
89
  }
69
90
  }
70
- tab_item {
71
- fill_layout
72
- text 'javascript (pastie theme)'
73
- code_text(language: 'javascript', theme: 'pastie') {
74
- text <<~CODE
75
- function helloWorld(greeting) {
76
- alert(greeting);
77
- }
78
- var greetingString = 'Hello, World!';
79
- helloWorld(greetingString);
80
- CODE
81
- }
82
- }
83
91
  }
84
92
  }.open
@@ -186,18 +186,20 @@ class HelloTable
186
186
  grid_layout
187
187
 
188
188
  text 'Hello, Table!'
189
+ background_image File.expand_path('hello_table/baseball_park.png', __dir__)
189
190
 
190
191
  label {
191
192
  layout_data :center, :center, true, false
192
193
 
193
- text 'Baseball Playoff Schedule'
194
- font height: 30, style: :bold
194
+ text 'BASEBALL PLAYOFF SCHEDULE'
195
+ foreground rgb(94, 107, 103)
196
+ font name: 'Optima', height: 38, style: :bold
195
197
  }
196
198
 
197
199
  combo(:read_only) {
198
200
  layout_data :center, :center, true, false
199
201
  selection bind(BaseballGame, :playoff_type)
200
- font height: 16
202
+ font height: 14
201
203
  }
202
204
 
203
205
  table(:editable) { |table_proxy|
@@ -262,7 +264,7 @@ class HelloTable
262
264
  button {
263
265
  text 'Book Selected Game'
264
266
  layout_data :center, :center, true, false
265
- font height: 16
267
+ font height: 14
266
268
  enabled bind(BaseballGame, :selected_game)
267
269
 
268
270
  on_widget_selected {
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.18.3.5
4
+ version: 4.18.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - AndyMaleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-01 00:00:00.000000000 Z
11
+ date: 2021-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -469,6 +469,7 @@ files:
469
469
  - samples/elaborate/contact_manager/contact_repository.rb
470
470
  - samples/elaborate/login.rb
471
471
  - samples/elaborate/meta_sample.rb
472
+ - samples/elaborate/meta_sample/meta_sample_logo.png
472
473
  - samples/elaborate/tetris.rb
473
474
  - samples/elaborate/tetris/model/block.rb
474
475
  - samples/elaborate/tetris/model/game.rb
@@ -516,6 +517,7 @@ files:
516
517
  - samples/hello/hello_styled_text.rb
517
518
  - samples/hello/hello_tab.rb
518
519
  - samples/hello/hello_table.rb
520
+ - samples/hello/hello_table/baseball_park.png
519
521
  - samples/hello/hello_world.rb
520
522
  - vendor/swt/linux/swt.jar
521
523
  - vendor/swt/mac/swt.jar