Class: RAutomation::Adapter::MsUia::Checkbox

Inherits:
Control
  • Object
show all
Includes:
ButtonHelper, Locators, WaitHelper
Defined in:
lib/rautomation/adapter/ms_uia/checkbox.rb

Instance Method Summary collapse

Methods included from ButtonHelper

#clear, #set

Methods inherited from Control

#assert_enabled, #bounding_rectangle, #click, #control_class, #control_name, #disabled?, #enabled?, #focus, #focused?, #get_current_control_type, #hwnd, #initialize, #matches_type?, #new_pid, #uia_element, #visible?

Constructor Details

This class inherits a constructor from RAutomation::Adapter::MsUia::Control

Instance Method Details

#exist?Boolean Also known as: exists?

Returns:

  • (Boolean)


18
19
20
# File 'lib/rautomation/adapter/ms_uia/checkbox.rb', line 18

def exist?
  super && matches_type?(Constants::UIA_CHECKBOX_CONTROL_TYPE)
end

#set?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/rautomation/adapter/ms_uia/checkbox.rb', line 22

def set?
  UiaDll::get_is_set(uia_element)
end

#value



9
10
11
12
13
14
15
16
# File 'lib/rautomation/adapter/ms_uia/checkbox.rb', line 9

def value
  checkbox = uia_element

  checkbox_value = FFI::MemoryPointer.new :char, UiaDll::get_name(checkbox, nil) + 1
  UiaDll::get_name(checkbox, checkbox_value)

  checkbox_value.read_string
end