sirius-client-win32 1.3.32 → 2013.4.1.0
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.
- data/lib/sirius/win32/classes/Control.rb +9 -9
- data/lib/sirius/win32/classes/DialogBox.rb +9 -9
- data/lib/sirius/win32/classes/MainWindow.rb +16 -16
- data/lib/sirius/win32/classes/Menu.rb +80 -80
- data/lib/sirius/win32/classes/MenuItem.rb +38 -38
- data/lib/sirius/win32/classes/MovableWindow.rb +48 -48
- data/lib/sirius/win32/classes/TopLevelWindow.rb +31 -31
- data/lib/sirius/win32/classes/Window.rb +116 -116
- data/lib/sirius/win32/classes/controls/Button.rb +11 -11
- data/lib/sirius/win32/classes/controls/CheckBox.rb +11 -11
- data/lib/sirius/win32/classes/controls/Edit.rb +11 -11
- data/lib/sirius/win32/classes/controls/ListBox.rb +11 -11
- data/lib/sirius/win32/classes/controls/ListView.rb +11 -11
- data/lib/sirius/win32/classes/controls/RadioButton.rb +11 -11
- data/lib/sirius/win32/classes/controls/Toolbar.rb +11 -11
- data/lib/sirius/win32/classes/controls/UpDown.rb +11 -11
- metadata +2 -2
@@ -1,10 +1,10 @@
|
|
1
|
-
module Sirius
|
2
|
-
module Client
|
3
|
-
module Win32
|
4
|
-
module Classes
|
5
|
-
class Control
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
1
|
+
module Sirius
|
2
|
+
module Client
|
3
|
+
module Win32
|
4
|
+
module Classes
|
5
|
+
class Control
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
10
|
end
|
@@ -1,10 +1,10 @@
|
|
1
|
-
module Sirius
|
2
|
-
module Client
|
3
|
-
module Win32
|
4
|
-
module Classes
|
5
|
-
class DialogBox
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
1
|
+
module Sirius
|
2
|
+
module Client
|
3
|
+
module Win32
|
4
|
+
module Classes
|
5
|
+
class DialogBox
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
10
|
end
|
@@ -1,17 +1,17 @@
|
|
1
|
-
module Sirius
|
2
|
-
module Client
|
3
|
-
module Win32
|
4
|
-
module Classes
|
5
|
-
class MainWindow < TopLevelWindow
|
6
|
-
def initialize(client=nil, locator=nil)
|
7
|
-
super(client, nil, locator)
|
8
|
-
end
|
9
|
-
|
10
|
-
def start(executable, params, workingDir)
|
11
|
-
@client.core.window.start(@locator.hwnd, executable, params, workingDir)
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
1
|
+
module Sirius
|
2
|
+
module Client
|
3
|
+
module Win32
|
4
|
+
module Classes
|
5
|
+
class MainWindow < TopLevelWindow
|
6
|
+
def initialize(client=nil, locator=nil)
|
7
|
+
super(client, nil, locator)
|
8
|
+
end
|
9
|
+
|
10
|
+
def start(executable, params, workingDir)
|
11
|
+
@client.core.window.start(@locator.hwnd, executable, params, workingDir)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
17
|
end
|
@@ -1,81 +1,81 @@
|
|
1
|
-
module Sirius
|
2
|
-
module Client
|
3
|
-
module Win32
|
4
|
-
module Classes
|
5
|
-
class Menu
|
6
|
-
|
7
|
-
MF_BYCOMMAND = 0x00000000
|
8
|
-
MF_BYPOSITION = 0x00000400
|
9
|
-
|
10
|
-
attr_accessor client
|
11
|
-
attr_accessor owner
|
12
|
-
attr_accessor hmenu
|
13
|
-
def initialize(client, owner=nil, hmenu=nil)
|
14
|
-
@client = client
|
15
|
-
@owner = owner
|
16
|
-
if hmenu == nil
|
17
|
-
@hmenu = hmenu;
|
18
|
-
else
|
19
|
-
@hmenu = @client.core.window.getMenu( @owner.hwnd )
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def from_menu(parent, text)
|
24
|
-
@client = parent.client
|
25
|
-
@owner = parent.owner
|
26
|
-
@hmenu = parent.menu(text).hmenu;
|
27
|
-
end
|
28
|
-
|
29
|
-
def get_menu_item_text(position)
|
30
|
-
maxLength = 255;
|
31
|
-
|
32
|
-
buffer = " " * maxLength
|
33
|
-
@client.core.menu.getMenuString(@hmenu, position, buffer, maxLength,MF_BYPOSITION)
|
34
|
-
buffer
|
35
|
-
end
|
36
|
-
|
37
|
-
def get_sub_menu(position)
|
38
|
-
sub_menu = client.core.menu.getSubMenu(@hmenu, position)
|
39
|
-
Menu.new(@client, @owner, sub_menu)
|
40
|
-
end
|
41
|
-
|
42
|
-
def pick(position)
|
43
|
-
@client.core.menu.pickItem(owner.hwnd, @hmenu, position)
|
44
|
-
end
|
45
|
-
|
46
|
-
def get_item_names
|
47
|
-
# count = @client.core.menu.getMenuItemCount(@hmenu)
|
48
|
-
# String[] names = new String[count];
|
49
|
-
#
|
50
|
-
# for (int i = 0; i < count; i++) {
|
51
|
-
# UnsignedShort[] buf = new UnsignedShort[255];
|
52
|
-
# client.core().menu()
|
53
|
-
# .getMenuString(hmenu, i, buf, 255, (int) MF_BYPOSITION);
|
54
|
-
# byte[] text = new byte[buf.length];
|
55
|
-
#
|
56
|
-
# for (int j = 0; j < buf.length; j++) {
|
57
|
-
# text[j] = buf[j].byteValue();
|
58
|
-
# }
|
59
|
-
# names[i] = new String(text);
|
60
|
-
# }
|
61
|
-
#
|
62
|
-
# return names;
|
63
|
-
end
|
64
|
-
|
65
|
-
def menu(title)
|
66
|
-
names = get_item_names
|
67
|
-
item = names.index { |name| ( name.match(title) || name.index(title)!=nil ) }
|
68
|
-
sub_hmenu = @client.core.menu.getSubMenu(hmenu, item)
|
69
|
-
Menu.new(@client, @owner, sub_hmenu)
|
70
|
-
end
|
71
|
-
|
72
|
-
def item(title)
|
73
|
-
names = get_item_names
|
74
|
-
item = names.index{|name| (name.match(title) || name.index(title)!=nil ) }
|
75
|
-
MenuItem.new(@client, @owner, @hmenu, item)
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
1
|
+
module Sirius
|
2
|
+
module Client
|
3
|
+
module Win32
|
4
|
+
module Classes
|
5
|
+
class Menu
|
6
|
+
|
7
|
+
MF_BYCOMMAND = 0x00000000
|
8
|
+
MF_BYPOSITION = 0x00000400
|
9
|
+
|
10
|
+
attr_accessor client
|
11
|
+
attr_accessor owner
|
12
|
+
attr_accessor hmenu
|
13
|
+
def initialize(client, owner=nil, hmenu=nil)
|
14
|
+
@client = client
|
15
|
+
@owner = owner
|
16
|
+
if hmenu == nil
|
17
|
+
@hmenu = hmenu;
|
18
|
+
else
|
19
|
+
@hmenu = @client.core.window.getMenu( @owner.hwnd )
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def from_menu(parent, text)
|
24
|
+
@client = parent.client
|
25
|
+
@owner = parent.owner
|
26
|
+
@hmenu = parent.menu(text).hmenu;
|
27
|
+
end
|
28
|
+
|
29
|
+
def get_menu_item_text(position)
|
30
|
+
maxLength = 255;
|
31
|
+
|
32
|
+
buffer = " " * maxLength
|
33
|
+
@client.core.menu.getMenuString(@hmenu, position, buffer, maxLength,MF_BYPOSITION)
|
34
|
+
buffer
|
35
|
+
end
|
36
|
+
|
37
|
+
def get_sub_menu(position)
|
38
|
+
sub_menu = client.core.menu.getSubMenu(@hmenu, position)
|
39
|
+
Menu.new(@client, @owner, sub_menu)
|
40
|
+
end
|
41
|
+
|
42
|
+
def pick(position)
|
43
|
+
@client.core.menu.pickItem(owner.hwnd, @hmenu, position)
|
44
|
+
end
|
45
|
+
|
46
|
+
def get_item_names
|
47
|
+
# count = @client.core.menu.getMenuItemCount(@hmenu)
|
48
|
+
# String[] names = new String[count];
|
49
|
+
#
|
50
|
+
# for (int i = 0; i < count; i++) {
|
51
|
+
# UnsignedShort[] buf = new UnsignedShort[255];
|
52
|
+
# client.core().menu()
|
53
|
+
# .getMenuString(hmenu, i, buf, 255, (int) MF_BYPOSITION);
|
54
|
+
# byte[] text = new byte[buf.length];
|
55
|
+
#
|
56
|
+
# for (int j = 0; j < buf.length; j++) {
|
57
|
+
# text[j] = buf[j].byteValue();
|
58
|
+
# }
|
59
|
+
# names[i] = new String(text);
|
60
|
+
# }
|
61
|
+
#
|
62
|
+
# return names;
|
63
|
+
end
|
64
|
+
|
65
|
+
def menu(title)
|
66
|
+
names = get_item_names
|
67
|
+
item = names.index { |name| ( name.match(title) || name.index(title)!=nil ) }
|
68
|
+
sub_hmenu = @client.core.menu.getSubMenu(hmenu, item)
|
69
|
+
Menu.new(@client, @owner, sub_hmenu)
|
70
|
+
end
|
71
|
+
|
72
|
+
def item(title)
|
73
|
+
names = get_item_names
|
74
|
+
item = names.index{|name| (name.match(title) || name.index(title)!=nil ) }
|
75
|
+
MenuItem.new(@client, @owner, @hmenu, item)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
81
|
end
|
@@ -1,39 +1,39 @@
|
|
1
|
-
module Sirius
|
2
|
-
module Client
|
3
|
-
module Win32
|
4
|
-
module Classes
|
5
|
-
class MenuItem
|
6
|
-
|
7
|
-
attr_accessor client
|
8
|
-
attr_accessor owner
|
9
|
-
attr_accessor hmenu;
|
10
|
-
attr_accessor pos;
|
11
|
-
|
12
|
-
def initialize(client, owner, hmenu, pos)
|
13
|
-
@client = client
|
14
|
-
@owner = owner
|
15
|
-
@hmenu = hmenu
|
16
|
-
@pos = pos
|
17
|
-
end
|
18
|
-
|
19
|
-
def checked?()
|
20
|
-
false
|
21
|
-
end
|
22
|
-
|
23
|
-
def enabled?()
|
24
|
-
false
|
25
|
-
end
|
26
|
-
|
27
|
-
def separator?()
|
28
|
-
false
|
29
|
-
end
|
30
|
-
|
31
|
-
def pick()
|
32
|
-
@client.core.menu.pickItem(@owner.hwnd, @hmenu, @pos)
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
1
|
+
module Sirius
|
2
|
+
module Client
|
3
|
+
module Win32
|
4
|
+
module Classes
|
5
|
+
class MenuItem
|
6
|
+
|
7
|
+
attr_accessor client
|
8
|
+
attr_accessor owner
|
9
|
+
attr_accessor hmenu;
|
10
|
+
attr_accessor pos;
|
11
|
+
|
12
|
+
def initialize(client, owner, hmenu, pos)
|
13
|
+
@client = client
|
14
|
+
@owner = owner
|
15
|
+
@hmenu = hmenu
|
16
|
+
@pos = pos
|
17
|
+
end
|
18
|
+
|
19
|
+
def checked?()
|
20
|
+
false
|
21
|
+
end
|
22
|
+
|
23
|
+
def enabled?()
|
24
|
+
false
|
25
|
+
end
|
26
|
+
|
27
|
+
def separator?()
|
28
|
+
false
|
29
|
+
end
|
30
|
+
|
31
|
+
def pick()
|
32
|
+
@client.core.menu.pickItem(@owner.hwnd, @hmenu, @pos)
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
39
|
end
|
@@ -1,49 +1,49 @@
|
|
1
|
-
module Sirius
|
2
|
-
module Client
|
3
|
-
module Win32
|
4
|
-
module Classes
|
5
|
-
class MovableWindow < Window
|
6
|
-
def initialize(client=nil, locator=nil,parent=nil)
|
7
|
-
super(client, parent, locator)
|
8
|
-
end
|
9
|
-
|
10
|
-
def moveTo(x, y)
|
11
|
-
@client.core.window.moveTo(@locator.hwnd, x, y);
|
12
|
-
end
|
13
|
-
|
14
|
-
def sizeTo(width, height)
|
15
|
-
@client.core.window.sizeTo(@locator.hwnd, width, height);
|
16
|
-
end
|
17
|
-
|
18
|
-
def minimize
|
19
|
-
@client.core.window.minimize(@locator.hwnd);
|
20
|
-
end
|
21
|
-
|
22
|
-
def maximize
|
23
|
-
@client.core.window.maximize(@locator.hwnd);
|
24
|
-
end
|
25
|
-
|
26
|
-
def restore
|
27
|
-
@client.core.window.restore(@locator.hwnd);
|
28
|
-
end
|
29
|
-
|
30
|
-
def minimized?
|
31
|
-
return @client.core.window.isMinimized(@locator.hwnd);
|
32
|
-
end
|
33
|
-
|
34
|
-
def maximized?
|
35
|
-
@client.core.window.isMaximized(@locator.hwnd);
|
36
|
-
end
|
37
|
-
|
38
|
-
def restored?
|
39
|
-
@client.core.window.isNormal(@locator.hwnd);
|
40
|
-
end
|
41
|
-
|
42
|
-
def close
|
43
|
-
@client.core.window.close(@locator.hwnd);
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
1
|
+
module Sirius
|
2
|
+
module Client
|
3
|
+
module Win32
|
4
|
+
module Classes
|
5
|
+
class MovableWindow < Window
|
6
|
+
def initialize(client=nil, locator=nil,parent=nil)
|
7
|
+
super(client, parent, locator)
|
8
|
+
end
|
9
|
+
|
10
|
+
def moveTo(x, y)
|
11
|
+
@client.core.window.moveTo(@locator.hwnd, x, y);
|
12
|
+
end
|
13
|
+
|
14
|
+
def sizeTo(width, height)
|
15
|
+
@client.core.window.sizeTo(@locator.hwnd, width, height);
|
16
|
+
end
|
17
|
+
|
18
|
+
def minimize
|
19
|
+
@client.core.window.minimize(@locator.hwnd);
|
20
|
+
end
|
21
|
+
|
22
|
+
def maximize
|
23
|
+
@client.core.window.maximize(@locator.hwnd);
|
24
|
+
end
|
25
|
+
|
26
|
+
def restore
|
27
|
+
@client.core.window.restore(@locator.hwnd);
|
28
|
+
end
|
29
|
+
|
30
|
+
def minimized?
|
31
|
+
return @client.core.window.isMinimized(@locator.hwnd);
|
32
|
+
end
|
33
|
+
|
34
|
+
def maximized?
|
35
|
+
@client.core.window.isMaximized(@locator.hwnd);
|
36
|
+
end
|
37
|
+
|
38
|
+
def restored?
|
39
|
+
@client.core.window.isNormal(@locator.hwnd);
|
40
|
+
end
|
41
|
+
|
42
|
+
def close
|
43
|
+
@client.core.window.close(@locator.hwnd);
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
49
|
end
|
@@ -1,32 +1,32 @@
|
|
1
|
-
module Sirius
|
2
|
-
module Client
|
3
|
-
module Win32
|
4
|
-
module Classes
|
5
|
-
class TopLevelWindow < MovableWindow
|
6
|
-
def initialize(client=nil, locator=nil,parent=nil)
|
7
|
-
super(client, parent, locator)
|
8
|
-
end
|
9
|
-
|
10
|
-
def set_active
|
11
|
-
@client.core.window.activate(@locator.hwnd)
|
12
|
-
end
|
13
|
-
|
14
|
-
def menu
|
15
|
-
if exists?
|
16
|
-
return Menu.new(client,self)
|
17
|
-
end
|
18
|
-
return nil
|
19
|
-
end
|
20
|
-
|
21
|
-
def system_menu
|
22
|
-
if (exists?)
|
23
|
-
@hmenu = @client.core.window.getSystemMenu(@locator.hwnd, true);
|
24
|
-
return Menu.new(client, self, @hmenu)
|
25
|
-
end
|
26
|
-
return nil
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
1
|
+
module Sirius
|
2
|
+
module Client
|
3
|
+
module Win32
|
4
|
+
module Classes
|
5
|
+
class TopLevelWindow < MovableWindow
|
6
|
+
def initialize(client=nil, locator=nil,parent=nil)
|
7
|
+
super(client, parent, locator)
|
8
|
+
end
|
9
|
+
|
10
|
+
def set_active
|
11
|
+
@client.core.window.activate(@locator.hwnd)
|
12
|
+
end
|
13
|
+
|
14
|
+
def menu
|
15
|
+
if exists?
|
16
|
+
return Menu.new(client,self)
|
17
|
+
end
|
18
|
+
return nil
|
19
|
+
end
|
20
|
+
|
21
|
+
def system_menu
|
22
|
+
if (exists?)
|
23
|
+
@hmenu = @client.core.window.getSystemMenu(@locator.hwnd, true);
|
24
|
+
return Menu.new(client, self, @hmenu)
|
25
|
+
end
|
26
|
+
return nil
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
32
|
end
|
@@ -1,116 +1,116 @@
|
|
1
|
-
module Sirius
|
2
|
-
module Client
|
3
|
-
module Win32
|
4
|
-
module Classes
|
5
|
-
class Window
|
6
|
-
attr_accessor :client
|
7
|
-
attr_accessor :locator
|
8
|
-
attr_accessor :parent
|
9
|
-
|
10
|
-
def initialize(locator,client=nil,parent=nil)
|
11
|
-
@locator = locator
|
12
|
-
@client = client
|
13
|
-
@parent=parent
|
14
|
-
|
15
|
-
if(parent != nil)
|
16
|
-
@client = @parent.client
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
def click
|
21
|
-
return unless exists?
|
22
|
-
@client.core.window.click(@locator.hwnd, 0, 0, 0, false, false, false);
|
23
|
-
end
|
24
|
-
|
25
|
-
def type_keys(text)
|
26
|
-
return unless exists?
|
27
|
-
text.split('//').each { |key|
|
28
|
-
@client.core.window.keyPress(@locator.hwnd, key);
|
29
|
-
}
|
30
|
-
end
|
31
|
-
|
32
|
-
def exists?
|
33
|
-
if (@parent != nil)
|
34
|
-
|
35
|
-
if (!@parent.exists?)
|
36
|
-
return false;
|
37
|
-
else
|
38
|
-
@locator.parent = @parent.hwnd
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
@locator.hwnd = 0
|
43
|
-
if(@parent != nil)
|
44
|
-
@client = @parent.client
|
45
|
-
end
|
46
|
-
|
47
|
-
@locator.hwnd = @client.utils.searchWindow(@locator)
|
48
|
-
|
49
|
-
if @locator.hwnd != 0
|
50
|
-
return true;
|
51
|
-
else
|
52
|
-
@locator.hwnd = 0
|
53
|
-
end
|
54
|
-
|
55
|
-
return false;
|
56
|
-
end
|
57
|
-
|
58
|
-
=begin
|
59
|
-
private Class<?>[] getArrayTypes(Object... params) {
|
60
|
-
Class<?>[] types = new Class[params.length];
|
61
|
-
for (int i = 0; i < params.length; i++) {
|
62
|
-
types[i] = params[i].getClass();
|
63
|
-
}
|
64
|
-
return types;
|
65
|
-
}
|
66
|
-
|
67
|
-
public boolean waitFor(long timeout, String methodName,
|
68
|
-
Object expectedValue, Object... params) throws Exception {
|
69
|
-
long end = (new Date()).getTime() + timeout;
|
70
|
-
Class<?>[] parameterTypes = getArrayTypes(params);
|
71
|
-
while ((new Date()).getTime() < end) {
|
72
|
-
Method waitMethod = this.getClass().getMethod(methodName,
|
73
|
-
parameterTypes);
|
74
|
-
Object result = waitMethod.invoke(this, params);
|
75
|
-
if (result.equals(expectedValue)) {
|
76
|
-
return true;
|
77
|
-
}
|
78
|
-
}
|
79
|
-
return false;
|
80
|
-
}
|
81
|
-
|
82
|
-
public boolean exists(long timeout) throws Exception {
|
83
|
-
return waitFor(timeout, "exists", true);
|
84
|
-
}
|
85
|
-
=end
|
86
|
-
|
87
|
-
def disappears?
|
88
|
-
!exists?
|
89
|
-
end
|
90
|
-
=begin
|
91
|
-
public boolean disappears(long timeout) throws Exception {
|
92
|
-
return waitFor(timeout, "disappears", true);
|
93
|
-
}
|
94
|
-
=end
|
95
|
-
|
96
|
-
def get_client_rect
|
97
|
-
@client.core.window.getClientRect(@locator.hwnd)
|
98
|
-
end
|
99
|
-
|
100
|
-
def get_rect
|
101
|
-
@client.core.window.getRect(@locator.hwnd)
|
102
|
-
end
|
103
|
-
|
104
|
-
def enabled?
|
105
|
-
@client.core.window.isEnabled(@locator.hwnd)
|
106
|
-
end
|
107
|
-
|
108
|
-
def visible?
|
109
|
-
@client.core.window.isVisible(@locator.hwnd);
|
110
|
-
end
|
111
|
-
|
112
|
-
end
|
113
|
-
end
|
114
|
-
end
|
115
|
-
end
|
116
|
-
end
|
1
|
+
module Sirius
|
2
|
+
module Client
|
3
|
+
module Win32
|
4
|
+
module Classes
|
5
|
+
class Window
|
6
|
+
attr_accessor :client
|
7
|
+
attr_accessor :locator
|
8
|
+
attr_accessor :parent
|
9
|
+
|
10
|
+
def initialize(locator,client=nil,parent=nil)
|
11
|
+
@locator = locator
|
12
|
+
@client = client
|
13
|
+
@parent=parent
|
14
|
+
|
15
|
+
if(parent != nil)
|
16
|
+
@client = @parent.client
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def click
|
21
|
+
return unless exists?
|
22
|
+
@client.core.window.click(@locator.hwnd, 0, 0, 0, false, false, false);
|
23
|
+
end
|
24
|
+
|
25
|
+
def type_keys(text)
|
26
|
+
return unless exists?
|
27
|
+
text.split('//').each { |key|
|
28
|
+
@client.core.window.keyPress(@locator.hwnd, key);
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
def exists?
|
33
|
+
if (@parent != nil)
|
34
|
+
|
35
|
+
if (!@parent.exists?)
|
36
|
+
return false;
|
37
|
+
else
|
38
|
+
@locator.parent = @parent.hwnd
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
@locator.hwnd = 0
|
43
|
+
if(@parent != nil)
|
44
|
+
@client = @parent.client
|
45
|
+
end
|
46
|
+
|
47
|
+
@locator.hwnd = @client.utils.searchWindow(@locator)
|
48
|
+
|
49
|
+
if @locator.hwnd != 0
|
50
|
+
return true;
|
51
|
+
else
|
52
|
+
@locator.hwnd = 0
|
53
|
+
end
|
54
|
+
|
55
|
+
return false;
|
56
|
+
end
|
57
|
+
|
58
|
+
=begin
|
59
|
+
private Class<?>[] getArrayTypes(Object... params) {
|
60
|
+
Class<?>[] types = new Class[params.length];
|
61
|
+
for (int i = 0; i < params.length; i++) {
|
62
|
+
types[i] = params[i].getClass();
|
63
|
+
}
|
64
|
+
return types;
|
65
|
+
}
|
66
|
+
|
67
|
+
public boolean waitFor(long timeout, String methodName,
|
68
|
+
Object expectedValue, Object... params) throws Exception {
|
69
|
+
long end = (new Date()).getTime() + timeout;
|
70
|
+
Class<?>[] parameterTypes = getArrayTypes(params);
|
71
|
+
while ((new Date()).getTime() < end) {
|
72
|
+
Method waitMethod = this.getClass().getMethod(methodName,
|
73
|
+
parameterTypes);
|
74
|
+
Object result = waitMethod.invoke(this, params);
|
75
|
+
if (result.equals(expectedValue)) {
|
76
|
+
return true;
|
77
|
+
}
|
78
|
+
}
|
79
|
+
return false;
|
80
|
+
}
|
81
|
+
|
82
|
+
public boolean exists(long timeout) throws Exception {
|
83
|
+
return waitFor(timeout, "exists", true);
|
84
|
+
}
|
85
|
+
=end
|
86
|
+
|
87
|
+
def disappears?
|
88
|
+
!exists?
|
89
|
+
end
|
90
|
+
=begin
|
91
|
+
public boolean disappears(long timeout) throws Exception {
|
92
|
+
return waitFor(timeout, "disappears", true);
|
93
|
+
}
|
94
|
+
=end
|
95
|
+
|
96
|
+
def get_client_rect
|
97
|
+
@client.core.window.getClientRect(@locator.hwnd)
|
98
|
+
end
|
99
|
+
|
100
|
+
def get_rect
|
101
|
+
@client.core.window.getRect(@locator.hwnd)
|
102
|
+
end
|
103
|
+
|
104
|
+
def enabled?
|
105
|
+
@client.core.window.isEnabled(@locator.hwnd)
|
106
|
+
end
|
107
|
+
|
108
|
+
def visible?
|
109
|
+
@client.core.window.isVisible(@locator.hwnd);
|
110
|
+
end
|
111
|
+
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
@@ -1,12 +1,12 @@
|
|
1
|
-
module Sirius
|
2
|
-
module Client
|
3
|
-
module Win32
|
4
|
-
module Classes
|
5
|
-
module Controls
|
6
|
-
class Button
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
1
|
+
module Sirius
|
2
|
+
module Client
|
3
|
+
module Win32
|
4
|
+
module Classes
|
5
|
+
module Controls
|
6
|
+
class Button
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
12
|
end
|
@@ -1,12 +1,12 @@
|
|
1
|
-
module Sirius
|
2
|
-
module Client
|
3
|
-
module Win32
|
4
|
-
module Classes
|
5
|
-
module Controls
|
6
|
-
class CheckBox
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
1
|
+
module Sirius
|
2
|
+
module Client
|
3
|
+
module Win32
|
4
|
+
module Classes
|
5
|
+
module Controls
|
6
|
+
class CheckBox
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
12
|
end
|
@@ -1,12 +1,12 @@
|
|
1
|
-
module Sirius
|
2
|
-
module Client
|
3
|
-
module Win32
|
4
|
-
module Classes
|
5
|
-
module Controls
|
6
|
-
class Edit
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
1
|
+
module Sirius
|
2
|
+
module Client
|
3
|
+
module Win32
|
4
|
+
module Classes
|
5
|
+
module Controls
|
6
|
+
class Edit
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
12
|
end
|
@@ -1,12 +1,12 @@
|
|
1
|
-
module Sirius
|
2
|
-
module Client
|
3
|
-
module Win32
|
4
|
-
module Classes
|
5
|
-
module Controls
|
6
|
-
class ListBox
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
1
|
+
module Sirius
|
2
|
+
module Client
|
3
|
+
module Win32
|
4
|
+
module Classes
|
5
|
+
module Controls
|
6
|
+
class ListBox
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
12
|
end
|
@@ -1,12 +1,12 @@
|
|
1
|
-
module Sirius
|
2
|
-
module Client
|
3
|
-
module Win32
|
4
|
-
module Classes
|
5
|
-
module Controls
|
6
|
-
class ListView
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
1
|
+
module Sirius
|
2
|
+
module Client
|
3
|
+
module Win32
|
4
|
+
module Classes
|
5
|
+
module Controls
|
6
|
+
class ListView
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
12
|
end
|
@@ -1,12 +1,12 @@
|
|
1
|
-
module Sirius
|
2
|
-
module Client
|
3
|
-
module Win32
|
4
|
-
module Classes
|
5
|
-
module Controls
|
6
|
-
class RadioButton
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
1
|
+
module Sirius
|
2
|
+
module Client
|
3
|
+
module Win32
|
4
|
+
module Classes
|
5
|
+
module Controls
|
6
|
+
class RadioButton
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
12
|
end
|
@@ -1,12 +1,12 @@
|
|
1
|
-
module Sirius
|
2
|
-
module Client
|
3
|
-
module Win32
|
4
|
-
module Classes
|
5
|
-
module Controls
|
6
|
-
class Toolbar
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
1
|
+
module Sirius
|
2
|
+
module Client
|
3
|
+
module Win32
|
4
|
+
module Classes
|
5
|
+
module Controls
|
6
|
+
class Toolbar
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
12
|
end
|
@@ -1,12 +1,12 @@
|
|
1
|
-
module Sirius
|
2
|
-
module Client
|
3
|
-
module Win32
|
4
|
-
module Classes
|
5
|
-
module Controls
|
6
|
-
class UpDown
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
1
|
+
module Sirius
|
2
|
+
module Client
|
3
|
+
module Win32
|
4
|
+
module Classes
|
5
|
+
module Controls
|
6
|
+
class UpDown
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
12
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sirius-client-win32
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 2013.4.1.0
|
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: 2013-
|
12
|
+
date: 2013-04-01 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: The client for Sirius system
|
15
15
|
email: kolesnik.nickolay@gmail.com
|