cyberarm_engine 0.17.0 → 0.17.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f56e0894e554ea377926ea847706be912da3b8728e4f599270ea2e031ef2dece
4
- data.tar.gz: 7e04146fad95f4bb551a131064cdb35e6c6ea2176568570198cf12d44055512a
3
+ metadata.gz: fa05052d75e7e9660d600f07d014eba3a118584eaea601540efe3e8d0681494a
4
+ data.tar.gz: 6695ea5a245aa63518ffd8070859de10a70e04e25f7da154f9186540aa1e8d41
5
5
  SHA512:
6
- metadata.gz: d4be426b99a485bdfb11c5a405c298f9967d25a90cdf947ebc922016945da6aebeb713caa96e16e44c7dd0247db38e1e5435d7f01a8dd9f4b6271c0316d70e1e
7
- data.tar.gz: aa497324a9fa4c1678a9c2e8a8ed65c938a7b01f9da4079e3579ebd1f271d1bd1e9b6c9c8c1bfece05821f39843b18ee546dbfe6ef0b54a806e6e593345cefb3
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
@@ -1,4 +1,4 @@
1
1
  module CyberarmEngine
2
2
  NAME = "InDev".freeze
3
- VERSION = "0.17.0".freeze
3
+ VERSION = "0.17.1".freeze
4
4
  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.0
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-10 00:00:00.000000000 Z
11
+ date: 2021-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clipboard