Class: Reline::LineEditor::Dialog
- Inherits:
-
Object
- Object
- Reline::LineEditor::Dialog
- Defined in:
- lib/reline/line_editor.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
Returns the value of attribute column.
-
#contents ⇒ Object
Returns the value of attribute contents.
-
#lines_backup ⇒ Object
Returns the value of attribute lines_backup.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pointer ⇒ Object
Returns the value of attribute pointer.
-
#scroll_top ⇒ Object
Returns the value of attribute scroll_top.
-
#scrollbar_pos ⇒ Object
Returns the value of attribute scrollbar_pos.
-
#trap_key ⇒ Object
Returns the value of attribute trap_key.
-
#vertical_offset ⇒ Object
Returns the value of attribute vertical_offset.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
- #call(key) ⇒ Object
-
#initialize(name, config, proc_scope) ⇒ Dialog
constructor
A new instance of Dialog.
- #set_cursor_pos(col, row) ⇒ Object
Constructor Details
#initialize(name, config, proc_scope) ⇒ Dialog
Returns a new instance of Dialog.
591 592 593 594 595 596 597 598 |
# File 'lib/reline/line_editor.rb', line 591 def initialize(name, config, proc_scope) @name = name @config = config @proc_scope = proc_scope @width = nil @scroll_top = 0 @trap_key = nil end |
Instance Attribute Details
#column ⇒ Object
Returns the value of attribute column.
589 590 591 |
# File 'lib/reline/line_editor.rb', line 589 def column @column end |
#contents ⇒ Object
Returns the value of attribute contents.
588 589 590 |
# File 'lib/reline/line_editor.rb', line 588 def contents @contents end |
#lines_backup ⇒ Object
Returns the value of attribute lines_backup.
589 590 591 |
# File 'lib/reline/line_editor.rb', line 589 def lines_backup @lines_backup end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
588 589 590 |
# File 'lib/reline/line_editor.rb', line 588 def name @name end |
#pointer ⇒ Object
Returns the value of attribute pointer.
589 590 591 |
# File 'lib/reline/line_editor.rb', line 589 def pointer @pointer end |
#scroll_top ⇒ Object
Returns the value of attribute scroll_top.
589 590 591 |
# File 'lib/reline/line_editor.rb', line 589 def scroll_top @scroll_top end |
#scrollbar_pos ⇒ Object
Returns the value of attribute scrollbar_pos.
589 590 591 |
# File 'lib/reline/line_editor.rb', line 589 def @scrollbar_pos end |
#trap_key ⇒ Object
Returns the value of attribute trap_key.
589 590 591 |
# File 'lib/reline/line_editor.rb', line 589 def trap_key @trap_key end |
#vertical_offset ⇒ Object
Returns the value of attribute vertical_offset.
589 590 591 |
# File 'lib/reline/line_editor.rb', line 589 def vertical_offset @vertical_offset end |
#width ⇒ Object
Returns the value of attribute width.
588 589 590 |
# File 'lib/reline/line_editor.rb', line 588 def width @width end |
Instance Method Details
#call(key) ⇒ Object
615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 |
# File 'lib/reline/line_editor.rb', line 615 def call(key) @proc_scope.set_dialog(self) @proc_scope.set_key(key) dialog_render_info = @proc_scope.call if @trap_key if @trap_key.any?{ |i| i.is_a?(Array) } # multiple trap @trap_key.each do |t| @config.add_oneshot_key_binding(t, @name) end elsif @trap_key.is_a?(Array) @config.add_oneshot_key_binding(@trap_key, @name) elsif @trap_key.is_a?(Integer) or @trap_key.is_a?(Reline::Key) @config.add_oneshot_key_binding([@trap_key], @name) end end dialog_render_info end |
#set_cursor_pos(col, row) ⇒ Object
600 601 602 |
# File 'lib/reline/line_editor.rb', line 600 def set_cursor_pos(col, row) @proc_scope.set_cursor_pos(col, row) end |