Module: Bewildr::ControlPatterns::WindowPattern
- Defined in:
- lib/bewildr/control_patterns/window_pattern.rb
Instance Method Summary collapse
-
#close ⇒ Object
Closes the window.
-
#maximize ⇒ Object
Maximizes the window.
-
#minimize ⇒ Object
Minimizes the window.
-
#restore ⇒ Object
Restores the window.
-
#visual_state ⇒ Object
Returns the visual state of the window.
Instance Method Details
#close ⇒ Object
Closes the window
7 8 9 |
# File 'lib/bewildr/control_patterns/window_pattern.rb', line 7 def close @automation_element.get_current_pattern(System::Windows::Automation::WindowPattern.pattern).close end |
#maximize ⇒ Object
Maximizes the window
17 18 19 |
# File 'lib/bewildr/control_patterns/window_pattern.rb', line 17 def maximize @automation_element.get_current_pattern(System::Windows::Automation::WindowPattern.pattern).set_window_visual_state(System::Windows::Automation::WindowVisualState.maximized) end |
#minimize ⇒ Object
Minimizes the window
12 13 14 |
# File 'lib/bewildr/control_patterns/window_pattern.rb', line 12 def minimize @automation_element.get_current_pattern(System::Windows::Automation::WindowPattern.pattern).set_window_visual_state(System::Windows::Automation::WindowVisualState.minimized) end |
#restore ⇒ Object
Restores the window
22 23 24 |
# File 'lib/bewildr/control_patterns/window_pattern.rb', line 22 def restore @automation_element.get_current_pattern(System::Windows::Automation::WindowPattern.pattern).set_window_visual_state(System::Windows::Automation::WindowVisualState.normal) end |
#visual_state ⇒ Object
Returns the visual state of the window. Available states are:
:maximized
:minimized
:normal
30 31 32 33 34 35 36 |
# File 'lib/bewildr/control_patterns/window_pattern.rb', line 30 def visual_state case @automation_element.get_current_pattern(System::Windows::Automation::WindowPattern.pattern).current.window_visual_state when System::Windows::Automation::WindowVisualState.maximized then return :maximized when System::Windows::Automation::WindowVisualState.minimized then return :minimized when System::Windows::Automation::WindowVisualState.normal then return :normal end end |