glimmer-dsl-libui 0.11.7 → 0.11.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/LICENSE.txt +1 -1
- data/README.md +83 -14
- data/VERSION +1 -1
- data/bin/girb +1 -1
- data/bin/girb_runner.rb +1 -1
- data/bin/glimmer +1 -1
- data/docs/examples/GLIMMER-DSL-LIBUI-ADVANCED-EXAMPLES.md +1 -1
- data/docs/examples/GLIMMER-DSL-LIBUI-BASIC-EXAMPLES.md +13 -689
- data/examples/basic_area.rb +3 -5
- data/examples/basic_area2.rb +6 -8
- data/examples/basic_area3.rb +5 -7
- data/examples/basic_area4.rb +8 -10
- data/examples/basic_table_button.rb +20 -22
- data/examples/basic_table_button2.rb +13 -15
- data/examples/basic_table_checkbox.rb +17 -19
- data/examples/basic_table_checkbox_text.rb +17 -19
- data/examples/basic_table_color.rb +8 -10
- data/examples/basic_table_color2.rb +7 -9
- data/examples/basic_table_color3.rb +7 -9
- data/examples/basic_table_image_text.rb +6 -8
- data/examples/basic_table_image_text2.rb +6 -8
- data/examples/basic_table_image_text3.rb +6 -8
- data/examples/date_time_picker.rb +17 -17
- data/examples/date_time_picker2.rb +5 -13
- data/examples/lazy_table.rb +8 -10
- data/examples/lazy_table2.rb +8 -10
- data/examples/lazy_table3.rb +8 -10
- data/examples/lazy_table4.rb +8 -10
- data/examples/simple_notepad.rb +1 -7
- data/examples/tetris/model/block.rb +1 -1
- data/examples/tetris/model/game.rb +1 -1
- data/examples/tetris/model/past_game.rb +1 -1
- data/examples/tetris/model/tetromino.rb +1 -1
- data/examples/tetris.rb +1 -1
- data/examples/tic_tac_toe/board.rb +1 -1
- data/examples/tic_tac_toe/cell.rb +1 -1
- data/glimmer-dsl-libui.gemspec +0 -0
- data/lib/glimmer/dsl/libui/bind_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/content_expression.rb +2 -1
- data/lib/glimmer/dsl/libui/control_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/custom_control_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/custom_shape_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/data_binding_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/dsl.rb +1 -1
- data/lib/glimmer/dsl/libui/file_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/listener_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/observe_expression.rb +2 -1
- data/lib/glimmer/dsl/libui/open_file_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/open_folder_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/operation_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/property_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/save_file_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/shape_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/shine_data_binding_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/string_expression.rb +1 -1
- data/lib/glimmer/dsl/libui/tab_item_expression.rb +1 -1
- data/lib/glimmer/fiddle_consumer.rb +1 -1
- data/lib/glimmer/libui/attributed_string.rb +1 -1
- data/lib/glimmer/libui/control_proxy/area_proxy/scrolling_area_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/area_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/box/horizontal_box_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/box/vertical_box_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/box.rb +1 -1
- data/lib/glimmer/libui/control_proxy/button_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/checkbox_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/color_button_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/column/background_color_column_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/column/button_column_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/column/checkbox_column_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/column/checkbox_text_color_column_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/column/checkbox_text_column_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/column/image_column_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/column/image_text_color_column_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/column/image_text_column_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/column/progress_bar_column_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/column/text_color_column_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/column/text_column_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/column.rb +1 -1
- data/lib/glimmer/libui/control_proxy/combobox_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/date_time_picker_proxy/date_picker_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/date_time_picker_proxy/time_picker_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/date_time_picker_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/dual_column.rb +1 -1
- data/lib/glimmer/libui/control_proxy/editable_column.rb +1 -1
- data/lib/glimmer/libui/control_proxy/editable_combobox_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/enableable_column.rb +1 -1
- data/lib/glimmer/libui/control_proxy/entry_proxy/password_entry_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/entry_proxy/search_entry_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/entry_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/font_button_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/form_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/grid_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/group_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/image_part_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/image_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/label_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/matrix_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/menu_item_proxy/about_menu_item_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/menu_item_proxy/check_menu_item_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/menu_item_proxy/preferences_menu_item_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/menu_item_proxy/quit_menu_item_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/menu_item_proxy/radio_menu_item_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/menu_item_proxy/separator_menu_item_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/menu_item_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/menu_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/message_box/msg_box_error_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/message_box/msg_box_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/message_box.rb +1 -1
- data/lib/glimmer/libui/control_proxy/multiline_entry_proxy/non_wrapping_multiline_entry_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/multiline_entry_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/open_type_features_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/open_type_tag_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/path_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/radio_buttons_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/slider_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/spinbox_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/tab_item_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/table_proxy.rb +6 -1
- data/lib/glimmer/libui/control_proxy/text_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/transformable.rb +8 -3
- data/lib/glimmer/libui/control_proxy/triple_column.rb +1 -1
- data/lib/glimmer/libui/control_proxy/window_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy.rb +3 -2
- data/lib/glimmer/libui/custom_control/code_area.rb +1 -1
- data/lib/glimmer/libui/custom_control/refined_table.rb +1 -1
- data/lib/glimmer/libui/custom_control.rb +1 -1
- data/lib/glimmer/libui/custom_shape.rb +1 -1
- data/lib/glimmer/libui/custom_window.rb +1 -1
- data/lib/glimmer/libui/data_bindable.rb +1 -1
- data/lib/glimmer/libui/parent.rb +1 -1
- data/lib/glimmer/libui/shape/arc.rb +1 -1
- data/lib/glimmer/libui/shape/bezier.rb +1 -1
- data/lib/glimmer/libui/shape/circle.rb +1 -1
- data/lib/glimmer/libui/shape/figure.rb +1 -1
- data/lib/glimmer/libui/shape/line.rb +1 -1
- data/lib/glimmer/libui/shape/polybezier.rb +1 -1
- data/lib/glimmer/libui/shape/polygon.rb +1 -1
- data/lib/glimmer/libui/shape/polyline.rb +1 -1
- data/lib/glimmer/libui/shape/rectangle.rb +1 -1
- data/lib/glimmer/libui/shape/square.rb +1 -1
- data/lib/glimmer/libui/shape.rb +3 -3
- data/lib/glimmer/libui.rb +1 -1
- data/lib/glimmer/rake_task/package.rb +1 -1
- data/lib/glimmer/rake_task/scaffold.rb +1 -1
- data/lib/glimmer/rake_task.rb +1 -1
- data/lib/glimmer-dsl-libui.rb +1 -1
- metadata +5 -5
data/examples/basic_area.rb
CHANGED
@@ -5,11 +5,9 @@ include Glimmer
|
|
5
5
|
window('Basic Area', 400, 400) {
|
6
6
|
margined true
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
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
|
data/examples/basic_area2.rb
CHANGED
@@ -5,13 +5,11 @@ include Glimmer
|
|
5
5
|
window('Basic Area', 400, 400) {
|
6
6
|
margined true
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
on_draw
|
11
|
-
|
12
|
-
|
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
|
data/examples/basic_area3.rb
CHANGED
@@ -5,13 +5,11 @@ include Glimmer
|
|
5
5
|
window('Basic Area', 400, 400) {
|
6
6
|
margined true
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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
|
data/examples/basic_area4.rb
CHANGED
@@ -5,15 +5,13 @@ include Glimmer
|
|
5
5
|
window('Basic Area', 400, 400) {
|
6
6
|
margined true
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
on_draw
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
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
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
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
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
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
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
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
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
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
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
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
|
-
|
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
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
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
|
-
|
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
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
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
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
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
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
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
|
6
|
-
|
3
|
+
class Event
|
4
|
+
attr_accessor :time
|
5
|
+
end
|
6
|
+
|
7
|
+
class DateTimePickerApplication
|
8
|
+
include Glimmer::LibUI::Application
|
7
9
|
|
8
|
-
|
10
|
+
before_body do
|
11
|
+
@event = Event.new
|
12
|
+
end
|
9
13
|
|
10
|
-
|
14
|
+
body {
|
11
15
|
window('Date Time Pickers', 300, 200) {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
+
date_time_picker {
|
17
|
+
time <=> [@event, :time,
|
18
|
+
after_write: ->(time) { p time }
|
19
|
+
]
|
16
20
|
}
|
17
|
-
|
18
|
-
|
19
|
-
puts 'Bye Bye'
|
20
|
-
end
|
21
|
-
}.show
|
22
|
-
end
|
21
|
+
}
|
22
|
+
}
|
23
23
|
end
|
24
24
|
|
25
|
-
|
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
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
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
|
data/examples/lazy_table.rb
CHANGED
@@ -58,16 +58,14 @@ class LazyTable
|
|
58
58
|
window("1,000,000 Lazy Loaded Contacts", 600, 700) {
|
59
59
|
margined true
|
60
60
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
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
|
}
|
data/examples/lazy_table2.rb
CHANGED
@@ -53,16 +53,14 @@ class LazyTable
|
|
53
53
|
window("1,000,000 Lazy Loaded Contacts", 600, 700) {
|
54
54
|
margined true
|
55
55
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
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
|
}
|
data/examples/lazy_table3.rb
CHANGED
@@ -56,16 +56,14 @@ class LazyTable
|
|
56
56
|
window("1,000,000 Lazy Loaded Contacts", 600, 700) {
|
57
57
|
margined true
|
58
58
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
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
|
}
|
data/examples/lazy_table4.rb
CHANGED
@@ -51,16 +51,14 @@ class LazyTable
|
|
51
51
|
window("1,000,000 Lazy Loaded Contacts", 600, 700) {
|
52
52
|
margined true
|
53
53
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
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
|
}
|
data/examples/simple_notepad.rb
CHANGED
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-
|
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
|
data/glimmer-dsl-libui.gemspec
CHANGED
Binary file
|