Class: RFormUnit::Mouse

Inherits:
Object
  • Object
show all
Includes:
Driver, Singleton
Defined in:
lib/rformunit/mouse.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Driver

#close_window, #driver, #focus_window, #init, #key_press, #open_file_dialog, #set_autoit_option, #wait_and_focus_window, #wait_for_window, #window_exists?

Class Method Details

.click(x = nil, y = nil) ⇒ Object



10
11
12
# File 'lib/rformunit/mouse.rb', line 10

def self.click(x=nil, y=nil)
   instance._click(x, y)
end

.double_click(x, y) ⇒ Object



18
19
20
# File 'lib/rformunit/mouse.rb', line 18

def self.double_click(x, y)
  instance._double_click(x,y)
end

.move_to(x, y) ⇒ Object



22
23
24
# File 'lib/rformunit/mouse.rb', line 22

def self.move_to(x, y)
  instance._move_to(x,y)
end

.right_click(x = nil, y = nil) ⇒ Object



14
15
16
# File 'lib/rformunit/mouse.rb', line 14

def self.right_click(x=nil, y=nil)
  instance._right_click(x, y)
end

Instance Method Details

#_click(x = nil, y = nil) ⇒ Object

intance methods



29
30
31
32
33
34
35
# File 'lib/rformunit/mouse.rb', line 29

def _click(x=nil, y=nil)
   if (x and y) then
      driver.MouseClick("left", x, y)
   else
      driver.MouseClick("left")
   end
end

#_double_click(x, y) ⇒ Object



45
46
47
# File 'lib/rformunit/mouse.rb', line 45

def _double_click(x, y)
   driver.MouseClick("left", x, y, 2)
end

#_move_to(x, y) ⇒ Object



49
50
51
# File 'lib/rformunit/mouse.rb', line 49

def _move_to(x, y)
   driver.MouseMove(x,y)
end

#_right_click(x = nil, y = nil) ⇒ Object



37
38
39
40
41
42
43
# File 'lib/rformunit/mouse.rb', line 37

def _right_click(x=nil, y=nil)
   if (x and y) then
      driver.MouseClick("right", x, y)
   else
      driver.MouseClick("right")
   end
end