glimmer-dsl-swt 4.18.3.4 → 4.18.4.3
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +55 -0
- data/README.md +600 -331
- data/VERSION +1 -1
- data/glimmer-dsl-swt.gemspec +8 -3
- data/lib/ext/rouge/themes/glimmer.rb +29 -0
- data/lib/glimmer-dsl-swt.rb +0 -1
- data/lib/glimmer/data_binding/widget_binding.rb +1 -1
- data/lib/glimmer/swt/custom/code_text.rb +200 -51
- data/lib/glimmer/swt/custom/drawable.rb +1 -4
- data/lib/glimmer/swt/custom/shape.rb +50 -6
- data/lib/glimmer/swt/date_time_proxy.rb +1 -3
- data/lib/glimmer/swt/display_proxy.rb +11 -0
- data/lib/glimmer/swt/font_proxy.rb +1 -0
- data/lib/glimmer/swt/image_proxy.rb +11 -0
- data/lib/glimmer/swt/layout_proxy.rb +4 -1
- data/lib/glimmer/swt/shell_proxy.rb +4 -1
- data/lib/glimmer/swt/table_proxy.rb +17 -13
- data/lib/glimmer/swt/widget_proxy.rb +11 -3
- data/samples/elaborate/meta_sample.rb +15 -4
- data/samples/elaborate/meta_sample/meta_sample_logo.png +0 -0
- data/samples/elaborate/tetris.rb +16 -6
- data/samples/elaborate/tetris/model/game.rb +3 -3
- data/samples/elaborate/tetris/model/past_game.rb +14 -1
- data/samples/elaborate/tetris/view/block.rb +1 -1
- data/samples/elaborate/tetris/view/high_score_dialog.rb +1 -10
- data/samples/elaborate/tetris/view/playfield.rb +1 -1
- data/samples/elaborate/tetris/view/tetris_menu_bar.rb +13 -11
- data/samples/hello/hello_canvas.rb +7 -6
- data/samples/hello/hello_canvas_animation.rb +3 -3
- data/samples/hello/hello_canvas_transform.rb +1 -1
- data/samples/hello/hello_canvas_transform/hello_canvas_transform_image.png +0 -0
- data/samples/hello/hello_code_text.rb +104 -0
- data/samples/hello/hello_table.rb +7 -4
- data/samples/hello/hello_table/baseball_park.png +0 -0
- metadata +7 -2
@@ -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
|
30
|
+
rectangle(0, 0, 220, 400) {
|
31
31
|
background :red
|
32
32
|
}
|
33
|
-
rectangle(50, 20, 300, 150, 30, 50
|
33
|
+
rectangle(50, 20, 300, 150, 30, 50) {
|
34
34
|
background :magenta
|
35
35
|
}
|
36
|
-
rectangle(150, 200, 100, 70, 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
|
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
|
-
|
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
|
@@ -25,7 +25,7 @@ shell {
|
|
25
25
|
text 'Hello, Canvas Animation!'
|
26
26
|
minimum_size 800, 420
|
27
27
|
|
28
|
-
canvas {
|
28
|
+
canvas(:double_buffered) {
|
29
29
|
animation {
|
30
30
|
every 0.01 # in seconds (one hundredth)
|
31
31
|
|
@@ -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
|
}
|
@@ -0,0 +1,104 @@
|
|
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
|
+
include Glimmer
|
23
|
+
|
24
|
+
shell {
|
25
|
+
minimum_size 640, 480
|
26
|
+
text 'Hello, Code Text!'
|
27
|
+
|
28
|
+
tab_folder {
|
29
|
+
tab_item {
|
30
|
+
fill_layout
|
31
|
+
text 'Ruby (glimmer theme)'
|
32
|
+
code_text(language: 'ruby', theme: 'glimmer', lines: true) {
|
33
|
+
text <<~CODE
|
34
|
+
greeting = 'Hello, World!'
|
35
|
+
|
36
|
+
include Glimmer
|
37
|
+
|
38
|
+
shell {
|
39
|
+
text 'Glimmer'
|
40
|
+
|
41
|
+
label {
|
42
|
+
text greeting
|
43
|
+
font height: 30, style: :bold
|
44
|
+
}
|
45
|
+
}.open
|
46
|
+
CODE
|
47
|
+
}
|
48
|
+
}
|
49
|
+
tab_item {
|
50
|
+
fill_layout
|
51
|
+
text 'JavaScript (pastie theme)'
|
52
|
+
# No border (SWT styles are passed explicitly)
|
53
|
+
code_text(:multi, :h_scroll, :v_scroll, language: 'javascript', theme: 'pastie', lines: {width: 2}) {
|
54
|
+
# With lines, the custom widget has a root composite, which can be configured separately
|
55
|
+
root {
|
56
|
+
grid_layout(2, false) {
|
57
|
+
margin_width 2
|
58
|
+
}
|
59
|
+
background :white
|
60
|
+
}
|
61
|
+
# With lines, the line numbers widget can be configured separately
|
62
|
+
line_numbers {
|
63
|
+
background :white
|
64
|
+
}
|
65
|
+
text <<~CODE
|
66
|
+
function greet(greeting) {
|
67
|
+
alert(greeting);
|
68
|
+
}
|
69
|
+
|
70
|
+
var greetingString = 'Hello, World!';
|
71
|
+
|
72
|
+
greet(greetingString);
|
73
|
+
|
74
|
+
var moreGreetings = ['Howdy!', 'Aloha!', 'Hey!']
|
75
|
+
|
76
|
+
for(var greeting of moreGreetings) {
|
77
|
+
greet(greeting)
|
78
|
+
}
|
79
|
+
CODE
|
80
|
+
}
|
81
|
+
}
|
82
|
+
tab_item {
|
83
|
+
fill_layout
|
84
|
+
text 'HTML (github theme)'
|
85
|
+
code_text(language: 'html', theme: 'github') {
|
86
|
+
text <<~CODE
|
87
|
+
<html>
|
88
|
+
<body>
|
89
|
+
<section class="accordion">
|
90
|
+
<form method="post" id="name">
|
91
|
+
<label for="name">
|
92
|
+
Name
|
93
|
+
</label>
|
94
|
+
<input name="name" type="text" />
|
95
|
+
<input type="submit" />
|
96
|
+
</form>
|
97
|
+
</section>
|
98
|
+
</body>
|
99
|
+
</html>
|
100
|
+
CODE
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|
104
|
+
}.open
|
@@ -186,18 +186,21 @@ 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 '
|
194
|
-
|
194
|
+
text 'BASEBALL PLAYOFF SCHEDULE'
|
195
|
+
background :transparent
|
196
|
+
foreground rgb(94, 107, 103)
|
197
|
+
font name: 'Optima', height: 38, style: :bold
|
195
198
|
}
|
196
199
|
|
197
200
|
combo(:read_only) {
|
198
201
|
layout_data :center, :center, true, false
|
199
202
|
selection bind(BaseballGame, :playoff_type)
|
200
|
-
font height:
|
203
|
+
font height: 14
|
201
204
|
}
|
202
205
|
|
203
206
|
table(:editable) { |table_proxy|
|
@@ -262,7 +265,7 @@ class HelloTable
|
|
262
265
|
button {
|
263
266
|
text 'Book Selected Game'
|
264
267
|
layout_data :center, :center, true, false
|
265
|
-
font height:
|
268
|
+
font height: 14
|
266
269
|
enabled bind(BaseballGame, :selected_game)
|
267
270
|
|
268
271
|
on_widget_selected {
|
Binary file
|
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
|
4
|
+
version: 4.18.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AndyMaleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -367,6 +367,7 @@ files:
|
|
367
367
|
- icons/scaffold_app.png
|
368
368
|
- lib/ext/glimmer.rb
|
369
369
|
- lib/ext/glimmer/config.rb
|
370
|
+
- lib/ext/rouge/themes/glimmer.rb
|
370
371
|
- lib/glimmer-dsl-swt.rb
|
371
372
|
- lib/glimmer/Rakefile
|
372
373
|
- lib/glimmer/data_binding/list_selection_binding.rb
|
@@ -468,6 +469,7 @@ files:
|
|
468
469
|
- samples/elaborate/contact_manager/contact_repository.rb
|
469
470
|
- samples/elaborate/login.rb
|
470
471
|
- samples/elaborate/meta_sample.rb
|
472
|
+
- samples/elaborate/meta_sample/meta_sample_logo.png
|
471
473
|
- samples/elaborate/tetris.rb
|
472
474
|
- samples/elaborate/tetris/model/block.rb
|
473
475
|
- samples/elaborate/tetris/model/game.rb
|
@@ -487,8 +489,10 @@ files:
|
|
487
489
|
- samples/hello/hello_canvas.rb
|
488
490
|
- samples/hello/hello_canvas_animation.rb
|
489
491
|
- samples/hello/hello_canvas_transform.rb
|
492
|
+
- samples/hello/hello_canvas_transform/hello_canvas_transform_image.png
|
490
493
|
- samples/hello/hello_checkbox.rb
|
491
494
|
- samples/hello/hello_checkbox_group.rb
|
495
|
+
- samples/hello/hello_code_text.rb
|
492
496
|
- samples/hello/hello_combo.rb
|
493
497
|
- samples/hello/hello_computed.rb
|
494
498
|
- samples/hello/hello_computed/contact.rb
|
@@ -514,6 +518,7 @@ files:
|
|
514
518
|
- samples/hello/hello_styled_text.rb
|
515
519
|
- samples/hello/hello_tab.rb
|
516
520
|
- samples/hello/hello_table.rb
|
521
|
+
- samples/hello/hello_table/baseball_park.png
|
517
522
|
- samples/hello/hello_world.rb
|
518
523
|
- vendor/swt/linux/swt.jar
|
519
524
|
- vendor/swt/mac/swt.jar
|