glimmer-dsl-swt 4.24.0.0 → 4.24.1.0
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 +18 -0
- data/README.md +51 -12
- data/RUBY_VERSION +1 -1
- data/VERSION +1 -1
- data/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md +704 -43
- data/docs/reference/GLIMMER_SAMPLES.md +2 -22
- data/glimmer-dsl-swt.gemspec +0 -0
- data/lib/glimmer/rake_task/scaffold.rb +10 -18
- data/lib/glimmer/swt/custom/shape/path_segment.rb +1 -0
- data/lib/glimmer/swt/custom/shape.rb +5 -2
- data/samples/elaborate/game_of_life.rb +2 -2
- data/samples/elaborate/meta_sample/tutorials.yml +4 -0
- data/samples/hello/hello_canvas_data_binding.rb +695 -38
- data/samples/hello/hello_canvas_drag_and_drop.rb +31 -2
- data/samples/hello/hello_canvas_path.rb +93 -89
- metadata +16 -2
@@ -82,7 +82,6 @@
|
|
82
82
|
- [Snake](#snake)
|
83
83
|
- [External Samples](#external-samples)
|
84
84
|
- [Glimmer Calculator](#glimmer-calculator)
|
85
|
-
- [Gladiator](#gladiator)
|
86
85
|
- [Timer](#timer)
|
87
86
|
- [Contact Manager App](#contact-manager-app)
|
88
87
|
- [License](#license)
|
@@ -863,7 +862,7 @@ Hello, Canvas! Colors Changed
|
|
863
862
|
|
864
863
|
Hello, Canvas! Data-Binding (changing a `text` shape `string` via data-binding changes from another thread)
|
865
864
|
|
866
|
-

|
865
|
+

|
867
866
|
|
868
867
|
#### Hello, Canvas Animation!
|
869
868
|
|
@@ -923,9 +922,7 @@ Code:
|
|
923
922
|
|
924
923
|
Hello, Canvas Data Binding!
|
925
924
|
|
926
|
-

|
925
|
+

|
929
926
|
|
930
927
|
#### Hello, Canvas Shape Listeners!
|
931
928
|
|
@@ -1407,23 +1404,6 @@ Snake
|
|
1407
1404
|
|
1408
1405
|
[<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-calculator/master/glimmer-cs-calculator-screenshot.png" />](https://github.com/AndyObtiva/glimmer-cs-calculator)
|
1409
1406
|
|
1410
|
-
#### Gladiator
|
1411
|
-
|
1412
|
-
[<img src='https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-gladiator/master/images/glimmer-cs-gladiator-logo.png' height=40 /> Gladiator](https://github.com/AndyObtiva/glimmer-cs-gladiator) (short for Glimmer Editor) is a Glimmer sample project under on-going development.
|
1413
|
-
You may check it out to learn how to build a Glimmer Custom Shell gem.
|
1414
|
-
|
1415
|
-
[<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-gladiator/master/images/glimmer-gladiator.png" />](https://github.com/AndyObtiva/glimmer-cs-gladiator)
|
1416
|
-
|
1417
|
-
Gladiator is a good demonstration of:
|
1418
|
-
- MVP Pattern
|
1419
|
-
- Tree data-binding
|
1420
|
-
- List data-binding
|
1421
|
-
- Text selection data-binding
|
1422
|
-
- Tabs
|
1423
|
-
- Context menus
|
1424
|
-
- Custom Shell
|
1425
|
-
- Custom widget
|
1426
|
-
|
1427
1407
|
#### Timer
|
1428
1408
|
|
1429
1409
|
[<img alt="Glimmer Timer Icon" src="https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-timer/master/images/glimmer-timer-logo.png" height=40 /> Timer](https://github.com/AndyObtiva/glimmer-cs-timer) is a sample app demonstrating data-binding, multi-threading, and JSound (Java Sound) library integration in a desktop application.
|
data/glimmer-dsl-swt.gemspec
CHANGED
Binary file
|
@@ -195,16 +195,12 @@ module Glimmer
|
|
195
195
|
system "bash -c '#{RVM_FUNCTION}\n cd .\n bundle\n rspec --init\n'"
|
196
196
|
end
|
197
197
|
write 'spec/spec_helper.rb', spec_helper_file
|
198
|
-
if OS.
|
199
|
-
system "
|
200
|
-
|
198
|
+
if OS.mac?
|
199
|
+
system "bash -c '#{RVM_FUNCTION}\n cd .\n JRUBY_OPTS=\"$JRUBY_OPTS -J-XstartOnFirstThread\" glimmer run\n'"
|
200
|
+
elsif OS.linux?
|
201
|
+
system "bash -c '#{RVM_FUNCTION}\n cd .\n glimmer run\n'"
|
201
202
|
else
|
202
|
-
system "
|
203
|
-
if OS.mac?
|
204
|
-
system "bash -c '#{RVM_FUNCTION}\n cd .\n JRUBY_OPTS=\"$JRUBY_OPTS -J-XstartOnFirstThread\" glimmer run\n'"
|
205
|
-
else
|
206
|
-
system "bash -c '#{RVM_FUNCTION}\n cd .\n glimmer run\n'"
|
207
|
-
end
|
203
|
+
system "glimmer run"
|
208
204
|
end
|
209
205
|
end
|
210
206
|
|
@@ -294,16 +290,12 @@ module Glimmer
|
|
294
290
|
cp File.expand_path('../../../../icons/scaffold_app.png', __FILE__), icon_file
|
295
291
|
puts "Created #{current_dir_name}/#{icon_file}"
|
296
292
|
|
297
|
-
if OS.
|
298
|
-
system "
|
299
|
-
|
293
|
+
if OS.mac?
|
294
|
+
system "bash -c '#{RVM_FUNCTION}\n cd .\n JRUBY_OPTS=\"$JRUBY_OPTS -J-XstartOnFirstThread\" glimmer run\n'"
|
295
|
+
elsif OS.linux?
|
296
|
+
system "bash -c '#{RVM_FUNCTION}\n cd .\n glimmer run\n'"
|
300
297
|
else
|
301
|
-
system "
|
302
|
-
if OS.mac?
|
303
|
-
system "bash -c '#{RVM_FUNCTION}\n cd .\n JRUBY_OPTS=\"$JRUBY_OPTS -J-XstartOnFirstThread\" glimmer run\n'"
|
304
|
-
else
|
305
|
-
system "bash -c '#{RVM_FUNCTION}\n cd .\n glimmer run\n'"
|
306
|
-
end
|
298
|
+
system "glimmer run"
|
307
299
|
end
|
308
300
|
puts "Finished creating #{gem_name} Ruby gem."
|
309
301
|
puts 'Edit Rakefile to configure gem details.'
|
@@ -98,6 +98,7 @@ module Glimmer
|
|
98
98
|
|
99
99
|
def add_to_swt_path(swt_path)
|
100
100
|
the_path_segment_args = path_segment_args.dup
|
101
|
+
the_path_segment_args = the_path_segment_args.first if the_path_segment_args.size == 1 && the_path_segment_args.first.is_a?(Array)
|
101
102
|
if !is_a?(Point) && self.class != Path
|
102
103
|
if !previous_point_connected?
|
103
104
|
if the_path_segment_args.count == default_path_segment_arg_count
|
@@ -562,7 +562,8 @@ module Glimmer
|
|
562
562
|
end
|
563
563
|
|
564
564
|
def has_attribute?(attribute_name, *args)
|
565
|
-
|
565
|
+
attribute_name == 'data' or
|
566
|
+
self.class.gc_instance_methods.include?(attribute_setter(attribute_name)) or
|
566
567
|
parameter_name?(attribute_name) or
|
567
568
|
(respond_to?(attribute_name, super: true) and respond_to?(ruby_attribute_setter(attribute_name), super: true))
|
568
569
|
end
|
@@ -577,7 +578,9 @@ module Glimmer
|
|
577
578
|
property_change = nil
|
578
579
|
ruby_attribute_getter_name = ruby_attribute_getter(attribute_name)
|
579
580
|
ruby_attribute_setter_name = ruby_attribute_setter(attribute_name)
|
580
|
-
if
|
581
|
+
if attribute_name == 'data'
|
582
|
+
set_data(*args)
|
583
|
+
elsif parameter_name?(attribute_name)
|
581
584
|
return if ruby_attribute_getter_name == (args.size == 1 ? args.first : args)
|
582
585
|
set_parameter_attribute(ruby_attribute_getter_name, *args)
|
583
586
|
elsif (respond_to?(attribute_name, super: true) and respond_to?(ruby_attribute_setter_name, super: true))
|
@@ -48,7 +48,7 @@ class GameOfLife
|
|
48
48
|
(0...HEIGHT).each do |row_index|
|
49
49
|
(0...WIDTH).each do |column_index|
|
50
50
|
rectangle(column_index*CELL_WIDTH, row_index*CELL_HEIGHT, CELL_WIDTH, CELL_HEIGHT) {
|
51
|
-
background <= [@grid.cell_rows[row_index][column_index],
|
51
|
+
background <= [@grid.cell_rows[row_index][column_index], :alive, on_read: ->(a) {a ? :black : :white}]
|
52
52
|
|
53
53
|
on_mouse_down do
|
54
54
|
@grid.cell_rows[row_index][column_index].toggle_aliveness!
|
@@ -59,7 +59,7 @@ class GameOfLife
|
|
59
59
|
end
|
60
60
|
|
61
61
|
on_mouse_move do
|
62
|
-
@grid.cell_rows[row_index][column_index].
|
62
|
+
@grid.cell_rows[row_index][column_index].live! if @drag_detected
|
63
63
|
end
|
64
64
|
|
65
65
|
on_mouse_up do
|
@@ -19,3 +19,7 @@ Hello, Date Time!: MpXbPEMUrns
|
|
19
19
|
Hello, Sash Form!: F7j2TTpbX6s
|
20
20
|
Hello, Cursor!: 4AYlo8n3WFc
|
21
21
|
Hello, Tray Item!: VYXgIr5zxMM
|
22
|
+
Hello, Drag And Drop!: zJSG5ysow0M
|
23
|
+
Hello, Canvas Drag And Drop!: e7taTbRrDAM
|
24
|
+
Game Of Life: pDE79YRjOjs
|
25
|
+
Hello, Canvas Data Binding!: PQ_Y8e5VeDo
|