Module: Bewildr::ControlPatterns::ExpandCollapsePattern

Defined in:
lib/bewildr/control_patterns/expand_collapse_pattern.rb

Instance Method Summary collapse

Instance Method Details

#collapseObject

Collapses the element - use to close combo boxes



12
13
14
# File 'lib/bewildr/control_patterns/expand_collapse_pattern.rb', line 12

def collapse
  @automation_element.get_current_pattern(System::Windows::Automation::ExpandCollapsePattern.pattern).collapse unless expand_state == :collapsed or expand_state == :leaf
end

#expandObject

Expands the element - use to open combo boxes



7
8
9
# File 'lib/bewildr/control_patterns/expand_collapse_pattern.rb', line 7

def expand
  @automation_element.get_current_pattern(System::Windows::Automation::ExpandCollapsePattern.pattern).expand unless expand_state == :expanded or expand_state == :leaf
end

#expand_stateObject

Returns the expand-state of the element. The available states are:

:collapsed
:expanded
:partially_expanded
:leaf


21
22
23
24
25
26
27
28
# File 'lib/bewildr/control_patterns/expand_collapse_pattern.rb', line 21

def expand_state
  case @automation_element.get_current_pattern(System::Windows::Automation::ExpandCollapsePattern.pattern).current.expand_collapse_state
  when System::Windows::Automation::ExpandCollapseState.collapsed           then return :collapsed
  when System::Windows::Automation::ExpandCollapseState.expanded            then return :expanded
  when System::Windows::Automation::ExpandCollapseState.partially_expanded  then return :partially_expanded
  when System::Windows::Automation::ExpandCollapseState.leaf_node           then return :leaf
  end
end