glimmer-dsl-swt 4.23.1.5 → 4.24.0.2

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.
@@ -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
- ![Hello Canvas Data Binding](/images/glimmer-hello-canvas-data-binding.gif)
865
+ ![Hello Canvas Text Data Binding](/images/glimmer-hello-canvas-text-data-binding.gif)
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
- ![Hello Canvas Data Binding](/images/glimmer-hello-canvas-data-binding.png)
927
-
928
- ![Hello Canvas Data Binding Line Changed](/images/glimmer-hello-canvas-data-binding-line-changed.png)
925
+ ![Hello Canvas Data Binding](/images/glimmer-hello-canvas-data-binding.gif)
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.
Binary file
@@ -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
- self.class.gc_instance_methods.include?(attribute_setter(attribute_name)) or
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 parameter_name?(attribute_name)
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))
@@ -74,9 +74,6 @@ module Glimmer
74
74
  DisplayProxy.instance.auto_exec { parent.swt_widget.setMenuBar(swt_widget) }
75
75
  elsif styles.include?(:pop_up)
76
76
  if parent.swt_widget.is_a?(TrayItem)
77
- parent.on_widget_selected {
78
- self.visible = true
79
- }
80
77
  parent.on_menu_detected {
81
78
  self.visible = true
82
79
  }
@@ -35,7 +35,7 @@ class GameOfLife
35
35
  def initialize(row_count=DEFAULT_ROW_COUNT, column_count=DEFAULT_COLUMN_COUNT)
36
36
  @row_count = row_count
37
37
  @column_count = column_count
38
- @speed = 1.0
38
+ @speed = 10.0
39
39
  build_cells
40
40
  end
41
41
 
@@ -48,11 +48,23 @@ 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], "alive", on_read: ->(a) {a ? :black : :white}]
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!
55
55
  end
56
+
57
+ on_drag_detected do
58
+ @drag_detected = true
59
+ end
60
+
61
+ on_mouse_move do
62
+ @grid.cell_rows[row_index][column_index].live! if @drag_detected
63
+ end
64
+
65
+ on_mouse_up do
66
+ @drag_detected = false
67
+ end
56
68
  }
57
69
  end
58
70
  end
@@ -17,3 +17,8 @@ Hello, Menu Bar!: 3RRVFIfA_UM
17
17
  Weather: rC6x6aj1MdA
18
18
  Hello, Date Time!: MpXbPEMUrns
19
19
  Hello, Sash Form!: F7j2TTpbX6s
20
+ Hello, Cursor!: 4AYlo8n3WFc
21
+ Hello, Tray Item!: VYXgIr5zxMM
22
+ Hello, Drag And Drop!: zJSG5ysow0M
23
+ Hello, Canvas Drag And Drop!: e7taTbRrDAM
24
+ Game Of Life: pDE79YRjOjs