cyberarm_engine 0.17.0 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa05052d75e7e9660d600f07d014eba3a118584eaea601540efe3e8d0681494a
|
4
|
+
data.tar.gz: 6695ea5a245aa63518ffd8070859de10a70e04e25f7da154f9186540aa1e8d41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdeb1da5ae89e67cf2ee02cea28313da1c657509c0b41fd517f4dd112aafd28d41f8987b5c8a47a95d8c92cd20d132461f87c1764dc74e7c54d560749c38f205
|
7
|
+
data.tar.gz: 4a26c1468e381323bfd2daa503c686f98b30b2918c0d5795aea43bf9209388a2fa13e9f6d9786e454692a2834f676528645647a1f723c417ed2dc7cf1a1f59fb
|
@@ -39,6 +39,8 @@ module CyberarmEngine
|
|
39
39
|
stylize
|
40
40
|
|
41
41
|
default_events
|
42
|
+
|
43
|
+
root.gui_state.request_focus(self) if @options[:autofocus]
|
42
44
|
end
|
43
45
|
|
44
46
|
def stylize
|
@@ -116,6 +118,7 @@ module CyberarmEngine
|
|
116
118
|
event(:hover)
|
117
119
|
event(:leave)
|
118
120
|
|
121
|
+
event(:focus)
|
119
122
|
event(:blur)
|
120
123
|
|
121
124
|
event(:changed)
|
@@ -293,6 +296,12 @@ module CyberarmEngine
|
|
293
296
|
@gui_state != nil
|
294
297
|
end
|
295
298
|
|
299
|
+
def focus(_)
|
300
|
+
warn "#{self.class}#focus was not overridden!"
|
301
|
+
|
302
|
+
:handled
|
303
|
+
end
|
304
|
+
|
296
305
|
def recalculate
|
297
306
|
raise "#{self.class}#recalculate was not overridden!"
|
298
307
|
end
|
@@ -311,5 +320,9 @@ module CyberarmEngine
|
|
311
320
|
def to_s
|
312
321
|
"#{self.class} x=#{x} y=#{y} width=#{width} height=#{height} value=#{value.is_a?(String) ? "\"#{value}\"" : value}"
|
313
322
|
end
|
323
|
+
|
324
|
+
def inspect
|
325
|
+
to_s
|
326
|
+
end
|
314
327
|
end
|
315
328
|
end
|
@@ -212,6 +212,16 @@ module CyberarmEngine
|
|
212
212
|
:handled
|
213
213
|
end
|
214
214
|
|
215
|
+
def focus(sender)
|
216
|
+
@focus = true
|
217
|
+
@style.background_canvas.background = default(:active, :background)
|
218
|
+
@text.color = default(:active, :color)
|
219
|
+
window.text_input = @text_input
|
220
|
+
@text_input.caret_pos = @text_input.selection_start = @text_input.text.length
|
221
|
+
|
222
|
+
:handled
|
223
|
+
end
|
224
|
+
|
215
225
|
def blur(_sender)
|
216
226
|
@focus = false
|
217
227
|
@style.background_canvas.background = default(:background)
|
@@ -66,6 +66,13 @@ module CyberarmEngine
|
|
66
66
|
@pending_recalculate_request = false
|
67
67
|
end
|
68
68
|
|
69
|
+
if @pending_focus_request
|
70
|
+
@pending_focus_request = false
|
71
|
+
|
72
|
+
self.focus = @pending_focus_element
|
73
|
+
@pending_focus_element.publish(:focus)
|
74
|
+
end
|
75
|
+
|
69
76
|
@menu&.update
|
70
77
|
super
|
71
78
|
|
@@ -215,6 +222,11 @@ module CyberarmEngine
|
|
215
222
|
@pending_recalculate_request = true
|
216
223
|
end
|
217
224
|
|
225
|
+
def request_focus(element)
|
226
|
+
@pending_focus_request = true
|
227
|
+
@pending_focus_element = element
|
228
|
+
end
|
229
|
+
|
218
230
|
def show_menu(list_box)
|
219
231
|
@menu = list_box
|
220
232
|
end
|
@@ -222,5 +234,14 @@ module CyberarmEngine
|
|
222
234
|
def hide_menu
|
223
235
|
@menu = nil
|
224
236
|
end
|
237
|
+
|
238
|
+
def to_s
|
239
|
+
# "#{self.class} children=#{@children.map { |c| c.to_s }}"
|
240
|
+
@root_container.to_s
|
241
|
+
end
|
242
|
+
|
243
|
+
def inspect
|
244
|
+
to_s
|
245
|
+
end
|
225
246
|
end
|
226
247
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cyberarm_engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.17.
|
4
|
+
version: 0.17.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyberarm
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clipboard
|