lib/cyberarm_engine/ui/element.rb in cyberarm_engine-0.17.0 vs lib/cyberarm_engine/ui/element.rb in cyberarm_engine-0.17.1

- old
+ new

@@ -37,10 +37,12 @@ @style.border_canvas = BorderCanvas.new(element: self) stylize default_events + + root.gui_state.request_focus(self) if @options[:autofocus] end def stylize set_static_position set_border_thickness(@style.border_thickness) @@ -114,10 +116,11 @@ event(:enter) event(:hover) event(:leave) + event(:focus) event(:blur) event(:changed) end @@ -291,10 +294,16 @@ def is_root? @gui_state != nil end + def focus(_) + warn "#{self.class}#focus was not overridden!" + + :handled + end + def recalculate raise "#{self.class}#recalculate was not overridden!" end def reposition @@ -308,8 +317,12 @@ raise "#{self.class}#value= was not overridden!" end def to_s "#{self.class} x=#{x} y=#{y} width=#{width} height=#{height} value=#{value.is_a?(String) ? "\"#{value}\"" : value}" + end + + def inspect + to_s end end end