glimmer-dsl-libui 0.2.6 → 0.2.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -0
- data/README.md +530 -92
- data/VERSION +1 -1
- data/examples/area_gallery.rb +18 -8
- data/examples/area_gallery2.rb +26 -12
- data/examples/area_gallery3.rb +16 -6
- data/examples/area_gallery4.rb +26 -12
- data/examples/basic_table_button.rb +4 -0
- data/examples/basic_table_color.rb +39 -0
- data/examples/basic_table_progress_bar.rb +1 -1
- data/examples/color_button.rb +2 -0
- data/examples/custom_draw_text.rb +1 -1
- data/examples/custom_draw_text2.rb +1 -1
- data/examples/editable_table.rb +8 -0
- data/examples/form.rb +12 -2
- data/examples/form_table.rb +4 -0
- data/examples/meta_example.rb +27 -17
- data/examples/method_based_custom_keyword.rb +87 -0
- data/glimmer-dsl-libui.gemspec +0 -0
- data/icons/glimmer.png +0 -0
- data/lib/glimmer/libui/control_proxy/column/background_color_column_proxy.rb +38 -0
- data/lib/glimmer/libui/control_proxy/column/checkbox_text_color_column_proxy.rb +82 -0
- data/lib/glimmer/libui/control_proxy/column/image_text_color_column_proxy.rb +50 -0
- data/lib/glimmer/libui/control_proxy/column/text_color_column_proxy.rb +50 -0
- data/lib/glimmer/libui/control_proxy/editable_column.rb +1 -0
- data/lib/glimmer/libui/control_proxy/path_proxy.rb +31 -6
- data/lib/glimmer/libui/control_proxy/table_proxy.rb +53 -14
- data/lib/glimmer/libui/control_proxy/text_proxy.rb +1 -1
- data/lib/glimmer/libui/control_proxy/triple_column.rb +45 -0
- data/lib/glimmer/libui.rb +1 -1
- metadata +12 -4
@@ -0,0 +1,50 @@
|
|
1
|
+
# Copyright (c) 2021 Andy Maleh
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
# a copy of this software and associated documentation files (the
|
5
|
+
# "Software"), to deal in the Software without restriction, including
|
6
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
# the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be
|
12
|
+
# included in all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
require 'glimmer/libui/control_proxy'
|
23
|
+
require 'glimmer/libui/control_proxy/column'
|
24
|
+
require 'glimmer/libui/control_proxy/triple_column'
|
25
|
+
require 'glimmer/libui/control_proxy/editable_column'
|
26
|
+
|
27
|
+
module Glimmer
|
28
|
+
module LibUI
|
29
|
+
class ControlProxy
|
30
|
+
module Column
|
31
|
+
# Proxy for LibUI image text color column objects
|
32
|
+
#
|
33
|
+
# Follows the Proxy Design Pattern
|
34
|
+
class ImageTextColorColumnProxy < ControlProxy
|
35
|
+
include Column
|
36
|
+
include TripleColumn
|
37
|
+
include EditableColumn
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def build_control
|
42
|
+
table_text_column_optional_params = ::LibUI::FFI::TableTextColumnOptionalParams.malloc
|
43
|
+
table_text_column_optional_params.ColorModelColumn = third_column_index
|
44
|
+
@parent_proxy.append_image_text_column(name, column_index, second_column_index, editable_value, table_text_column_optional_params)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# Copyright (c) 2021 Andy Maleh
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
# a copy of this software and associated documentation files (the
|
5
|
+
# "Software"), to deal in the Software without restriction, including
|
6
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
# the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be
|
12
|
+
# included in all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
require 'glimmer/libui/control_proxy'
|
23
|
+
require 'glimmer/libui/control_proxy/column'
|
24
|
+
require 'glimmer/libui/control_proxy/dual_column'
|
25
|
+
require 'glimmer/libui/control_proxy/editable_column'
|
26
|
+
|
27
|
+
module Glimmer
|
28
|
+
module LibUI
|
29
|
+
class ControlProxy
|
30
|
+
module Column
|
31
|
+
# Proxy for LibUI text color column objects
|
32
|
+
#
|
33
|
+
# Follows the Proxy Design Pattern
|
34
|
+
class TextColorColumnProxy < ControlProxy
|
35
|
+
include Column
|
36
|
+
include DualColumn
|
37
|
+
include EditableColumn
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def build_control
|
42
|
+
table_text_column_optional_params = ::LibUI::FFI::TableTextColumnOptionalParams.malloc
|
43
|
+
table_text_column_optional_params.ColorModelColumn = second_column_index
|
44
|
+
@parent_proxy.append_text_column(name, column_index, editable_value, table_text_column_optional_params)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -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
|
@@ -35,6 +35,8 @@ module Glimmer
|
|
35
35
|
class TableProxy < ControlProxy
|
36
36
|
include Glimmer::FiddleConsumer
|
37
37
|
|
38
|
+
LISTENERS = ['on_changed', 'on_edited']
|
39
|
+
|
38
40
|
attr_reader :model_handler, :model, :table_params, :columns
|
39
41
|
|
40
42
|
def initialize(keyword, parent, args, &block)
|
@@ -58,8 +60,16 @@ module Glimmer
|
|
58
60
|
|
59
61
|
def post_initialize_child(child)
|
60
62
|
@columns << child
|
61
|
-
# add
|
62
|
-
|
63
|
+
# add extra complementary columns (:text, :color) if it is a dual/triple column (i.e. ImageTextColumnProxy or CheckboxTextColumnProxy
|
64
|
+
case child
|
65
|
+
when Column::ImageTextColumnProxy, Column::CheckboxTextColumnProxy
|
66
|
+
@columns << :text
|
67
|
+
when Column::TextColorColumnProxy
|
68
|
+
@columns << :color
|
69
|
+
when Column::CheckboxTextColorColumnProxy, Column::ImageTextColorColumnProxy
|
70
|
+
@columns << :text
|
71
|
+
@columns << :color
|
72
|
+
end
|
63
73
|
end
|
64
74
|
|
65
75
|
def destroy
|
@@ -73,22 +83,27 @@ module Glimmer
|
|
73
83
|
else
|
74
84
|
@cell_rows = rows
|
75
85
|
@cell_rows.tap do
|
76
|
-
@last_cell_rows = @cell_rows
|
86
|
+
@last_cell_rows = array_deep_clone(@cell_rows)
|
77
87
|
Glimmer::DataBinding::Observer.proc do
|
78
88
|
if @cell_rows.size < @last_cell_rows.size && @last_cell_rows.include_all?(*@cell_rows)
|
79
89
|
@last_cell_rows.array_diff_indexes(@cell_rows).reverse.each do |row|
|
80
90
|
::LibUI.table_model_row_deleted(model, row)
|
91
|
+
on_changed.each {|listener| listener.call(row, :deleted, @last_cell_rows[row])}
|
81
92
|
end
|
82
93
|
elsif @cell_rows.size > @last_cell_rows.size && @cell_rows.include_all?(*@last_cell_rows)
|
83
94
|
@cell_rows.array_diff_indexes(@last_cell_rows).each do |row|
|
84
95
|
::LibUI.table_model_row_inserted(model, row)
|
96
|
+
on_changed.each {|listener| listener.call(row, :inserted, @cell_rows[row])}
|
85
97
|
end
|
86
98
|
else
|
87
99
|
@cell_rows.each_with_index do |new_row_data, row|
|
88
|
-
|
100
|
+
if new_row_data != @last_cell_rows[row]
|
101
|
+
::LibUI.table_model_row_changed(model, row)
|
102
|
+
on_changed.each {|listener| listener.call(row, :changed, @cell_rows[row])}
|
103
|
+
end
|
89
104
|
end
|
90
105
|
end
|
91
|
-
@last_cell_rows = @cell_rows
|
106
|
+
@last_cell_rows = array_deep_clone(@cell_rows)
|
92
107
|
end.observe(self, :cell_rows)
|
93
108
|
end
|
94
109
|
end
|
@@ -119,27 +134,36 @@ module Glimmer
|
|
119
134
|
@model_handler = ::LibUI::FFI::TableModelHandler.malloc
|
120
135
|
@model_handler.NumColumns = fiddle_closure_block_caller(4) { @columns.map {|c| c.is_a?(DualColumn) ? 2 : 1}.sum }
|
121
136
|
@model_handler.ColumnType = fiddle_closure_block_caller(4, [1, 1, 4]) do |_, _, column|
|
137
|
+
# TODO consider refactoring to use Glimmer::LibUI.enum_symbols(:table_value_type)
|
122
138
|
case @columns[column]
|
123
|
-
when Column::TextColumnProxy, Column::ButtonColumnProxy,
|
139
|
+
when Column::TextColumnProxy, Column::ButtonColumnProxy, Column::TextColorColumnProxy, :text
|
124
140
|
0
|
125
|
-
when Column::ImageColumnProxy, Column::ImageTextColumnProxy
|
141
|
+
when Column::ImageColumnProxy, Column::ImageTextColumnProxy, Column::ImageTextColorColumnProxy
|
126
142
|
1
|
127
|
-
when Column::CheckboxColumnProxy, Column::CheckboxTextColumnProxy, Column::ProgressBarColumnProxy
|
143
|
+
when Column::CheckboxColumnProxy, Column::CheckboxTextColumnProxy, Column::CheckboxTextColorColumnProxy, Column::ProgressBarColumnProxy
|
128
144
|
2
|
145
|
+
when Column::BackgroundColorColumnProxy, :color
|
146
|
+
3
|
129
147
|
end
|
130
148
|
end
|
131
149
|
@model_handler.NumRows = fiddle_closure_block_caller(4) { cell_rows.count }
|
132
150
|
@model_handler.CellValue = fiddle_closure_block_caller(1, [1, 1, 4, 4]) do |_, _, row, column|
|
133
151
|
the_cell_rows = expanded_cell_rows
|
134
152
|
case @columns[column]
|
135
|
-
when Column::TextColumnProxy, Column::ButtonColumnProxy,
|
153
|
+
when Column::TextColumnProxy, Column::ButtonColumnProxy, Column::TextColorColumnProxy, :text
|
136
154
|
::LibUI.new_table_value_string((expanded_cell_rows[row] && expanded_cell_rows[row][column]).to_s)
|
137
|
-
when Column::ImageColumnProxy, Column::ImageTextColumnProxy
|
155
|
+
when Column::ImageColumnProxy, Column::ImageTextColumnProxy, Column::ImageTextColorColumnProxy
|
138
156
|
::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])))
|
139
|
-
when Column::CheckboxColumnProxy, Column::CheckboxTextColumnProxy
|
157
|
+
when Column::CheckboxColumnProxy, Column::CheckboxTextColumnProxy, Column::CheckboxTextColorColumnProxy
|
140
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)))
|
141
159
|
when Column::ProgressBarColumnProxy
|
142
160
|
::LibUI.new_table_value_int((expanded_cell_rows[row] && (expanded_cell_rows[row][column].to_i)))
|
161
|
+
when Column::BackgroundColorColumnProxy
|
162
|
+
background_color = Glimmer::LibUI.interpret_color(expanded_cell_rows[row] && expanded_cell_rows[row][column])
|
163
|
+
::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
|
+
when :color
|
165
|
+
color = Glimmer::LibUI.interpret_color(expanded_cell_rows[row] && expanded_cell_rows[row][column])
|
166
|
+
::LibUI.new_table_value_color(color[:r] / 255.0, color[:g] / 255.0, color[:b] / 255.0, color[:a] || 1.0)
|
143
167
|
end
|
144
168
|
end
|
145
169
|
@model_handler.SetCellValue = fiddle_closure_block_caller(0, [1, 1, 4, 4, 1]) do |_, _, row, column, val|
|
@@ -148,7 +172,7 @@ module Glimmer
|
|
148
172
|
column = @columns[column].index
|
149
173
|
@cell_rows[row] ||= []
|
150
174
|
@cell_rows[row][column] = ::LibUI.table_value_string(val).to_s
|
151
|
-
when
|
175
|
+
when :text
|
152
176
|
column = @columns[column - 1].index
|
153
177
|
@cell_rows[row][column][1] = ::LibUI.table_value_string(val).to_s
|
154
178
|
when Column::ButtonColumnProxy
|
@@ -158,17 +182,22 @@ module Glimmer
|
|
158
182
|
@cell_rows[row] ||= []
|
159
183
|
@cell_rows[row][column] = ::LibUI.table_value_int(val).to_i == 1
|
160
184
|
end
|
185
|
+
on_changed.each {|listener| listener.call(row, :changed, @cell_rows[row])}
|
186
|
+
on_edited.each {|listener| listener.call(row, @cell_rows[row])}
|
161
187
|
end
|
162
188
|
|
163
189
|
@model = ::LibUI.new_table_model(@model_handler)
|
164
190
|
|
191
|
+
# figure out and reserve column indices for columns
|
192
|
+
@columns.each { |column| column.respond_to?(:column_index) && column.column_index }
|
193
|
+
|
165
194
|
@table_params = ::LibUI::FFI::TableParams.malloc
|
166
195
|
@table_params.Model = @model
|
167
|
-
@table_params.RowBackgroundColorModelColumn = -1
|
196
|
+
@table_params.RowBackgroundColorModelColumn = @columns.find {|column| column.is_a?(Column::BackgroundColorColumnProxy)}&.column_index || -1
|
168
197
|
|
169
198
|
@libui = ControlProxy.new_control(@keyword, [@table_params])
|
170
199
|
@libui.tap do
|
171
|
-
@columns.each {|column| column
|
200
|
+
@columns.each {|column| column.respond_to?(:build_control, true) && column.send(:build_control) }
|
172
201
|
end
|
173
202
|
end
|
174
203
|
|
@@ -176,6 +205,16 @@ module Glimmer
|
|
176
205
|
@next_column_index ||= -1
|
177
206
|
@next_column_index += 1
|
178
207
|
end
|
208
|
+
|
209
|
+
def array_deep_clone(array_or_object)
|
210
|
+
if array_or_object.is_a?(Array)
|
211
|
+
array_or_object.map do |element|
|
212
|
+
array_deep_clone(element)
|
213
|
+
end
|
214
|
+
else
|
215
|
+
array_or_object.clone
|
216
|
+
end
|
217
|
+
end
|
179
218
|
end
|
180
219
|
end
|
181
220
|
end
|
@@ -90,7 +90,7 @@ module Glimmer
|
|
90
90
|
|
91
91
|
def width(value = nil)
|
92
92
|
if value.nil?
|
93
|
-
@width ||= args[2] || (AreaProxy.current_area_draw_params && AreaProxy.current_area_draw_params[:area_width])
|
93
|
+
@width ||= args[2] || (AreaProxy.current_area_draw_params && (AreaProxy.current_area_draw_params[:area_width] - 2*x))
|
94
94
|
else
|
95
95
|
@width = value
|
96
96
|
redraw
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# Copyright (c) 2021 Andy Maleh
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
# a copy of this software and associated documentation files (the
|
5
|
+
# "Software"), to deal in the Software without restriction, including
|
6
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
# the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be
|
12
|
+
# included in all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
module Glimmer
|
23
|
+
module LibUI
|
24
|
+
class ControlProxy
|
25
|
+
# A dual column is one that represents two values (e.g. image and text or checkbox and text)
|
26
|
+
# It is meant to be included in a column proxy class that already includes Column
|
27
|
+
module TripleColumn
|
28
|
+
def second_column_index
|
29
|
+
column_index + 1
|
30
|
+
end
|
31
|
+
|
32
|
+
def third_column_index
|
33
|
+
column_index + 2
|
34
|
+
end
|
35
|
+
|
36
|
+
def column_index
|
37
|
+
@column_index ||= @parent_proxy.send(:next_column_index).tap do
|
38
|
+
@parent_proxy.send(:next_column_index)
|
39
|
+
@parent_proxy.send(:next_column_index)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
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.10
|
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-08 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.3.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.3.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: os
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -222,6 +222,7 @@ files:
|
|
222
222
|
- examples/basic_table_button.rb
|
223
223
|
- examples/basic_table_checkbox.rb
|
224
224
|
- examples/basic_table_checkbox_text.rb
|
225
|
+
- examples/basic_table_color.rb
|
225
226
|
- examples/basic_table_image.rb
|
226
227
|
- examples/basic_table_image_text.rb
|
227
228
|
- examples/basic_table_progress_bar.rb
|
@@ -245,10 +246,12 @@ files:
|
|
245
246
|
- examples/histogram.rb
|
246
247
|
- examples/login.rb
|
247
248
|
- examples/meta_example.rb
|
249
|
+
- examples/method_based_custom_keyword.rb
|
248
250
|
- examples/midi_player.rb
|
249
251
|
- examples/simple_notepad.rb
|
250
252
|
- examples/timer.rb
|
251
253
|
- glimmer-dsl-libui.gemspec
|
254
|
+
- icons/glimmer.png
|
252
255
|
- lib/glimmer-dsl-libui.rb
|
253
256
|
- lib/glimmer/dsl/libui/control_expression.rb
|
254
257
|
- lib/glimmer/dsl/libui/dsl.rb
|
@@ -273,12 +276,16 @@ files:
|
|
273
276
|
- lib/glimmer/libui/control_proxy/checkbox_proxy.rb
|
274
277
|
- lib/glimmer/libui/control_proxy/color_button_proxy.rb
|
275
278
|
- lib/glimmer/libui/control_proxy/column.rb
|
279
|
+
- lib/glimmer/libui/control_proxy/column/background_color_column_proxy.rb
|
276
280
|
- lib/glimmer/libui/control_proxy/column/button_column_proxy.rb
|
277
281
|
- lib/glimmer/libui/control_proxy/column/checkbox_column_proxy.rb
|
282
|
+
- lib/glimmer/libui/control_proxy/column/checkbox_text_color_column_proxy.rb
|
278
283
|
- lib/glimmer/libui/control_proxy/column/checkbox_text_column_proxy.rb
|
279
284
|
- lib/glimmer/libui/control_proxy/column/image_column_proxy.rb
|
285
|
+
- lib/glimmer/libui/control_proxy/column/image_text_color_column_proxy.rb
|
280
286
|
- lib/glimmer/libui/control_proxy/column/image_text_column_proxy.rb
|
281
287
|
- lib/glimmer/libui/control_proxy/column/progress_bar_column_proxy.rb
|
288
|
+
- lib/glimmer/libui/control_proxy/column/text_color_column_proxy.rb
|
282
289
|
- lib/glimmer/libui/control_proxy/column/text_column_proxy.rb
|
283
290
|
- lib/glimmer/libui/control_proxy/combobox_proxy.rb
|
284
291
|
- lib/glimmer/libui/control_proxy/date_time_picker_proxy.rb
|
@@ -320,6 +327,7 @@ files:
|
|
320
327
|
- lib/glimmer/libui/control_proxy/table_proxy.rb
|
321
328
|
- lib/glimmer/libui/control_proxy/text_proxy.rb
|
322
329
|
- lib/glimmer/libui/control_proxy/transformable.rb
|
330
|
+
- lib/glimmer/libui/control_proxy/triple_column.rb
|
323
331
|
- lib/glimmer/libui/control_proxy/window_proxy.rb
|
324
332
|
- lib/glimmer/libui/parent.rb
|
325
333
|
- lib/glimmer/libui/shape.rb
|