Module: Bewildr::ControlPatterns::ScrollPattern
- Defined in:
- lib/bewildr/control_patterns/scroll_pattern.rb
Instance Method Summary collapse
-
#scroll_down_one_page ⇒ Object
Scrolls vertically down by one ‘page’.
-
#scroll_horizontally_to(target_percentage) ⇒ Object
Set the horizontal scroll percent of the element.
-
#scroll_vertically_to(target_percentage) ⇒ Object
(also: #scroll_to)
Set the vertical scroll percent of the element.
-
#set_scroll_percent(percent_horizontal, percent_vertical) ⇒ Object
Set the scroll percent of the element.
-
#vertical_scroll_percent ⇒ Object
(also: #scroll_percent)
Returns the current vertical scroll percent.
-
#vertically_scrollable ⇒ Object
Returns true if the element is vertically scrollable, false if it’s not.
Instance Method Details
#scroll_down_one_page ⇒ Object
Scrolls vertically down by one ‘page’
34 35 36 |
# File 'lib/bewildr/control_patterns/scroll_pattern.rb', line 34 def scroll_down_one_page @automation_element.get_current_pattern(System::Windows::Automation::ScrollPattern.pattern).scroll_vertical(System::Windows::Automation::ScrollAmount.LargeIncrement) end |
#scroll_horizontally_to(target_percentage) ⇒ Object
Set the horizontal scroll percent of the element
29 30 31 |
# File 'lib/bewildr/control_patterns/scroll_pattern.rb', line 29 def scroll_horizontally_to(target_percentage) set_scroll_percent(target_percentage, System::Windows::Automation::ScrollPattern.NoScroll) end |
#scroll_vertically_to(target_percentage) ⇒ Object Also known as: scroll_to
Set the vertical scroll percent of the element
23 24 25 |
# File 'lib/bewildr/control_patterns/scroll_pattern.rb', line 23 def scroll_vertically_to(target_percentage) set_scroll_percent(System::Windows::Automation::ScrollPattern.NoScroll, target_percentage) end |
#set_scroll_percent(percent_horizontal, percent_vertical) ⇒ Object
Set the scroll percent of the element
18 19 20 |
# File 'lib/bewildr/control_patterns/scroll_pattern.rb', line 18 def set_scroll_percent(percent_horizontal, percent_vertical) @automation_element.get_current_pattern(System::Windows::Automation::ScrollPattern.pattern).set_scroll_percent(percent_horizontal, percent_vertical) end |
#vertical_scroll_percent ⇒ Object Also known as: scroll_percent
Returns the current vertical scroll percent
12 13 14 |
# File 'lib/bewildr/control_patterns/scroll_pattern.rb', line 12 def vertical_scroll_percent @automation_element.get_current_pattern(System::Windows::Automation::ScrollPattern.pattern).current.vertical_scroll_percent.to_f end |
#vertically_scrollable ⇒ Object
Returns true if the element is vertically scrollable, false if it’s not
7 8 9 |
# File 'lib/bewildr/control_patterns/scroll_pattern.rb', line 7 def vertically_scrollable @automation_element.get_current_pattern(System::Windows::Automation::ScrollPattern.pattern).current.vertically_scrollable end |