glimmer-dsl-libui 0.2.9 → 0.2.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +42 -0
- data/README.md +599 -189
- data/VERSION +1 -1
- data/bin/girb +0 -0
- data/bin/girb_runner.rb +1 -1
- data/examples/area_gallery.rb +24 -14
- data/examples/area_gallery2.rb +37 -21
- data/examples/area_gallery3.rb +22 -12
- data/examples/area_gallery4.rb +37 -21
- data/examples/basic_draw_text2.rb +0 -1
- data/examples/basic_table_button.rb +2 -1
- data/examples/basic_table_checkbox.rb +1 -1
- data/examples/basic_table_image.rb +1 -0
- data/examples/basic_table_image_text.rb +1 -0
- data/examples/color_button.rb +2 -0
- data/examples/{color_the_circles.rb → color_the_shapes.rb} +45 -44
- data/examples/control_gallery.rb +6 -0
- data/examples/editable_table.rb +2 -0
- data/examples/form.rb +12 -2
- data/examples/meta_example.rb +34 -18
- data/examples/method_based_custom_keyword.rb +97 -0
- data/glimmer-dsl-libui.gemspec +0 -0
- data/lib/glimmer/dsl/libui/string_expression.rb +9 -2
- data/lib/glimmer/libui/attributed_string.rb +32 -12
- data/lib/glimmer/libui/control_proxy/path_proxy.rb +31 -6
- data/lib/glimmer/libui/control_proxy/table_proxy.rb +30 -10
- data/lib/glimmer/libui.rb +1 -1
- metadata +13 -9
data/examples/meta_example.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
require 'glimmer-dsl-libui'
|
4
2
|
require 'facets'
|
3
|
+
require 'fileutils'
|
5
4
|
|
6
5
|
class MetaExample
|
7
6
|
include Glimmer
|
@@ -42,6 +41,19 @@ class MetaExample
|
|
42
41
|
examples[@selected_example_index]
|
43
42
|
end
|
44
43
|
|
44
|
+
def run_example(example)
|
45
|
+
command = "ruby -r #{glimmer_dsl_libui_file} #{example} 2>&1"
|
46
|
+
result = ''
|
47
|
+
IO.popen(command) do |f|
|
48
|
+
f.each_line do |line|
|
49
|
+
result << line
|
50
|
+
puts line
|
51
|
+
$stdout.flush # for Windows
|
52
|
+
end
|
53
|
+
end
|
54
|
+
msg_box('Error Running Example', result) if result.downcase.include?('error')
|
55
|
+
end
|
56
|
+
|
45
57
|
def launch
|
46
58
|
window('Meta-Example', 700, 500) {
|
47
59
|
margined true
|
@@ -50,16 +62,16 @@ class MetaExample
|
|
50
62
|
vertical_box {
|
51
63
|
stretchy false
|
52
64
|
|
53
|
-
@
|
65
|
+
@example_radio_buttons = radio_buttons {
|
54
66
|
stretchy false
|
55
67
|
items examples_with_versions
|
56
68
|
selected @selected_example_index
|
57
69
|
|
58
70
|
on_selected do
|
59
|
-
@selected_example_index = @
|
71
|
+
@selected_example_index = @example_radio_buttons.selected
|
60
72
|
example = selected_example
|
61
|
-
@
|
62
|
-
@
|
73
|
+
@code_entry.text = File.read(file_path_for(example))
|
74
|
+
@version_spinbox.value = 1
|
63
75
|
end
|
64
76
|
}
|
65
77
|
|
@@ -68,17 +80,17 @@ class MetaExample
|
|
68
80
|
stretchy false
|
69
81
|
}
|
70
82
|
|
71
|
-
@
|
83
|
+
@version_spinbox = spinbox(1, 100) {
|
72
84
|
value 1
|
73
85
|
|
74
86
|
on_changed do
|
75
87
|
example = selected_example
|
76
|
-
if @
|
77
|
-
@
|
88
|
+
if @version_spinbox.value > version_count_for(example)
|
89
|
+
@version_spinbox.value -= 1
|
78
90
|
else
|
79
|
-
version_number = @
|
91
|
+
version_number = @version_spinbox.value == 1 ? '' : @version_spinbox.value
|
80
92
|
example = "#{selected_example}#{version_number}"
|
81
|
-
@
|
93
|
+
@code_entry.text = File.read(file_path_for(example))
|
82
94
|
end
|
83
95
|
end
|
84
96
|
}
|
@@ -90,25 +102,29 @@ class MetaExample
|
|
90
102
|
button('Launch') {
|
91
103
|
on_clicked do
|
92
104
|
begin
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
105
|
+
parent_dir = File.join(Dir.home, '.glimmer-dsl-libui', 'examples')
|
106
|
+
FileUtils.mkdir_p(parent_dir)
|
107
|
+
example_file = File.join(parent_dir, "#{selected_example.underscore}.rb")
|
108
|
+
File.write(example_file, @code_entry.text)
|
109
|
+
FileUtils.cp_r(File.expand_path('../icons', __dir__), File.dirname(parent_dir))
|
110
|
+
FileUtils.cp_r(File.expand_path('../sounds', __dir__), File.dirname(parent_dir))
|
111
|
+
run_example(example_file)
|
97
112
|
rescue => e
|
113
|
+
puts e.full_message
|
98
114
|
puts 'Unable to write code changes! Running original example...'
|
99
|
-
|
115
|
+
run_example(file_path_for(selected_example))
|
100
116
|
end
|
101
117
|
end
|
102
118
|
}
|
103
119
|
button('Reset') {
|
104
120
|
on_clicked do
|
105
|
-
@
|
121
|
+
@code_entry.text = File.read(file_path_for(selected_example))
|
106
122
|
end
|
107
123
|
}
|
108
124
|
}
|
109
125
|
}
|
110
126
|
|
111
|
-
@
|
127
|
+
@code_entry = non_wrapping_multiline_entry {
|
112
128
|
text File.read(file_path_for(selected_example))
|
113
129
|
}
|
114
130
|
}
|
@@ -0,0 +1,97 @@
|
|
1
|
+
require 'glimmer-dsl-libui'
|
2
|
+
require 'facets'
|
3
|
+
|
4
|
+
include Glimmer
|
5
|
+
|
6
|
+
Address = Struct.new(:street, :p_o_box, :city, :state, :zip_code)
|
7
|
+
|
8
|
+
def form_field(model, property)
|
9
|
+
property = property.to_s
|
10
|
+
entry { |e|
|
11
|
+
label property.underscore.split('_').map(&:capitalize).join(' ')
|
12
|
+
text model.send(property).to_s
|
13
|
+
|
14
|
+
on_changed do
|
15
|
+
model.send("#{property}=", e.text)
|
16
|
+
end
|
17
|
+
}
|
18
|
+
end
|
19
|
+
|
20
|
+
def address_form(address)
|
21
|
+
form {
|
22
|
+
form_field(address, :street)
|
23
|
+
form_field(address, :p_o_box)
|
24
|
+
form_field(address, :city)
|
25
|
+
form_field(address, :state)
|
26
|
+
form_field(address, :zip_code)
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
def label_pair(model, attribute, value)
|
31
|
+
name_label = nil
|
32
|
+
value_label = nil
|
33
|
+
horizontal_box {
|
34
|
+
name_label = label(attribute.to_s.underscore.split('_').map(&:capitalize).join(' '))
|
35
|
+
value_label = label(value.to_s)
|
36
|
+
}
|
37
|
+
Glimmer::DataBinding::Observer.proc do
|
38
|
+
value_label.text = model.send(attribute)
|
39
|
+
end.observe(model, attribute)
|
40
|
+
end
|
41
|
+
|
42
|
+
def address(address)
|
43
|
+
vertical_box {
|
44
|
+
address.each_pair do |attribute, value|
|
45
|
+
label_pair(address, attribute, value)
|
46
|
+
end
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
address1 = Address.new('123 Main St', '23923', 'Denver', 'Colorado', '80014')
|
51
|
+
address2 = Address.new('2038 Park Ave', '83272', 'Boston', 'Massachusetts', '02101')
|
52
|
+
|
53
|
+
window('Method-Based Custom Keyword') {
|
54
|
+
margined true
|
55
|
+
|
56
|
+
horizontal_box {
|
57
|
+
vertical_box {
|
58
|
+
label('Address 1') {
|
59
|
+
stretchy false
|
60
|
+
}
|
61
|
+
|
62
|
+
address_form(address1)
|
63
|
+
|
64
|
+
horizontal_separator {
|
65
|
+
stretchy false
|
66
|
+
}
|
67
|
+
|
68
|
+
label('Address 1 (Saved)') {
|
69
|
+
stretchy false
|
70
|
+
}
|
71
|
+
|
72
|
+
address(address1)
|
73
|
+
}
|
74
|
+
|
75
|
+
vertical_separator {
|
76
|
+
stretchy false
|
77
|
+
}
|
78
|
+
|
79
|
+
vertical_box {
|
80
|
+
label('Address 2') {
|
81
|
+
stretchy false
|
82
|
+
}
|
83
|
+
|
84
|
+
address_form(address2)
|
85
|
+
|
86
|
+
horizontal_separator {
|
87
|
+
stretchy false
|
88
|
+
}
|
89
|
+
|
90
|
+
label('Address 2 (Saved)') {
|
91
|
+
stretchy false
|
92
|
+
}
|
93
|
+
|
94
|
+
address(address2)
|
95
|
+
}
|
96
|
+
}
|
97
|
+
}.show
|
data/glimmer-dsl-libui.gemspec
CHANGED
Binary file
|
@@ -32,11 +32,18 @@ module Glimmer
|
|
32
32
|
|
33
33
|
def can_interpret?(parent, keyword, *args, &block)
|
34
34
|
super and
|
35
|
-
|
35
|
+
(
|
36
|
+
parent.is_a?(Glimmer::LibUI::ControlProxy::TextProxy) or
|
37
|
+
parent.is_a?(Glimmer::LibUI::AttributedString)
|
38
|
+
)
|
36
39
|
end
|
37
40
|
|
38
41
|
def interpret(parent, keyword, *args, &block)
|
39
|
-
Glimmer::LibUI::
|
42
|
+
if parent.is_a?(Glimmer::LibUI::ControlProxy::TextProxy)
|
43
|
+
Glimmer::LibUI::AttributedString.new(keyword, parent, args, &block)
|
44
|
+
else
|
45
|
+
parent.string = args.join
|
46
|
+
end
|
40
47
|
end
|
41
48
|
|
42
49
|
def add_content(parent, keyword, *args, &block)
|
@@ -27,7 +27,6 @@ require 'glimmer/libui/control_proxy/transformable'
|
|
27
27
|
module Glimmer
|
28
28
|
module LibUI
|
29
29
|
class AttributedString
|
30
|
-
attr_accessor :string
|
31
30
|
attr_reader :block, :keyword, :parent_proxy, :args
|
32
31
|
|
33
32
|
def initialize(keyword, parent_proxy, args, &block)
|
@@ -39,6 +38,17 @@ module Glimmer
|
|
39
38
|
post_add_content if @block.nil?
|
40
39
|
end
|
41
40
|
|
41
|
+
def string(value = nil)
|
42
|
+
if value.nil?
|
43
|
+
@string
|
44
|
+
else
|
45
|
+
@string = value
|
46
|
+
redraw
|
47
|
+
end
|
48
|
+
end
|
49
|
+
alias string= string
|
50
|
+
alias set_string string
|
51
|
+
|
42
52
|
def font(value = nil)
|
43
53
|
if value.nil?
|
44
54
|
@font
|
@@ -106,7 +116,7 @@ module Glimmer
|
|
106
116
|
alias set_open_type_features open_type_features
|
107
117
|
|
108
118
|
def post_add_content
|
109
|
-
block_result = block&.call
|
119
|
+
block_result = @block&.call
|
110
120
|
@string = block_result if block_result.is_a?(String)
|
111
121
|
@parent_proxy&.post_initialize_child(self)
|
112
122
|
end
|
@@ -141,16 +151,26 @@ module Glimmer
|
|
141
151
|
end
|
142
152
|
end
|
143
153
|
unless font.nil?
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
+
if font[:family]
|
155
|
+
family_attribute = ::LibUI.new_family_attribute(font[:family])
|
156
|
+
::LibUI.attributed_string_set_attribute(@parent_proxy.attributed_string, family_attribute, @start, @start + @string.size)
|
157
|
+
end
|
158
|
+
if font[:size]
|
159
|
+
size_attribute = ::LibUI.new_size_attribute(font[:size])
|
160
|
+
::LibUI.attributed_string_set_attribute(@parent_proxy.attributed_string, size_attribute, @start, @start + @string.size)
|
161
|
+
end
|
162
|
+
if font[:weight]
|
163
|
+
weight_attribute = ::LibUI.new_weight_attribute(Glimmer::LibUI.enum_symbol_to_value(:text_weight, font[:weight]))
|
164
|
+
::LibUI.attributed_string_set_attribute(@parent_proxy.attributed_string, weight_attribute, @start, @start + @string.size)
|
165
|
+
end
|
166
|
+
if font[:italic]
|
167
|
+
italic_attribute = ::LibUI.new_italic_attribute(Glimmer::LibUI.enum_symbol_to_value(:text_italic, font[:italic]))
|
168
|
+
::LibUI.attributed_string_set_attribute(@parent_proxy.attributed_string, italic_attribute, @start, @start + @string.size)
|
169
|
+
end
|
170
|
+
if font[:stretch]
|
171
|
+
stretch_attribute = ::LibUI.new_stretch_attribute(Glimmer::LibUI.enum_symbol_to_value(:text_stretch, font[:stretch]))
|
172
|
+
::LibUI.attributed_string_set_attribute(@parent_proxy.attributed_string, stretch_attribute, @start, @start + @string.size)
|
173
|
+
end
|
154
174
|
end
|
155
175
|
unless open_type_features.nil?
|
156
176
|
open_type_features_attribute = ::LibUI.new_features_attribute(open_type_features.libui)
|
@@ -69,7 +69,6 @@ module Glimmer
|
|
69
69
|
@fill ||= {}
|
70
70
|
else
|
71
71
|
@fill = Glimmer::LibUI.interpret_color(args)
|
72
|
-
@fill[:a] = 1.0 if @fill.is_a?(Hash) && @fill[:a].nil?
|
73
72
|
@parent_proxy&.queue_redraw_all
|
74
73
|
end
|
75
74
|
@fill.tap do
|
@@ -94,7 +93,6 @@ module Glimmer
|
|
94
93
|
@stroke ||= {}
|
95
94
|
else
|
96
95
|
@stroke = Glimmer::LibUI.interpret_color(args)
|
97
|
-
@stroke[:a] = 1.0 if @stroke.is_a?(Hash) && @stroke[:a].nil?
|
98
96
|
@parent_proxy&.queue_redraw_all
|
99
97
|
end
|
100
98
|
@stroke.tap do
|
@@ -149,11 +147,38 @@ module Glimmer
|
|
149
147
|
end
|
150
148
|
|
151
149
|
def init_draw_brush(draw_brush, draw_brush_args)
|
150
|
+
if draw_brush_args[:r] || draw_brush_args[:g] || draw_brush_args[:b] || draw_brush_args[:a]
|
151
|
+
draw_brush_args[:type] ||= :solid
|
152
|
+
elsif draw_brush_args[:outer_radius]
|
153
|
+
draw_brush_args[:type] ||= :radial_gradient
|
154
|
+
else
|
155
|
+
draw_brush_args[:type] ||= :linear_gradient
|
156
|
+
end
|
152
157
|
draw_brush.Type = Glimmer::LibUI.enum_symbol_to_value(:draw_brush_type, draw_brush_args[:type])
|
153
|
-
draw_brush.
|
154
|
-
|
155
|
-
|
156
|
-
|
158
|
+
if draw_brush.Type == 0
|
159
|
+
draw_brush.R = (draw_brush_args[:r] || draw_brush_args[:red]).to_f / 255.0
|
160
|
+
draw_brush.G = (draw_brush_args[:g] || draw_brush_args[:green]).to_f / 255.0
|
161
|
+
draw_brush.B = (draw_brush_args[:b] || draw_brush_args[:blue]).to_f / 255.0
|
162
|
+
draw_brush.A = (draw_brush_args[:a] || draw_brush_args[:alpha] || 1.0)
|
163
|
+
else
|
164
|
+
draw_brush.X0 = draw_brush_args[:x0].to_f
|
165
|
+
draw_brush.Y0 = draw_brush_args[:y0].to_f
|
166
|
+
draw_brush.X1 = draw_brush_args[:x1].to_f
|
167
|
+
draw_brush.Y1 = draw_brush_args[:y1].to_f
|
168
|
+
draw_brush.OuterRadius = draw_brush_args[:outer_radius].to_f if draw_brush.Type == 2
|
169
|
+
stop_structs = draw_brush_args[:stops].to_a.map do |stop|
|
170
|
+
::LibUI::FFI::DrawBrushGradientStop.malloc.tap do |stop_struct|
|
171
|
+
stop_struct.Pos = stop[:pos].to_f
|
172
|
+
stop_color = Glimmer::LibUI.interpret_color(stop)
|
173
|
+
stop_struct.R = stop_color[:r].to_f / 255.0
|
174
|
+
stop_struct.G = stop_color[:g].to_f / 255.0
|
175
|
+
stop_struct.B = stop_color[:b].to_f / 255.0
|
176
|
+
stop_struct.A = stop_color[:a] || 1.0
|
177
|
+
end
|
178
|
+
end
|
179
|
+
draw_brush.NumStops = stop_structs.count
|
180
|
+
draw_brush.Stops = stop_structs.map(&:to_ptr).map(&:to_s).reduce(:+)
|
181
|
+
end
|
157
182
|
end
|
158
183
|
end
|
159
184
|
end
|
@@ -84,7 +84,7 @@ module Glimmer
|
|
84
84
|
@cell_rows = rows
|
85
85
|
@cell_rows.tap do
|
86
86
|
@last_cell_rows = array_deep_clone(@cell_rows)
|
87
|
-
Glimmer::DataBinding::Observer.proc do
|
87
|
+
Glimmer::DataBinding::Observer.proc do |new_cell_rows|
|
88
88
|
if @cell_rows.size < @last_cell_rows.size && @last_cell_rows.include_all?(*@cell_rows)
|
89
89
|
@last_cell_rows.array_diff_indexes(@cell_rows).reverse.each do |row|
|
90
90
|
::LibUI.table_model_row_deleted(model, row)
|
@@ -103,8 +103,9 @@ module Glimmer
|
|
103
103
|
end
|
104
104
|
end
|
105
105
|
end
|
106
|
+
@last_last_cell_rows = array_deep_clone(@last_cell_rows)
|
106
107
|
@last_cell_rows = array_deep_clone(@cell_rows)
|
107
|
-
end.observe(self, :cell_rows)
|
108
|
+
end.observe(self, :cell_rows, recursive: true)
|
108
109
|
end
|
109
110
|
end
|
110
111
|
end
|
@@ -112,7 +113,11 @@ module Glimmer
|
|
112
113
|
alias set_cell_rows cell_rows
|
113
114
|
|
114
115
|
def expanded_cell_rows
|
115
|
-
cell_rows
|
116
|
+
expand(cell_rows)
|
117
|
+
end
|
118
|
+
|
119
|
+
def expand(cell_rows)
|
120
|
+
cell_rows.to_a.map do |row|
|
116
121
|
row.flatten(1)
|
117
122
|
end
|
118
123
|
end
|
@@ -146,23 +151,39 @@ module Glimmer
|
|
146
151
|
3
|
147
152
|
end
|
148
153
|
end
|
149
|
-
@model_handler.NumRows = fiddle_closure_block_caller(4)
|
154
|
+
@model_handler.NumRows = fiddle_closure_block_caller(4) do
|
155
|
+
# Note: there is a double-delete bug in Windows when performing table_model_row_deleted, which requires pre-adding and extra empty row
|
156
|
+
cell_rows.count + (OS.windows? ? 1 : 0)
|
157
|
+
end
|
150
158
|
@model_handler.CellValue = fiddle_closure_block_caller(1, [1, 1, 4, 4]) do |_, _, row, column|
|
151
159
|
the_cell_rows = expanded_cell_rows
|
152
160
|
case @columns[column]
|
153
161
|
when Column::TextColumnProxy, Column::ButtonColumnProxy, Column::TextColorColumnProxy, :text
|
154
162
|
::LibUI.new_table_value_string((expanded_cell_rows[row] && expanded_cell_rows[row][column]).to_s)
|
155
163
|
when Column::ImageColumnProxy, Column::ImageTextColumnProxy, Column::ImageTextColorColumnProxy
|
156
|
-
|
164
|
+
if OS.windows? && row == cell_rows.count
|
165
|
+
::LibUI.new_table_value_image((expanded_cell_rows[row - 1] && (expanded_cell_rows[row - 1][column].respond_to?(:libui) ? expanded_cell_rows[row - 1][column].libui : expanded_cell_rows[row - 1][column])))
|
166
|
+
else
|
167
|
+
::LibUI.new_table_value_image((expanded_cell_rows[row] && (expanded_cell_rows[row][column].respond_to?(:libui) ? expanded_cell_rows[row][column].libui : expanded_cell_rows[row][column])))
|
168
|
+
end
|
157
169
|
when Column::CheckboxColumnProxy, Column::CheckboxTextColumnProxy, Column::CheckboxTextColorColumnProxy
|
158
|
-
::LibUI.new_table_value_int((expanded_cell_rows[row] && (expanded_cell_rows[row][column] == 1 || expanded_cell_rows[row][column].to_s.strip.downcase == 'true' ? 1 : 0)))
|
170
|
+
::LibUI.new_table_value_int(((expanded_cell_rows[row] && (expanded_cell_rows[row][column] == 1 || expanded_cell_rows[row][column].to_s.strip.downcase == 'true' ? 1 : 0))) || 0)
|
159
171
|
when Column::ProgressBarColumnProxy
|
160
|
-
|
172
|
+
value = (expanded_cell_rows[row] && expanded_cell_rows[row][column]).to_i
|
173
|
+
expanded_last_last_cell_rows = expand(@last_last_cell_rows)
|
174
|
+
old_value = (expanded_last_last_cell_rows[row] && expanded_last_last_cell_rows[row][column]).to_i
|
175
|
+
if OS.windows? && old_value == -1 && value >= 0
|
176
|
+
Glimmer::Config.logger.error('Switching a progress bar value from -1 to a positive value is not supported on Windows')
|
177
|
+
cell_rows[row][column] = -1
|
178
|
+
::LibUI.new_table_value_int(old_value)
|
179
|
+
else
|
180
|
+
::LibUI.new_table_value_int((expanded_cell_rows[row] && expanded_cell_rows[row][column]).to_i)
|
181
|
+
end
|
161
182
|
when Column::BackgroundColorColumnProxy
|
162
|
-
background_color = Glimmer::LibUI.interpret_color(expanded_cell_rows[row] && expanded_cell_rows[row][column])
|
183
|
+
background_color = Glimmer::LibUI.interpret_color(expanded_cell_rows[row] && expanded_cell_rows[row][column]) || {r: 255, g: 255, b: 255}
|
163
184
|
::LibUI.new_table_value_color(background_color[:r] / 255.0, background_color[:g] / 255.0, background_color[:b] / 255.0, background_color[:a] || 1.0)
|
164
185
|
when :color
|
165
|
-
color = Glimmer::LibUI.interpret_color(expanded_cell_rows[row] && expanded_cell_rows[row][column])
|
186
|
+
color = Glimmer::LibUI.interpret_color(expanded_cell_rows[row] && expanded_cell_rows[row][column]) || {r: 0, g: 0, b: 0}
|
166
187
|
::LibUI.new_table_value_color(color[:r] / 255.0, color[:g] / 255.0, color[:b] / 255.0, color[:a] || 1.0)
|
167
188
|
end
|
168
189
|
end
|
@@ -182,7 +203,6 @@ module Glimmer
|
|
182
203
|
@cell_rows[row] ||= []
|
183
204
|
@cell_rows[row][column] = ::LibUI.table_value_int(val).to_i == 1
|
184
205
|
end
|
185
|
-
on_changed.each {|listener| listener.call(row, :changed, @cell_rows[row])}
|
186
206
|
on_edited.each {|listener| listener.call(row, @cell_rows[row])}
|
187
207
|
end
|
188
208
|
|
data/lib/glimmer/libui.rb
CHANGED
@@ -44,8 +44,8 @@ module Glimmer
|
|
44
44
|
value = value[0...-1]
|
45
45
|
end
|
46
46
|
value = value.first if value.is_a?(Array) && value.size == 1
|
47
|
-
value = value.to_s if value.is_a?(Symbol)
|
48
47
|
value = value[:color] if value.is_a?(Hash) && value[:color]
|
48
|
+
value = value.to_s if value.is_a?(Symbol)
|
49
49
|
result = if value.is_a?(Array)
|
50
50
|
old_value = value
|
51
51
|
value = {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimmer-dsl-libui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Maleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glimmer
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: 2.4.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: 2.4.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: os
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -64,14 +64,14 @@ dependencies:
|
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: 0.0.
|
67
|
+
version: 0.0.12
|
68
68
|
type: :runtime
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: 0.0.
|
74
|
+
version: 0.0.12
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: juwelier
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -192,7 +192,10 @@ dependencies:
|
|
192
192
|
version: 1.4.0
|
193
193
|
description: Glimmer DSL for LibUI - Prerequisite-Free Ruby Desktop Development GUI
|
194
194
|
Library (No need to pre-install any prerequisites. Just install the gem and have
|
195
|
-
platform-independent native GUI that just works!
|
195
|
+
platform-independent native GUI that just works! Glimmer DSL for LibUI aims to provide
|
196
|
+
declarative DSL syntax that visually maps to GUI control hierarchy, convention over
|
197
|
+
configuration via smart defaults, automation of low-level details, requiring the
|
198
|
+
least amount of syntax possible to build GUI, and custom control support.
|
196
199
|
email: andy.am@gmail.com
|
197
200
|
executables:
|
198
201
|
- girb
|
@@ -230,7 +233,7 @@ files:
|
|
230
233
|
- examples/basic_window.rb
|
231
234
|
- examples/basic_window2.rb
|
232
235
|
- examples/color_button.rb
|
233
|
-
- examples/
|
236
|
+
- examples/color_the_shapes.rb
|
234
237
|
- examples/control_gallery.rb
|
235
238
|
- examples/custom_draw_text.rb
|
236
239
|
- examples/custom_draw_text2.rb
|
@@ -246,6 +249,7 @@ files:
|
|
246
249
|
- examples/histogram.rb
|
247
250
|
- examples/login.rb
|
248
251
|
- examples/meta_example.rb
|
252
|
+
- examples/method_based_custom_keyword.rb
|
249
253
|
- examples/midi_player.rb
|
250
254
|
- examples/simple_notepad.rb
|
251
255
|
- examples/timer.rb
|
@@ -363,7 +367,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
363
367
|
- !ruby/object:Gem::Version
|
364
368
|
version: '0'
|
365
369
|
requirements: []
|
366
|
-
rubygems_version: 3.2.
|
370
|
+
rubygems_version: 3.2.22
|
367
371
|
signing_key:
|
368
372
|
specification_version: 4
|
369
373
|
summary: Glimmer DSL for LibUI
|