uia 0.0.9 → 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +5 -0
- data/ext/UiaDll/Release/UIA.Helper.dll +0 -0
- data/ext/UiaDll/Release/UiaDll.dll +0 -0
- data/ext/UiaDll/UIA.Helper/Clicker.cs +13 -4
- data/ext/UiaDll/UIA.Helper/Element.cs +7 -2
- data/ext/UiaDll/UiaDll/ElementMethods.cpp +10 -2
- data/lib/uia/element.rb +5 -0
- data/lib/uia/library.rb +2 -1
- data/lib/uia/version.rb +1 -1
- metadata +4 -4
data/ChangeLog
CHANGED
Binary file
|
Binary file
|
@@ -21,18 +21,27 @@ namespace UIA.Helper
|
|
21
21
|
private const uint MOUSEEVENTLF_LEFTDOWN = 0x2;
|
22
22
|
private const uint MOUSEEVENTLF_LEFTUP = 0x4;
|
23
23
|
|
24
|
-
public static void
|
24
|
+
public static void ClickClickablePoint(AutomationElement element)
|
25
|
+
{
|
26
|
+
Click(element, element.GetClickablePoint());
|
27
|
+
}
|
28
|
+
|
29
|
+
public static void ClickCenter(AutomationElement element)
|
30
|
+
{
|
31
|
+
Click(element, Center(element));
|
32
|
+
}
|
33
|
+
|
34
|
+
private static void Click(AutomationElement element, Point point)
|
25
35
|
{
|
26
36
|
element.ScrollToIfPossible();
|
27
37
|
element.TryToFocus();
|
28
38
|
|
29
|
-
|
30
|
-
Cursor.Position = new System.Drawing.Point((int)clickablePoint.X, (int)clickablePoint.Y);
|
39
|
+
Cursor.Position = new System.Drawing.Point((int) point.X, (int) point.Y);
|
31
40
|
mouse_event(MOUSEEVENTLF_LEFTDOWN, 0, 0, 0, 0);
|
32
41
|
mouse_event(MOUSEEVENTLF_LEFTUP, 0, 0, 0, 0);
|
33
42
|
}
|
34
43
|
|
35
|
-
private static Point
|
44
|
+
private static Point Center(AutomationElement element)
|
36
45
|
{
|
37
46
|
try
|
38
47
|
{
|
@@ -112,9 +112,14 @@ namespace UIA.Helper
|
|
112
112
|
get { return Find(TreeScope.Descendants, Condition.TrueCondition); }
|
113
113
|
}
|
114
114
|
|
115
|
-
public void
|
115
|
+
public void ClickClickablePoint()
|
116
116
|
{
|
117
|
-
Clicker.
|
117
|
+
Clicker.ClickClickablePoint(_element);
|
118
|
+
}
|
119
|
+
|
120
|
+
public void ClickCenter()
|
121
|
+
{
|
122
|
+
Clicker.ClickCenter(_element);
|
118
123
|
}
|
119
124
|
|
120
125
|
public static Element From(AutomationElement element)
|
@@ -136,9 +136,17 @@ extern "C" {
|
|
136
136
|
}
|
137
137
|
}
|
138
138
|
|
139
|
-
__declspec(dllexport) void
|
139
|
+
__declspec(dllexport) void Element_ClickClickablePoint(ElementInformationPtr element, char* errorInfo, const int errorLength) {
|
140
140
|
try {
|
141
|
-
Find(element)->
|
141
|
+
Find(element)->ClickClickablePoint();
|
142
|
+
} catch(Exception^ error) {
|
143
|
+
StringHelper::CopyToUnmanagedString(error->Message, errorInfo, errorLength);
|
144
|
+
}
|
145
|
+
}
|
146
|
+
|
147
|
+
__declspec(dllexport) void Element_ClickCenter(ElementInformationPtr element, char* errorInfo, const int errorLength) {
|
148
|
+
try {
|
149
|
+
Find(element)->ClickCenter();
|
142
150
|
} catch(Exception^ error) {
|
143
151
|
StringHelper::CopyToUnmanagedString(error->Message, errorInfo, errorLength);
|
144
152
|
}
|
data/lib/uia/element.rb
CHANGED
data/lib/uia/library.rb
CHANGED
@@ -70,7 +70,8 @@ module Uia
|
|
70
70
|
attach_throwable_function :find_child_by_name, :Element_FindChildByName, [:pointer, :string, :string], ManagedElementStruct.by_ref, &element_or_nil
|
71
71
|
elements_from :children, :Element_Children, [:pointer]
|
72
72
|
elements_from :descendants, :Element_Descendants, [:pointer]
|
73
|
-
attach_throwable_function :click, :
|
73
|
+
attach_throwable_function :click, :Element_ClickClickablePoint, [:pointer], :void
|
74
|
+
attach_throwable_function :click_center, :Element_ClickCenter, [:pointer], :void
|
74
75
|
attach_throwable_function :focus, :Element_Focus, [:pointer], :void
|
75
76
|
attach_throwable_function :refresh, :Element_Refresh, [:pointer], :void
|
76
77
|
|
data/lib/uia/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uia
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.1'
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-02-
|
12
|
+
date: 2014-02-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|
@@ -249,7 +249,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
249
249
|
version: '0'
|
250
250
|
segments:
|
251
251
|
- 0
|
252
|
-
hash:
|
252
|
+
hash: 258330671
|
253
253
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
254
254
|
none: false
|
255
255
|
requirements:
|
@@ -258,7 +258,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
258
258
|
version: '0'
|
259
259
|
segments:
|
260
260
|
- 0
|
261
|
-
hash:
|
261
|
+
hash: 258330671
|
262
262
|
requirements: []
|
263
263
|
rubyforge_project:
|
264
264
|
rubygems_version: 1.8.24
|