Class: Nobbie::Wx::Command::SelectCommand

Inherits:
ComponentAwareCommand show all
Defined in:
lib/nobbie/wx/command/select.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from ComponentAwareCommand

#component, #ensure_enabled, #handle_unsupported_operation_for_component, #handle_value_not_found, #highlight

Constructor Details

#initialize(path, value) ⇒ SelectCommand

Returns a new instance of SelectCommand.



6
7
8
9
# File 'lib/nobbie/wx/command/select.rb', line 6

def initialize(path, value)
  super(path) 
  @value = value
end

Instance Method Details

#describeObject



29
30
31
# File 'lib/nobbie/wx/command/select.rb', line 29

def describe
  "Select #{@value} in #{@path}"
end

#executeObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/nobbie/wx/command/select.rb', line 11

def execute
  if component.is_a?(Menu)
    return handle_menu
  end
  
  ensure_enabled

  if component.is_a?(Notebook)
    handle_notebook
  elsif component.is_a?(ComboBox)
    handle_combo_box
  elsif component.is_a?(ListBox) || component.is_a?(Choice)
    handle_list_box_or_choice
  else
    handle_unsupported_operation_for_component
  end
end