class

PointClickEngine::UI::MenuNavigator

Inherits Reference < Object

Manages navigation logic for menu systems

The MenuNavigator handles all navigation-related functionality including:

  • Menu item selection and movement
  • Wrapping navigation behavior
  • Enabled item filtering
  • Navigation state validation

Constructors

new(total_items : Int32 = 0)
Source

Instance methods

allow_empty_selection
Source
allow_empty_selection=(allow_empty_selection : Bool)
Source
create_snapshot

Creates a snapshot of current navigation state

Source
current_index

Current navigation state

Source
current_index=(current_index : Int32)

Current navigation state

Source
enabled_item_count

Gets count of enabled items

Source
get_enabled_indices

Gets list of enabled item indices

Source
get_navigation_stats

Gets navigation statistics for debugging

Source
get_previous_index

Gets the previously selected index

Source
get_selected_index

Gets the currently selected index

Source
has_enabled_items?

Checks if any items are enabled

Source
has_valid_selection?

Checks if current selection is valid

Source
item_enabled?(index : Int32) : Bool

Checks if an item is enabled

Source
on_invalid_navigation
Source
on_invalid_navigation=(on_invalid_navigation : Proc(Nil) | Nil)
Source
on_selection_changed

Callbacks for navigation events

Source
on_selection_changed=(on_selection_changed : Proc(Int32, Int32, Nil) | Nil)

Callbacks for navigation events

Source
on_wrap_around
Source
on_wrap_around=(on_wrap_around : Proc(Int32, Nil) | Nil)
Source
previous_index
Source
previous_index=(previous_index : Int32)
Source
reset

Resets navigation state

Source
restore_from_snapshot(snapshot : Hash(String, Int32 | Bool | Array(Bool)))

Restores navigation state from snapshot

Source
set_enabled_items(enabled : Array(Bool))

Sets which items are enabled for navigation

Source
set_item_enabled(index : Int32, enabled : Bool)

Sets enabled state for a specific item

Source
set_total_items(count : Int32)

Sets the total number of menu items

Source
skip_disabled_items
Source
skip_disabled_items=(skip_disabled_items : Bool)
Source
total_items
Source
total_items=(total_items : Int32)
Source
validate_configuration

Validates navigation configuration

Source
wrap_navigation

Navigation configuration

Source
wrap_navigation=(wrap_navigation : Bool)

Navigation configuration

Source