Class: Nobbie::Wx::Command::GetOptionsCommand

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

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from ComponentAwareCommand

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

Constructor Details

This class inherits a constructor from Nobbie::Wx::Command::ComponentAwareCommand

Instance Method Details

#describeObject



20
21
22
# File 'lib/nobbie/wx/command/get_options.rb', line 20

def describe
  "Get options #{@path}"
end

#executeObject



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/nobbie/wx/command/get_options.rb', line 6

def execute
  if component.is_a?(Notebook)
    result = []
    component.page_count.times{|i| result << component.page_text(i)}
    result            
  elsif component.is_a?(ComboBox) || component.is_a?(ListBox) || component.is_a?(Choice)
    result = []
    component.count.times{|i| result << component.string(i)}
    result
  else
    handle_unsupported_operation_for_component
  end
end