Module: Uia::ControlTypes::ComboBox

Defined in:
lib/uia/control_types/combo_box.rb

Instance Method Summary collapse

Instance Method Details

#itemsObject



5
6
7
# File 'lib/uia/control_types/combo_box.rb', line 5

def items
  Library.combo_box_items @element
end

#set(value) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/uia/control_types/combo_box.rb', line 9

def set(value)
  case value
  when String
    Library.combo_box_set_item_by_value @element, value
  when Regexp
    found_item = items.find { |e| e.name =~ value }
    if found_item
      Library.combo_box_set_item_by_value @element, found_item.name
    end
  when Fixnum
    Library.combo_box_set_item_by_index @element, value
  end
end