Class: RFormUnit::BaseControl
- Inherits:
-
Object
- Object
- RFormUnit::BaseControl
show all
- Includes:
- Driver
- Defined in:
- lib/rformunit/control.rb
Instance Attribute 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?
Constructor Details
#initialize(win, ctrl_id) ⇒ BaseControl
Returns a new instance of BaseControl.
9
10
11
12
|
# File 'lib/rformunit/control.rb', line 9
def initialize(win, ctrl_id)
@parent_win = win
@control_id = ctrl_id
end
|
Instance Attribute Details
#control_id ⇒ Object
Returns the value of attribute control_id.
7
8
9
|
# File 'lib/rformunit/control.rb', line 7
def control_id
@control_id
end
|
#parent_win ⇒ Object
Returns the value of attribute parent_win.
7
8
9
|
# File 'lib/rformunit/control.rb', line 7
def parent_win
@parent_win
end
|
Instance Method Details
#click ⇒ Object
40
41
42
|
# File 'lib/rformunit/control.rb', line 40
def click
driver.ControlClick(@parent_win.title, @parent_win.text, @control_id)
end
|
#focus ⇒ Object
26
27
28
|
# File 'lib/rformunit/control.rb', line 26
def focus
driver.ControlFocus(@parent_win.title, @parent_win.text, @control_id)
end
|
#get_text ⇒ Object
22
23
24
|
# File 'lib/rformunit/control.rb', line 22
def get_text
driver.ControlGetText(@parent_win.title, @parent_win.text, @control_id)
end
|
#is_enabled? ⇒ Boolean
30
31
32
33
|
# File 'lib/rformunit/control.rb', line 30
def is_enabled?
ret = driver.ControlCommand(@parent_win.title, @parent_win.text, @control_id, "IsEnabled" ,"")
ret == 1 or ret == "1"
end
|
#is_visible? ⇒ Boolean
35
36
37
38
|
# File 'lib/rformunit/control.rb', line 35
def is_visible?
ret = driver.ControlCommand(@parent_win.title, @parent_win.text, @control_id, "IsVisible" ,"")
ret == 1 or ret == "1"
end
|
#send_text(text) ⇒ Object
18
19
20
|
# File 'lib/rformunit/control.rb', line 18
def send_text(text)
driver.ControlSend(@parent_win.title, @parent_win.text, @control_id, text)
end
|
#set_text(new_text) ⇒ Object
14
15
16
|
# File 'lib/rformunit/control.rb', line 14
def set_text(new_text)
driver.ControlSetText(@parent_win.title, @parent_win.text, @control_id, new_text)
end
|