glimmer-dsl-libui 0.11.6 → 0.11.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -3
  3. data/LICENSE.txt +1 -1
  4. data/README.md +55 -8
  5. data/VERSION +1 -1
  6. data/bin/girb +1 -1
  7. data/bin/girb_runner.rb +1 -1
  8. data/bin/glimmer +1 -1
  9. data/docs/examples/GLIMMER-DSL-LIBUI-ADVANCED-EXAMPLES.md +1 -1
  10. data/docs/examples/GLIMMER-DSL-LIBUI-BASIC-EXAMPLES.md +13 -689
  11. data/examples/basic_area.rb +3 -5
  12. data/examples/basic_area2.rb +6 -8
  13. data/examples/basic_area3.rb +5 -7
  14. data/examples/basic_area4.rb +8 -10
  15. data/examples/basic_table_button.rb +20 -22
  16. data/examples/basic_table_button2.rb +13 -15
  17. data/examples/basic_table_checkbox.rb +17 -19
  18. data/examples/basic_table_checkbox_text.rb +17 -19
  19. data/examples/basic_table_color.rb +8 -10
  20. data/examples/basic_table_color2.rb +7 -9
  21. data/examples/basic_table_color3.rb +7 -9
  22. data/examples/basic_table_image_text.rb +6 -8
  23. data/examples/basic_table_image_text2.rb +6 -8
  24. data/examples/basic_table_image_text3.rb +6 -8
  25. data/examples/date_time_picker.rb +17 -17
  26. data/examples/date_time_picker2.rb +5 -13
  27. data/examples/lazy_table.rb +8 -10
  28. data/examples/lazy_table2.rb +8 -10
  29. data/examples/lazy_table3.rb +8 -10
  30. data/examples/lazy_table4.rb +8 -10
  31. data/examples/simple_notepad.rb +1 -7
  32. data/examples/tetris/model/block.rb +1 -1
  33. data/examples/tetris/model/game.rb +1 -1
  34. data/examples/tetris/model/past_game.rb +1 -1
  35. data/examples/tetris/model/tetromino.rb +1 -1
  36. data/examples/tetris.rb +1 -1
  37. data/examples/tic_tac_toe/board.rb +1 -1
  38. data/examples/tic_tac_toe/cell.rb +1 -1
  39. data/glimmer-dsl-libui.gemspec +0 -0
  40. data/lib/glimmer/dsl/libui/bind_expression.rb +1 -1
  41. data/lib/glimmer/dsl/libui/content_expression.rb +1 -1
  42. data/lib/glimmer/dsl/libui/control_expression.rb +1 -1
  43. data/lib/glimmer/dsl/libui/custom_control_expression.rb +1 -1
  44. data/lib/glimmer/dsl/libui/custom_shape_expression.rb +1 -1
  45. data/lib/glimmer/dsl/libui/data_binding_expression.rb +1 -1
  46. data/lib/glimmer/dsl/libui/dsl.rb +1 -1
  47. data/lib/glimmer/dsl/libui/file_expression.rb +1 -1
  48. data/lib/glimmer/dsl/libui/listener_expression.rb +1 -1
  49. data/lib/glimmer/dsl/libui/observe_expression.rb +2 -1
  50. data/lib/glimmer/dsl/libui/open_file_expression.rb +1 -1
  51. data/lib/glimmer/dsl/libui/open_folder_expression.rb +1 -1
  52. data/lib/glimmer/dsl/libui/operation_expression.rb +1 -1
  53. data/lib/glimmer/dsl/libui/property_expression.rb +1 -1
  54. data/lib/glimmer/dsl/libui/save_file_expression.rb +1 -1
  55. data/lib/glimmer/dsl/libui/shape_expression.rb +1 -1
  56. data/lib/glimmer/dsl/libui/shine_data_binding_expression.rb +1 -1
  57. data/lib/glimmer/dsl/libui/string_expression.rb +1 -1
  58. data/lib/glimmer/dsl/libui/tab_item_expression.rb +1 -1
  59. data/lib/glimmer/fiddle_consumer.rb +1 -1
  60. data/lib/glimmer/libui/attributed_string.rb +1 -1
  61. data/lib/glimmer/libui/control_proxy/area_proxy/scrolling_area_proxy.rb +1 -1
  62. data/lib/glimmer/libui/control_proxy/area_proxy.rb +1 -1
  63. data/lib/glimmer/libui/control_proxy/box/horizontal_box_proxy.rb +1 -1
  64. data/lib/glimmer/libui/control_proxy/box/vertical_box_proxy.rb +1 -1
  65. data/lib/glimmer/libui/control_proxy/box.rb +1 -1
  66. data/lib/glimmer/libui/control_proxy/button_proxy.rb +1 -1
  67. data/lib/glimmer/libui/control_proxy/checkbox_proxy.rb +1 -1
  68. data/lib/glimmer/libui/control_proxy/color_button_proxy.rb +1 -1
  69. data/lib/glimmer/libui/control_proxy/column/background_color_column_proxy.rb +1 -1
  70. data/lib/glimmer/libui/control_proxy/column/button_column_proxy.rb +1 -1
  71. data/lib/glimmer/libui/control_proxy/column/checkbox_column_proxy.rb +1 -1
  72. data/lib/glimmer/libui/control_proxy/column/checkbox_text_color_column_proxy.rb +1 -1
  73. data/lib/glimmer/libui/control_proxy/column/checkbox_text_column_proxy.rb +1 -1
  74. data/lib/glimmer/libui/control_proxy/column/image_column_proxy.rb +1 -1
  75. data/lib/glimmer/libui/control_proxy/column/image_text_color_column_proxy.rb +1 -1
  76. data/lib/glimmer/libui/control_proxy/column/image_text_column_proxy.rb +1 -1
  77. data/lib/glimmer/libui/control_proxy/column/progress_bar_column_proxy.rb +1 -1
  78. data/lib/glimmer/libui/control_proxy/column/text_color_column_proxy.rb +1 -1
  79. data/lib/glimmer/libui/control_proxy/column/text_column_proxy.rb +1 -1
  80. data/lib/glimmer/libui/control_proxy/column.rb +1 -1
  81. data/lib/glimmer/libui/control_proxy/combobox_proxy.rb +1 -1
  82. data/lib/glimmer/libui/control_proxy/date_time_picker_proxy/date_picker_proxy.rb +1 -1
  83. data/lib/glimmer/libui/control_proxy/date_time_picker_proxy/time_picker_proxy.rb +1 -1
  84. data/lib/glimmer/libui/control_proxy/date_time_picker_proxy.rb +1 -1
  85. data/lib/glimmer/libui/control_proxy/dual_column.rb +1 -1
  86. data/lib/glimmer/libui/control_proxy/editable_column.rb +1 -1
  87. data/lib/glimmer/libui/control_proxy/editable_combobox_proxy.rb +1 -1
  88. data/lib/glimmer/libui/control_proxy/enableable_column.rb +1 -1
  89. data/lib/glimmer/libui/control_proxy/entry_proxy/password_entry_proxy.rb +1 -1
  90. data/lib/glimmer/libui/control_proxy/entry_proxy/search_entry_proxy.rb +1 -1
  91. data/lib/glimmer/libui/control_proxy/entry_proxy.rb +1 -1
  92. data/lib/glimmer/libui/control_proxy/font_button_proxy.rb +1 -1
  93. data/lib/glimmer/libui/control_proxy/form_proxy.rb +1 -1
  94. data/lib/glimmer/libui/control_proxy/grid_proxy.rb +1 -1
  95. data/lib/glimmer/libui/control_proxy/group_proxy.rb +1 -1
  96. data/lib/glimmer/libui/control_proxy/image_part_proxy.rb +1 -1
  97. data/lib/glimmer/libui/control_proxy/image_proxy.rb +1 -1
  98. data/lib/glimmer/libui/control_proxy/label_proxy.rb +1 -1
  99. data/lib/glimmer/libui/control_proxy/matrix_proxy.rb +1 -1
  100. data/lib/glimmer/libui/control_proxy/menu_item_proxy/about_menu_item_proxy.rb +1 -1
  101. data/lib/glimmer/libui/control_proxy/menu_item_proxy/check_menu_item_proxy.rb +1 -1
  102. data/lib/glimmer/libui/control_proxy/menu_item_proxy/preferences_menu_item_proxy.rb +1 -1
  103. data/lib/glimmer/libui/control_proxy/menu_item_proxy/quit_menu_item_proxy.rb +1 -1
  104. data/lib/glimmer/libui/control_proxy/menu_item_proxy/radio_menu_item_proxy.rb +1 -1
  105. data/lib/glimmer/libui/control_proxy/menu_item_proxy/separator_menu_item_proxy.rb +1 -1
  106. data/lib/glimmer/libui/control_proxy/menu_item_proxy.rb +1 -1
  107. data/lib/glimmer/libui/control_proxy/menu_proxy.rb +1 -1
  108. data/lib/glimmer/libui/control_proxy/message_box/msg_box_error_proxy.rb +1 -1
  109. data/lib/glimmer/libui/control_proxy/message_box/msg_box_proxy.rb +1 -1
  110. data/lib/glimmer/libui/control_proxy/message_box.rb +1 -1
  111. data/lib/glimmer/libui/control_proxy/multiline_entry_proxy/non_wrapping_multiline_entry_proxy.rb +1 -1
  112. data/lib/glimmer/libui/control_proxy/multiline_entry_proxy.rb +1 -1
  113. data/lib/glimmer/libui/control_proxy/open_type_features_proxy.rb +1 -1
  114. data/lib/glimmer/libui/control_proxy/open_type_tag_proxy.rb +1 -1
  115. data/lib/glimmer/libui/control_proxy/path_proxy.rb +1 -1
  116. data/lib/glimmer/libui/control_proxy/radio_buttons_proxy.rb +1 -1
  117. data/lib/glimmer/libui/control_proxy/slider_proxy.rb +1 -1
  118. data/lib/glimmer/libui/control_proxy/spinbox_proxy.rb +1 -1
  119. data/lib/glimmer/libui/control_proxy/tab_item_proxy.rb +1 -1
  120. data/lib/glimmer/libui/control_proxy/table_proxy.rb +7 -2
  121. data/lib/glimmer/libui/control_proxy/text_proxy.rb +1 -1
  122. data/lib/glimmer/libui/control_proxy/transformable.rb +7 -3
  123. data/lib/glimmer/libui/control_proxy/triple_column.rb +1 -1
  124. data/lib/glimmer/libui/control_proxy/window_proxy.rb +1 -1
  125. data/lib/glimmer/libui/control_proxy.rb +1 -1
  126. data/lib/glimmer/libui/custom_control/code_area.rb +1 -1
  127. data/lib/glimmer/libui/custom_control/refined_table.rb +1 -1
  128. data/lib/glimmer/libui/custom_control.rb +1 -1
  129. data/lib/glimmer/libui/custom_shape.rb +1 -1
  130. data/lib/glimmer/libui/custom_window.rb +1 -1
  131. data/lib/glimmer/libui/data_bindable.rb +1 -1
  132. data/lib/glimmer/libui/parent.rb +1 -1
  133. data/lib/glimmer/libui/shape/arc.rb +1 -1
  134. data/lib/glimmer/libui/shape/bezier.rb +1 -1
  135. data/lib/glimmer/libui/shape/circle.rb +1 -1
  136. data/lib/glimmer/libui/shape/figure.rb +1 -1
  137. data/lib/glimmer/libui/shape/line.rb +1 -1
  138. data/lib/glimmer/libui/shape/polybezier.rb +1 -1
  139. data/lib/glimmer/libui/shape/polygon.rb +1 -1
  140. data/lib/glimmer/libui/shape/polyline.rb +1 -1
  141. data/lib/glimmer/libui/shape/rectangle.rb +1 -1
  142. data/lib/glimmer/libui/shape/square.rb +1 -1
  143. data/lib/glimmer/libui/shape.rb +3 -3
  144. data/lib/glimmer/libui.rb +1 -1
  145. data/lib/glimmer/rake_task/package.rb +1 -1
  146. data/lib/glimmer/rake_task/scaffold.rb +1 -1
  147. data/lib/glimmer/rake_task.rb +1 -1
  148. data/lib/glimmer-dsl-libui.rb +1 -1
  149. metadata +5 -5
@@ -5,11 +5,9 @@ include Glimmer
5
5
  window('Basic Area', 400, 400) {
6
6
  margined true
7
7
 
8
- vertical_box {
9
- area {
10
- rectangle(0, 0, 400, 400) { # stable implicit path shape, added declaratively
11
- fill r: 102, g: 102, b: 204, a: 1.0
12
- }
8
+ area {
9
+ rectangle(0, 0, 400, 400) { # stable implicit path shape, added declaratively
10
+ fill r: 102, g: 102, b: 204, a: 1.0
13
11
  }
14
12
  }
15
13
  }.show
@@ -5,13 +5,11 @@ include Glimmer
5
5
  window('Basic Area', 400, 400) {
6
6
  margined true
7
7
 
8
- vertical_box {
9
- area {
10
- on_draw do |area_draw_params|
11
- rectangle(0, 0, 400, 400) { # dynamic implicit path shape, added semi-declaratively inside on_draw block
12
- fill r: 102, g: 102, b: 204, a: 1.0
13
- }
14
- end
15
- }
8
+ area {
9
+ on_draw do |area_draw_params|
10
+ rectangle(0, 0, 400, 400) { # dynamic implicit path shape, added semi-declaratively inside on_draw block
11
+ fill r: 102, g: 102, b: 204, a: 1.0
12
+ }
13
+ end
16
14
  }
17
15
  }.show
@@ -5,13 +5,11 @@ include Glimmer
5
5
  window('Basic Area', 400, 400) {
6
6
  margined true
7
7
 
8
- vertical_box {
9
- area {
10
- path { # stable path, added declaratively
11
- rectangle(0, 0, 400, 400)
12
-
13
- fill r: 102, g: 102, b: 204, a: 1.0
14
- }
8
+ area {
9
+ path { # stable path, added declaratively
10
+ rectangle(0, 0, 400, 400)
11
+
12
+ fill r: 102, g: 102, b: 204, a: 1.0
15
13
  }
16
14
  }
17
15
  }.show
@@ -5,15 +5,13 @@ include Glimmer
5
5
  window('Basic Area', 400, 400) {
6
6
  margined true
7
7
 
8
- vertical_box {
9
- area {
10
- on_draw do |area_draw_params|
11
- path { # dynamic path, added semi-declaratively inside on_draw block
12
- rectangle(0, 0, 400, 400)
13
-
14
- fill r: 102, g: 102, b: 204, a: 1.0
15
- }
16
- end
17
- }
8
+ area {
9
+ on_draw do |area_draw_params|
10
+ path { # dynamic path, added semi-declaratively inside on_draw block
11
+ rectangle(0, 0, 400, 400)
12
+
13
+ fill r: 102, g: 102, b: 204, a: 1.0
14
+ }
15
+ end
18
16
  }
19
17
  }.show
@@ -25,30 +25,28 @@ class BasicTableButton
25
25
 
26
26
  def launch
27
27
  window('Animal sounds', 400, 200) {
28
- horizontal_box {
29
- table {
30
- text_column('Animal')
31
- text_column('Description')
32
- button_column('Action') {
33
- on_clicked do |row|
34
- # Option 1: direct data deletion is the simpler solution
35
- # @animals.delete_at(row) # automatically deletes actual table row due to explicit data-binding
36
-
37
- # Option 2: cloning only to demonstrate table row deletion upon explicit setting of animals attribute (cloning is not recommended beyond demonstrating this point)
38
- new_animals = @animals.clone
39
- new_animals.delete_at(row)
40
- self.animals = new_animals # automatically loses deleted table row due to explicit data-binding
41
- end
42
- }
43
-
44
- cell_rows <= [self, :animals, column_attributes: {'Animal' => :name, 'Description' => :sound}]
45
-
46
- # explicit unidirectional data-binding of table cell_rows to self.animals
47
- on_changed do |row, type, row_data|
48
- puts "Row #{row} #{type}: #{row_data}"
49
- $stdout.flush
28
+ table {
29
+ text_column('Animal')
30
+ text_column('Description')
31
+ button_column('Action') {
32
+ on_clicked do |row|
33
+ # Option 1: direct data deletion is the simpler solution
34
+ # @animals.delete_at(row) # automatically deletes actual table row due to explicit data-binding
35
+
36
+ # Option 2: cloning only to demonstrate table row deletion upon explicit setting of animals attribute (cloning is not recommended beyond demonstrating this point)
37
+ new_animals = @animals.clone
38
+ new_animals.delete_at(row)
39
+ self.animals = new_animals # automatically loses deleted table row due to explicit data-binding
50
40
  end
51
41
  }
42
+
43
+ cell_rows <= [self, :animals, column_attributes: {'Animal' => :name, 'Description' => :sound}]
44
+
45
+ # explicit unidirectional data-binding of table cell_rows to self.animals
46
+ on_changed do |row, type, row_data|
47
+ puts "Row #{row} #{type}: #{row_data}"
48
+ $stdout.flush
49
+ end
52
50
  }
53
51
  }.show
54
52
  end
@@ -13,22 +13,20 @@ data = [
13
13
  ]
14
14
 
15
15
  window('Animal sounds', 400, 200) {
16
- horizontal_box {
17
- table {
18
- text_column('Animal')
19
- text_column('Description')
20
- button_column('Action') {
21
- on_clicked do |row|
22
- data.delete_at(row) # automatically deletes actual table row due to implicit data-binding
23
- end
24
- }
25
-
26
- cell_rows data # implicit data-binding
27
-
28
- on_changed do |row, type, row_data|
29
- puts "Row #{row} #{type}: #{row_data}"
30
- $stdout.flush
16
+ table {
17
+ text_column('Animal')
18
+ text_column('Description')
19
+ button_column('Action') {
20
+ on_clicked do |row|
21
+ data.delete_at(row) # automatically deletes actual table row due to implicit data-binding
31
22
  end
32
23
  }
24
+
25
+ cell_rows data # implicit data-binding
26
+
27
+ on_changed do |row, type, row_data|
28
+ puts "Row #{row} #{type}: #{row_data}"
29
+ $stdout.flush
30
+ end
33
31
  }
34
32
  }.show
@@ -13,25 +13,23 @@ data = [
13
13
  ]
14
14
 
15
15
  window('Animal sounds', 400, 200) {
16
- horizontal_box {
17
- table {
18
- text_column('Animal')
19
- text_column('Description')
20
- checkbox_column('Mammal') {
21
- editable true
22
- }
23
-
24
- cell_rows data
25
-
26
- on_changed do |row, type, row_data| # fires on all changes (even ones happening through data array)
27
- puts "Row #{row} #{type}: #{row_data}"
28
- $stdout.flush
29
- end
30
-
31
- on_edited do |row, row_data| # only fires on direct table editing
32
- puts "Row #{row} edited: #{row_data}"
33
- $stdout.flush
34
- end
16
+ table {
17
+ text_column('Animal')
18
+ text_column('Description')
19
+ checkbox_column('Mammal') {
20
+ editable true
35
21
  }
22
+
23
+ cell_rows data
24
+
25
+ on_changed do |row, type, row_data| # fires on all changes (even ones happening through data array)
26
+ puts "Row #{row} #{type}: #{row_data}"
27
+ $stdout.flush
28
+ end
29
+
30
+ on_edited do |row, row_data| # only fires on direct table editing
31
+ puts "Row #{row} edited: #{row_data}"
32
+ $stdout.flush
33
+ end
36
34
  }
37
35
  }.show
@@ -13,25 +13,23 @@ data = [
13
13
  ]
14
14
 
15
15
  window('Animal sounds', 400, 200) {
16
- horizontal_box {
17
- table {
18
- text_column('Animal')
19
- text_column('Sound')
20
- checkbox_text_column('Description') {
21
- editable true
22
- }
23
-
24
- cell_rows data
25
-
26
- on_changed do |row, type, row_data| # fires on all changes (even ones happening through data array)
27
- puts "Row #{row} #{type}: #{row_data.map(&:to_s)}"
28
- $stdout.flush
29
- end
30
-
31
- on_edited do |row, row_data| # only fires on direct table editing
32
- puts "Row #{row} edited: #{row_data.map(&:to_s)}"
33
- $stdout.flush
34
- end
16
+ table {
17
+ text_column('Animal')
18
+ text_column('Sound')
19
+ checkbox_text_column('Description') {
20
+ editable true
35
21
  }
22
+
23
+ cell_rows data
24
+
25
+ on_changed do |row, type, row_data| # fires on all changes (even ones happening through data array)
26
+ puts "Row #{row} #{type}: #{row_data.map(&:to_s)}"
27
+ $stdout.flush
28
+ end
29
+
30
+ on_edited do |row, row_data| # only fires on direct table editing
31
+ puts "Row #{row} edited: #{row_data.map(&:to_s)}"
32
+ $stdout.flush
33
+ end
36
34
  }
37
35
  }.show
@@ -89,16 +89,14 @@ class BasicTableColor
89
89
 
90
90
  def launch
91
91
  window('Animals', 500, 200) {
92
- horizontal_box {
93
- table {
94
- text_color_column('Animal')
95
- text_color_column('Sound')
96
- checkbox_text_color_column('Description')
97
- image_text_color_column('GUI')
98
- background_color_column # must always be the last column and always expects data-binding model attribute `background_color` when binding to Array of models
99
-
100
- cell_rows <= [self, :animals, column_attributes: {'Animal' => :name_color, 'Sound' => :sound_color, 'Description' => :mammal_description_color, 'GUI' => :image_description_color}]
101
- }
92
+ table {
93
+ text_color_column('Animal')
94
+ text_color_column('Sound')
95
+ checkbox_text_color_column('Description')
96
+ image_text_color_column('GUI')
97
+ background_color_column # must always be the last column and always expects data-binding model attribute `background_color` when binding to Array of models
98
+
99
+ cell_rows <= [self, :animals, column_attributes: {'Animal' => :name_color, 'Sound' => :sound_color, 'Description' => :mammal_description_color, 'GUI' => :image_description_color}]
102
100
  }
103
101
  }.show
104
102
  end
@@ -13,15 +13,13 @@ data = [
13
13
  ]
14
14
 
15
15
  window('Animals', 500, 200) {
16
- horizontal_box {
17
- table {
18
- text_color_column('Animal')
19
- text_color_column('Sound')
20
- checkbox_text_color_column('Description')
21
- image_text_color_column('GUI')
22
- background_color_column # must be the last column
16
+ table {
17
+ text_color_column('Animal')
18
+ text_color_column('Sound')
19
+ checkbox_text_color_column('Description')
20
+ image_text_color_column('GUI')
21
+ background_color_column # must be the last column
23
22
 
24
- cell_rows data
25
- }
23
+ cell_rows data
26
24
  }
27
25
  }.show
@@ -23,15 +23,13 @@ data = [
23
23
  ]
24
24
 
25
25
  window('Animals', 500, 200) {
26
- horizontal_box {
27
- table {
28
- text_color_column('Animal')
29
- text_color_column('Sound')
30
- checkbox_text_color_column('Description')
31
- image_text_color_column('GUI')
32
- background_color_column('Mammal')
26
+ table {
27
+ text_color_column('Animal')
28
+ text_color_column('Sound')
29
+ checkbox_text_color_column('Description')
30
+ image_text_color_column('GUI')
31
+ background_color_column('Mammal')
33
32
 
34
- cell_rows data
35
- }
33
+ cell_rows data
36
34
  }
37
35
  }.show
@@ -19,14 +19,12 @@ rescue StandardError => e
19
19
  end
20
20
 
21
21
  window('The Red Turtle', 670, 350) {
22
- horizontal_box {
23
- table {
24
- image_text_column('image/number')
25
- image_text_column('image/number (editable)') {
26
- editable true
27
- }
28
-
29
- cell_rows IMAGE_ROWS
22
+ table {
23
+ image_text_column('image/number')
24
+ image_text_column('image/number (editable)') {
25
+ editable true
30
26
  }
27
+
28
+ cell_rows IMAGE_ROWS
31
29
  }
32
30
  }.show
@@ -20,14 +20,12 @@ rescue StandardError => e
20
20
  end
21
21
 
22
22
  window('The Red Turtle', 670, 350) {
23
- horizontal_box {
24
- table {
25
- image_text_column('image/number')
26
- image_text_column('image/number (editable)') {
27
- editable true
28
- }
29
-
30
- cell_rows IMAGE_ROWS
23
+ table {
24
+ image_text_column('image/number')
25
+ image_text_column('image/number (editable)') {
26
+ editable true
31
27
  }
28
+
29
+ cell_rows IMAGE_ROWS
32
30
  }
33
31
  }.show
@@ -31,14 +31,12 @@ rescue StandardError => e
31
31
  end
32
32
 
33
33
  window('The Red Turtle', 670, 350) {
34
- horizontal_box {
35
- table {
36
- image_text_column('image/number')
37
- image_text_column('image/number (editable)') {
38
- editable true
39
- }
40
-
41
- cell_rows IMAGE_ROWS
34
+ table {
35
+ image_text_column('image/number')
36
+ image_text_column('image/number (editable)') {
37
+ editable true
42
38
  }
39
+
40
+ cell_rows IMAGE_ROWS
43
41
  }
44
42
  }.show
@@ -1,25 +1,25 @@
1
- # frozen_string_literal: true
2
-
3
1
  require 'glimmer-dsl-libui'
4
2
 
5
- class DateTimePicker
6
- include Glimmer
3
+ class Event
4
+ attr_accessor :time
5
+ end
6
+
7
+ class DateTimePickerApplication
8
+ include Glimmer::LibUI::Application
7
9
 
8
- attr_accessor :picked_time
10
+ before_body do
11
+ @event = Event.new
12
+ end
9
13
 
10
- def launch
14
+ body {
11
15
  window('Date Time Pickers', 300, 200) {
12
- vertical_box {
13
- date_time_picker {
14
- time <=> [self, :picked_time, after_write: ->(time) { p time }]
15
- }
16
+ date_time_picker {
17
+ time <=> [@event, :time,
18
+ after_write: ->(time) { p time }
19
+ ]
16
20
  }
17
-
18
- on_closing do
19
- puts 'Bye Bye'
20
- end
21
- }.show
22
- end
21
+ }
22
+ }
23
23
  end
24
24
 
25
- DateTimePicker.new.launch
25
+ DateTimePickerApplication.launch
@@ -1,20 +1,12 @@
1
- # frozen_string_literal: true
2
-
3
1
  require 'glimmer-dsl-libui'
4
2
 
5
3
  include Glimmer
6
4
 
7
5
  window('Date Time Pickers', 300, 200) {
8
- vertical_box {
9
- date_time_picker { |dtp|
10
- on_changed do
11
- time = dtp.time
12
- p time
13
- end
14
- }
6
+ date_time_picker { |dtp|
7
+ on_changed do
8
+ time = dtp.time
9
+ p time
10
+ end
15
11
  }
16
-
17
- on_closing do
18
- puts 'Bye Bye'
19
- end
20
12
  }.show
@@ -58,16 +58,14 @@ class LazyTable
58
58
  window("1,000,000 Lazy Loaded Contacts", 600, 700) {
59
59
  margined true
60
60
 
61
- vertical_box {
62
- table {
63
- text_column('Name')
64
- text_column('Email')
65
- text_column('Phone')
66
- text_column('City')
67
- text_column('State')
68
-
69
- cell_rows ContactGenerator.new(1_000_000)
70
- }
61
+ table {
62
+ text_column('Name')
63
+ text_column('Email')
64
+ text_column('Phone')
65
+ text_column('City')
66
+ text_column('State')
67
+
68
+ cell_rows ContactGenerator.new(1_000_000)
71
69
  }
72
70
  }
73
71
  }
@@ -53,16 +53,14 @@ class LazyTable
53
53
  window("1,000,000 Lazy Loaded Contacts", 600, 700) {
54
54
  margined true
55
55
 
56
- vertical_box {
57
- table {
58
- text_column('Name')
59
- text_column('Email')
60
- text_column('Phone')
61
- text_column('City')
62
- text_column('State')
63
-
64
- cell_rows @contacts
65
- }
56
+ table {
57
+ text_column('Name')
58
+ text_column('Email')
59
+ text_column('Phone')
60
+ text_column('City')
61
+ text_column('State')
62
+
63
+ cell_rows @contacts
66
64
  }
67
65
  }
68
66
  }
@@ -56,16 +56,14 @@ class LazyTable
56
56
  window("1,000,000 Lazy Loaded Contacts", 600, 700) {
57
57
  margined true
58
58
 
59
- vertical_box {
60
- table {
61
- text_column('Name')
62
- text_column('Email')
63
- text_column('Phone')
64
- text_column('City')
65
- text_column('State')
66
-
67
- cell_rows ContactGenerator.new(1_000_000)
68
- }
59
+ table {
60
+ text_column('Name')
61
+ text_column('Email')
62
+ text_column('Phone')
63
+ text_column('City')
64
+ text_column('State')
65
+
66
+ cell_rows ContactGenerator.new(1_000_000)
69
67
  }
70
68
  }
71
69
  }
@@ -51,16 +51,14 @@ class LazyTable
51
51
  window("1,000,000 Lazy Loaded Contacts", 600, 700) {
52
52
  margined true
53
53
 
54
- vertical_box {
55
- table {
56
- text_column('Name')
57
- text_column('Email')
58
- text_column('Phone')
59
- text_column('City')
60
- text_column('State')
61
-
62
- cell_rows @contacts
63
- }
54
+ table {
55
+ text_column('Name')
56
+ text_column('Email')
57
+ text_column('Phone')
58
+ text_column('City')
59
+ text_column('State')
60
+
61
+ cell_rows @contacts
64
62
  }
65
63
  }
66
64
  }
@@ -5,11 +5,5 @@ require 'glimmer-dsl-libui'
5
5
  include Glimmer
6
6
 
7
7
  window('Notepad', 500, 300) {
8
- on_closing do
9
- puts 'Bye Bye'
10
- end
11
-
12
- vertical_box {
13
- non_wrapping_multiline_entry
14
- }
8
+ non_wrapping_multiline_entry
15
9
  }.show
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2021-2023 Andy Maleh
1
+ # Copyright (c) 2021-2024 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2021-2023 Andy Maleh
1
+ # Copyright (c) 2021-2024 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2021-2023 Andy Maleh
1
+ # Copyright (c) 2021-2024 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2021-2023 Andy Maleh
1
+ # Copyright (c) 2021-2024 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
data/examples/tetris.rb CHANGED
@@ -396,7 +396,7 @@ class Tetris
396
396
 
397
397
  def show_about_dialog
398
398
  Glimmer::LibUI.queue_main do
399
- msg_box('About', 'Glimmer Tetris - Glimmer DSL for LibUI Example - Copyright (c) 2021-2023 Andy Maleh')
399
+ msg_box('About', 'Glimmer Tetris - Glimmer DSL for LibUI Example - Copyright (c) 2021-2024 Andy Maleh')
400
400
  end
401
401
  end
402
402
  end
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2021-2023 Andy Maleh
1
+ # Copyright (c) 2021-2024 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2021-2023 Andy Maleh
1
+ # Copyright (c) 2021-2024 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
Binary file
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2021-2023 Andy Maleh
1
+ # Copyright (c) 2021-2024 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2021-2023 Andy Maleh
1
+ # Copyright (c) 2021-2024 Andy Maleh
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the