autoit 1.3.3 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/autoit/control.rb +91 -1
- data/lib/autoit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e68b245e1cccaaa0ff3dd21f876a885ad3bafc89ff34dec5d68573eb37d51ba
|
4
|
+
data.tar.gz: 29798556724cd8beee8be1d2ad083922e3798e3d6091349924de400ca3adb989
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e6c4a80e3012c05e1629606babab300658e139707402413dde737fc9fbd2f34b2de0a0055e6127a3f693159f742dfdbaa2c6cc4e86447f20e77fb103932986d
|
7
|
+
data.tar.gz: bc89013d25992444294c53ac3c37b369a1635a28dd71d75c4af2598e481f3b572f94aa2604ec581c8a8209f7237094662c3d0b5908ea187916096aad37d46912
|
data/lib/autoit/control.rb
CHANGED
@@ -16,6 +16,10 @@ module AutoIt
|
|
16
16
|
execute { win.send(cmd, *args) }
|
17
17
|
end
|
18
18
|
|
19
|
+
def command_validate(cmd, args={})
|
20
|
+
execute_validate{win.send(cmd. *args)}
|
21
|
+
end
|
22
|
+
|
19
23
|
def win_close(title)
|
20
24
|
execute { win.WinClose title }
|
21
25
|
end
|
@@ -74,10 +78,96 @@ module AutoIt
|
|
74
78
|
execute { win.WinExists(title, text) }
|
75
79
|
end
|
76
80
|
|
81
|
+
# Activates (gives focus to) a window.
|
82
|
+
# @param: title: The title/hWnd/class of the window to activate.
|
83
|
+
def win_activate(*args)
|
84
|
+
if args == 1
|
85
|
+
command'WinActivate', [args[0]]
|
86
|
+
elsif args == 2
|
87
|
+
command'WinActivate', [args[0], args[1]]
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
# Sets input focus to a given control on a window.
|
92
|
+
# @param: title: The title of the window to access.
|
93
|
+
# @param: text: The text of the window to access.
|
94
|
+
# @param: control: The control to interact with.
|
95
|
+
def control_focus(title, text, control)
|
96
|
+
command 'ControlFocus', [title, text, control]
|
97
|
+
end
|
98
|
+
|
99
|
+
# Sends simulated keystrokes to the active window.
|
100
|
+
# keys: The sequence of keys to send.
|
101
|
+
def send keys
|
102
|
+
command 'Send', [keys, 1]
|
103
|
+
end
|
104
|
+
|
105
|
+
# Sets selection according to string in a ListBox or ComboBox
|
106
|
+
# @param: title: The title of the window to access.
|
107
|
+
# @param: text: The text of the window to access.
|
108
|
+
# @param: control: The control to interact with.
|
109
|
+
# @param: string: The string.
|
110
|
+
def control_command_select_string(title, text, control, string)
|
111
|
+
command 'ControlCommand', [title, text, control, 'SelectString', string]
|
112
|
+
end
|
113
|
+
|
114
|
+
# Drops a ComboBox
|
115
|
+
# @param: title: The title of the window to access.
|
116
|
+
# @param: text: The text of the window to access.
|
117
|
+
# @param: control: The control to interact with.
|
118
|
+
def control_command_show_drop_down(title, text, control)
|
119
|
+
command 'ControlCommand', [title, text, control, 'ShowDropDown', '']
|
120
|
+
end
|
121
|
+
|
122
|
+
# Undrops a ComboBox
|
123
|
+
# @param: title: The title of the window to access.
|
124
|
+
# @param: text: The text of the window to access.
|
125
|
+
# @param: control: The control to interact with.
|
126
|
+
def control_command_hide_drop_down(title, text, control)
|
127
|
+
command 'ControlCommand', [title, text, control, 'HideDropDown', '']
|
128
|
+
end
|
129
|
+
|
130
|
+
# Sets text of a control.
|
131
|
+
# Sends a string of characters to a control.
|
132
|
+
# @param: title: The title of the window to access.
|
133
|
+
# @param: text: The text of the window to access.
|
134
|
+
# @param: control: The control to interact with.
|
135
|
+
# @param: string: The string.
|
136
|
+
# @return True if success, false otherwise
|
137
|
+
def control_set_text(title, text, control, value)
|
138
|
+
command_validate'ControlSetText', [title, text, control, value]
|
139
|
+
end
|
140
|
+
|
141
|
+
# Sends a mouse click command to a given control.
|
142
|
+
# @param: title: The title of the window to access.
|
143
|
+
# @param: text: The text of the window to access.
|
144
|
+
# @param: controlID: The control to interact with.
|
145
|
+
# @param: button: The button to click, "left", "right" or "middle".
|
146
|
+
# @param: clicks: The number of times to click the mouse. Default is center.
|
147
|
+
# @param: x: The x position to click within the control. Default is center.
|
148
|
+
# @param: y: The y position to click within the control. Default is center.
|
149
|
+
# @return: True if success, false otherwise.
|
150
|
+
def control_click(title, text, control, button, clicks, x, y)
|
151
|
+
command_validate('ControlClick', [title, text, control, button, clicks, x, y])
|
152
|
+
end
|
153
|
+
|
154
|
+
# Sets selection to occurrence ref in a ListBox or ComboBox.
|
155
|
+
# @param: title: The title of the window to access.
|
156
|
+
# @param: text: The text of the window to access.
|
157
|
+
# @param: control: The control to interact with.
|
158
|
+
# @param: occurrance: the value.
|
159
|
+
def control_command_set_current_selection(title, text, control, occurrance)
|
160
|
+
command('ControlCommand', [title, text, control, 'SetCurrentSelection', occurrance])
|
161
|
+
end
|
162
|
+
|
77
163
|
private
|
78
164
|
|
79
165
|
def execute
|
80
|
-
|
166
|
+
yield
|
167
|
+
end
|
168
|
+
|
169
|
+
def execute_validate
|
170
|
+
yield > 0
|
81
171
|
end
|
82
172
|
end
|
83
173
|
end
|
data/lib/autoit/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autoit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ronaldo Possan
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-04-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: os
|