Class: Tuile::Component::List::Cursor::None

Inherits:
Tuile::Component::List::Cursor show all
Defined in:
lib/tuile/component/list.rb

Overview

No cursor — cursor is disabled.

Instance Attribute Summary

Attributes inherited from Tuile::Component::List::Cursor

#position

Instance Method Summary collapse

Methods inherited from Tuile::Component::List::Cursor

#go_to_last

Constructor Details

#initializeNone

Returns a new instance of None.



302
303
304
305
# File 'lib/tuile/component/list.rb', line 302

def initialize
  super(position: -1)
  freeze
end

Instance Method Details

#candidate_positions(_line_count) ⇒ Array<Integer>

Parameters:

  • _line_count (Integer)

Returns:

  • (Array<Integer>)


325
326
327
# File 'lib/tuile/component/list.rb', line 325

def candidate_positions(_line_count)
  []
end

#go(_new_position) ⇒ Boolean

Overridden so all movement funnels — base Tuile::Component::List::Cursor#go_to_last, Tuile::Component::List::Cursor#go_to_first, etc., which all call #go — become safe no-ops on a disabled cursor. The instance is frozen, so a default mutating #go would raise.

Parameters:

  • _new_position (Integer)

Returns:

  • (Boolean)

    always false.



335
336
337
# File 'lib/tuile/component/list.rb', line 335

def go(_new_position)
  false
end

#handle_key(_key, _line_count, _viewport_lines) ⇒ Boolean

Parameters:

  • _key (String)
  • _line_count (Integer)
  • _viewport_lines (Integer)

Returns:

  • (Boolean)


311
312
313
# File 'lib/tuile/component/list.rb', line 311

def handle_key(_key, _line_count, _viewport_lines)
  false
end

#handle_mouse(_line, _event, _line_count) ⇒ Boolean

Parameters:

  • _line (Integer)
  • _event (MouseEvent)
  • _line_count (Integer)

Returns:

  • (Boolean)


319
320
321
# File 'lib/tuile/component/list.rb', line 319

def handle_mouse(_line, _event, _line_count)
  false
end