mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2025-12-16 13:12:34 +00:00
Added Container#apend method, EditLine caret will now stay visible while typing, EditLine#value= now sets the value of @text_input
This commit is contained in:
@@ -45,6 +45,17 @@ module CyberarmEngine
|
||||
root.gui_state.request_recalculate
|
||||
end
|
||||
|
||||
def apend(&block)
|
||||
old_container = $__current_container__
|
||||
|
||||
$__current_container__ = self
|
||||
block.call(self) if block
|
||||
|
||||
$__current_container__ = old_container
|
||||
|
||||
root.gui_state.request_recalculate
|
||||
end
|
||||
|
||||
def render
|
||||
Gosu.clip_to(@x, @y, width, height) do
|
||||
@children.each(&:draw)
|
||||
|
||||
@@ -67,6 +67,8 @@ module CyberarmEngine
|
||||
|
||||
if @last_text_value != value
|
||||
@last_text_value = value
|
||||
@show_caret = true
|
||||
@caret_last_interval = Gosu.milliseconds
|
||||
|
||||
publish(:changed, value)
|
||||
end
|
||||
@@ -251,6 +253,10 @@ module CyberarmEngine
|
||||
def value
|
||||
@text_input.text
|
||||
end
|
||||
|
||||
def value=(string)
|
||||
@text_input.text = string
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user