mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2025-12-15 12:42:34 +00:00
Add down arrow for ListBox
This commit is contained in:
@@ -31,6 +31,13 @@ module CyberarmEngine
|
||||
self.choose = @choose
|
||||
end
|
||||
|
||||
def render
|
||||
super
|
||||
|
||||
w = @text.textobject.text_width("▼")
|
||||
@text.textobject.draw("▼", @x + content_width - w, @y + @style.padding_top, @z, 1, 1, @text.color)
|
||||
end
|
||||
|
||||
def choose=(item)
|
||||
valid = @items.detect { |i| i == item }
|
||||
raise "Invalid value '#{item}' for choose, valid options were: #{@items.map { |i| "#{i.inspect}" }.join(", ")}" unless valid
|
||||
|
||||
Reference in New Issue
Block a user