wet-winobj 0.1-mswin32
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/src/wet-winobj.rb +41 -0
- data/src/wet/constants/process.rb +10 -0
- data/src/wet/constants/testconstants.rb +1 -0
- data/src/wet/constants/winconstants.rb +73 -0
- data/src/wet/constants/wincontrolconst.rb +60 -0
- data/src/wet/exceptions/CompileExceptions.rb +31 -0
- data/src/wet/exceptions/RuntimeExceptions.rb +20 -0
- data/src/wet/utils/ArrayUtils.rb +52 -0
- data/src/wet/utils/CompileUtils.rb +43 -0
- data/src/wet/utils/FileUtils.rb +75 -0
- data/src/wet/utils/TextUtils.rb +63 -0
- data/src/wet/winobjects/AppWindow.rb +144 -0
- data/src/wet/winobjects/WinButton.rb +101 -0
- data/src/wet/winobjects/WinCheckbox.rb +84 -0
- data/src/wet/winobjects/WinComboBox.rb +70 -0
- data/src/wet/winobjects/WinDialog.rb +112 -0
- data/src/wet/winobjects/WinEdit.rb +125 -0
- data/src/wet/winobjects/WinLabel.rb +112 -0
- data/src/wet/winobjects/WinObjects.rb +35 -0
- data/src/wet/winobjects/WinRadio.rb +75 -0
- data/src/wet/winobjects/WinUtils.rb +231 -0
- data/src/wet/winobjects/Window.rb +537 -0
- data/tests/README +5 -0
- data/tests/TestAppWindow.rb +96 -0
- data/tests/TestButtonsWindow.rb +71 -0
- data/tests/TestCheckbox.rb +113 -0
- data/tests/TestCombo.rb +53 -0
- data/tests/TestDialog.rb +111 -0
- data/tests/TestLabel.rb +79 -0
- data/tests/TestRadio.rb +82 -0
- data/tests/TestWebEdit.rb +100 -0
- data/tests/wet-winobj-tests.rb +325 -0
- metadata +75 -0
data/tests/README
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
require 'wet-winobj-tests.rb'
|
2
|
+
|
3
|
+
|
4
|
+
class TestAppWindow < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup()
|
7
|
+
if !$is_init
|
8
|
+
$common_wxw = WetWxWindow.new()
|
9
|
+
$common_wxw.show("Wet Window Tester")
|
10
|
+
$is_init = true
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_get_by_title()
|
15
|
+
wxw = WetWxWindow.new()
|
16
|
+
wxw.show("test_get_by_title")
|
17
|
+
wtw = app_window("title" => "test_get_by_title")
|
18
|
+
assert_equal(wxw.hwnd, wtw.hwnd)
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_get_by_title_regex()
|
22
|
+
wxw = WetWxWindow.new()
|
23
|
+
wxw.show("Another test with a long window")
|
24
|
+
wtw = app_window("title" => /^Another test/)
|
25
|
+
assert_equal(wxw.hwnd, wtw.hwnd)
|
26
|
+
wtw = nil
|
27
|
+
|
28
|
+
wxw2 = WetWxWindow.new
|
29
|
+
wxw2.show("This time test for ending words")
|
30
|
+
wtw = app_window("title" => /.*ending words$/)
|
31
|
+
assert_equal(wxw2.hwnd, wtw.hwnd)
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_get_by_title_duplicate_titles()
|
35
|
+
wxw = WetWxWindow.new
|
36
|
+
wxw2 = WetWxWindow.new
|
37
|
+
wxw.show("Common title window")
|
38
|
+
wxw2.show("Common title window")
|
39
|
+
wtw = app_window("title" => "Common title window")
|
40
|
+
assert(wtw.hwnd == wxw.hwnd || wxw2.hwnd)
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_get_by_title_non_existant()
|
44
|
+
wtw = app_window("title" => "Such a window wont and cannot exist in the system-bderererere")
|
45
|
+
assert(!wtw.exists?, "app_window creates a blank element if the window cannot be located")
|
46
|
+
end
|
47
|
+
|
48
|
+
def test_get_waits_for_timeout()
|
49
|
+
assert(false, "This test is slightly difficult to implement. Defer for now")
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_get_by_unknown_property()
|
53
|
+
wxw = WetWxWindow.new()
|
54
|
+
wxw.show("test by unknown property")
|
55
|
+
assert_raise(UnsupportedOperationException, "Can only search windows using title") {wtw = app_window("index" => 1)}
|
56
|
+
end
|
57
|
+
|
58
|
+
def test_maximize()
|
59
|
+
wetw = AppWindow.new($common_wxw.hwnd)
|
60
|
+
wetw.maximize()
|
61
|
+
assert(wetw.is_style("maximized"))
|
62
|
+
end
|
63
|
+
|
64
|
+
def test_title()
|
65
|
+
wetw = AppWindow.new($common_wxw.hwnd)
|
66
|
+
assert_equal(wetw.title, "Wet Window Tester")
|
67
|
+
end
|
68
|
+
|
69
|
+
def test_win_class()
|
70
|
+
wetw = AppWindow.new($common_wxw.hwnd)
|
71
|
+
assert_equal(wetw.win_class, "wxWindowClass")
|
72
|
+
end
|
73
|
+
|
74
|
+
def test_text()
|
75
|
+
wetw = AppWindow.new($common_wxw.hwnd)
|
76
|
+
assert_equal(wetw.title, "Wet Window Tester")
|
77
|
+
end
|
78
|
+
|
79
|
+
def test_content_text()
|
80
|
+
assert(false, "Implement this test after implementing other window tests")
|
81
|
+
end
|
82
|
+
|
83
|
+
def test_child_objects()
|
84
|
+
assert(false, "Implement this test after implementing other window tests")
|
85
|
+
end
|
86
|
+
|
87
|
+
def test_is_parent()
|
88
|
+
wetw = AppWindow.new($common_wxw.hwnd)
|
89
|
+
assert(wetw.is_parent)
|
90
|
+
end
|
91
|
+
|
92
|
+
def test_display_text()
|
93
|
+
wetw = AppWindow.new($common_wxw.hwnd)
|
94
|
+
assert_equal(wetw.display_text, "")
|
95
|
+
end
|
96
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
require 'wet-winobj-tests.rb'
|
2
|
+
require 'timeout'
|
3
|
+
|
4
|
+
class TestButtonsWindow < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
if !$is_init
|
8
|
+
$common_wxw = ControlWindow.new()
|
9
|
+
$common_wxw.create("WET Buttons Tester")
|
10
|
+
$btn_panel = ButtonPanel.new($common_wxw.get_frame)
|
11
|
+
#st_panel = StatusPanel.new($common_wxw.get_frame)
|
12
|
+
$common_wxw.show()
|
13
|
+
$hwnd = $common_wxw.hwnd()
|
14
|
+
$is_init = true
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_find_by_text()
|
19
|
+
b1 = app_window("title" => "WET Buttons Tester").win_button("text" => "OK" )
|
20
|
+
assert_equal(b1.hwnd, $btn_panel.hwnd("b1"))
|
21
|
+
b2 = app_window("title" => "WET Buttons Tester").win_button("text" => "Cancel" )
|
22
|
+
assert_equal(b2.hwnd, $btn_panel.hwnd("b2"))
|
23
|
+
b4 = app_window("title" => "WET Buttons Tester").win_button("text" => "c&onfused" )
|
24
|
+
assert_equal(b4.hwnd, $btn_panel.hwnd("b4"))
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_find_by_regex_text()
|
28
|
+
b1 = Window.new($hwnd).win_button("text" => /^O/ )
|
29
|
+
assert_equal(b1.hwnd, $btn_panel.hwnd("b1"))
|
30
|
+
b2 = Window.new($hwnd).win_button("text" => /l$/ )
|
31
|
+
assert_equal(b2.hwnd, $btn_panel.hwnd("b2"))
|
32
|
+
b4 = Window.new($hwnd).win_button("text" => /c.*d/ )
|
33
|
+
assert_equal(b4.hwnd, $btn_panel.hwnd("b4"))
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
def test_text()
|
38
|
+
b1 = Window.new($hwnd).win_button("text" => "OK" )
|
39
|
+
assert_equal(b1.text, "OK")
|
40
|
+
b2 = Window.new($hwnd).win_button("text" => "Cancel" )
|
41
|
+
assert_equal(b2.text, "Cancel")
|
42
|
+
b4 = Window.new($hwnd).win_button("text" => "c&onfused" )
|
43
|
+
assert_equal(b4.text, "c&onfused")
|
44
|
+
end
|
45
|
+
|
46
|
+
|
47
|
+
def test_click_first()
|
48
|
+
Thread.new() {Thread.pass; $common_wxw.main_loop}
|
49
|
+
Thread.new() {AppWindow.new($common_wxw.hwnd).win_button("text" => "OK" ).click; sleep 0.5; assert_equal(WET_B1.to_s(), $btn_panel.get_status) }
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_click_last()
|
53
|
+
Thread.new() {Thread.pass; $common_wxw.main_loop}
|
54
|
+
Thread.new() {AppWindow.new($common_wxw.hwnd).win_button("text" => "c&onfused" ).click; sleep 0.5; assert_equal(WET_B4.to_s(), $btn_panel.get_status) }
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_is_radio()
|
58
|
+
assert(!AppWindow.new($common_wxw.hwnd).win_button("text" => "c&onfused" ).is_radio)
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_is_checkbox()
|
62
|
+
assert(!AppWindow.new($common_wxw.hwnd).win_button("text" => "c&onfused" ).is_checkbox)
|
63
|
+
end
|
64
|
+
|
65
|
+
def teardown()
|
66
|
+
$common_wxw.exit_main_loop
|
67
|
+
end
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
end
|
@@ -0,0 +1,113 @@
|
|
1
|
+
require 'wet-winobj-tests.rb'
|
2
|
+
require 'timeout'
|
3
|
+
|
4
|
+
class TestCheckbox < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
if !$is_init
|
8
|
+
$common_wxw = ControlWindow.new()
|
9
|
+
$common_wxw.create("Checkbox Tester")
|
10
|
+
$cb_panel = CBPanel.new($common_wxw.get_frame)
|
11
|
+
#st_panel = StatusPanel.new($common_wxw.get_frame)
|
12
|
+
$common_wxw.show()
|
13
|
+
$hwnd = $common_wxw.hwnd
|
14
|
+
$is_init = true
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_nothing
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
def test_get_by_text
|
24
|
+
wtb = Window.new($hwnd).win_checkbox("text"=>"Is Ok")
|
25
|
+
assert_equal($cb_panel.hwnd("b1"), wtb.hwnd)
|
26
|
+
wtb = Window.new($hwnd).win_checkbox("text"=>"Pass?")
|
27
|
+
assert_equal($cb_panel.hwnd("b2"), wtb.hwnd)
|
28
|
+
wtb = Window.new($hwnd).win_checkbox("text"=>"Are you s&ure?")
|
29
|
+
assert_equal($cb_panel.hwnd("b3"), wtb.hwnd)
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_get_by_regex_text
|
33
|
+
wtb = Window.new($hwnd).win_checkbox("text"=>/^P/)
|
34
|
+
assert_equal($cb_panel.hwnd("b2"), wtb.hwnd)
|
35
|
+
wtb = Window.new($hwnd).win_checkbox("text"=>/e\?$/)
|
36
|
+
assert_equal($cb_panel.hwnd("b3"), wtb.hwnd)
|
37
|
+
wtb = Window.new($hwnd).win_checkbox("text"=>/Are.*re?/)
|
38
|
+
assert_equal($cb_panel.hwnd("b3"), wtb.hwnd)
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_text()
|
42
|
+
wtb = Window.new($hwnd).win_checkbox("text"=>/^P/)
|
43
|
+
assert_equal(wtb.text, "Pass?")
|
44
|
+
wtb = Window.new($hwnd).win_checkbox("text"=>/Is.*?/)
|
45
|
+
assert_equal(wtb.text, "Is Ok")
|
46
|
+
wtb = Window.new($hwnd).win_checkbox("text"=>/Are.*re?/)
|
47
|
+
assert_equal(wtb.text, "Are you s&ure?")
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_set()
|
51
|
+
Thread.new() {Thread.pass; $common_wxw.main_loop}
|
52
|
+
Thread.new() { \
|
53
|
+
wcb = WinCheckbox.new($cb_panel.hwnd("b1")); \
|
54
|
+
wcb.set_on; \
|
55
|
+
\
|
56
|
+
}
|
57
|
+
sleep 1
|
58
|
+
assert($cb_panel.is_checked('b1'))
|
59
|
+
end
|
60
|
+
|
61
|
+
|
62
|
+
def test_set_when_already_set()
|
63
|
+
Thread.new() {Thread.pass; $common_wxw.main_loop}
|
64
|
+
Thread.new() { \
|
65
|
+
wcb = WinCheckbox.new($cb_panel.hwnd("b1")) ;\
|
66
|
+
wcb.set_on; \
|
67
|
+
wcb.set_on \
|
68
|
+
}
|
69
|
+
sleep 1
|
70
|
+
assert($cb_panel.is_checked('b1'))
|
71
|
+
end
|
72
|
+
|
73
|
+
def test_clear()
|
74
|
+
Thread.new() {Thread.pass; $common_wxw.main_loop}
|
75
|
+
Thread.new() { \
|
76
|
+
wcb = WinCheckbox.new($cb_panel.hwnd("b2")); \
|
77
|
+
wcb.set_off \
|
78
|
+
}
|
79
|
+
sleep 1
|
80
|
+
assert(!$cb_panel.is_checked('b1')) ;\
|
81
|
+
end
|
82
|
+
|
83
|
+
def test_clear_when_already_cleared()
|
84
|
+
Thread.new() {Thread.pass; $common_wxw.main_loop}
|
85
|
+
Thread.new() { \
|
86
|
+
wcb = WinCheckbox.new($cb_panel.hwnd("b3")) ;\
|
87
|
+
wcb.set_off; \
|
88
|
+
wcb.set_off \
|
89
|
+
|
90
|
+
}
|
91
|
+
sleep 1
|
92
|
+
assert(!$cb_panel.is_checked('b3'))
|
93
|
+
|
94
|
+
end
|
95
|
+
|
96
|
+
def test_is_checked_when_on()
|
97
|
+
Thread.new() {Thread.pass; $common_wxw.main_loop}
|
98
|
+
Thread.new() { \
|
99
|
+
$cb_panel.set_value("b3", true) \
|
100
|
+
}
|
101
|
+
wcb = WinCheckbox.new($cb_panel.hwnd("b3")) ; \
|
102
|
+
assert(wcb.is_checked)
|
103
|
+
|
104
|
+
end
|
105
|
+
|
106
|
+
def teardown()
|
107
|
+
$cb_panel.set_value('b1', false)
|
108
|
+
$cb_panel.set_value('b2', false)
|
109
|
+
$cb_panel.set_value('b3', false)
|
110
|
+
$common_wxw.exit_main_loop
|
111
|
+
end
|
112
|
+
|
113
|
+
end
|
data/tests/TestCombo.rb
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'wet-winobj-tests.rb'
|
2
|
+
require 'timeout'
|
3
|
+
|
4
|
+
class TestCombo < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
if !$is_init
|
8
|
+
$common_wxw = ControlWindow.new()
|
9
|
+
$common_wxw.create("Combo Tester")
|
10
|
+
$cmb_panel = ComboPanel.new($common_wxw.get_frame)
|
11
|
+
$common_wxw.show()
|
12
|
+
$hwnd = $common_wxw.hwnd
|
13
|
+
$is_init = true
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_get_by_label()
|
18
|
+
c1 = AppWindow.new($hwnd).win_combobox("label" => "Tex&t1")
|
19
|
+
assert_equal(c1.hwnd, $cmb_panel.hwnd('cmb1'))
|
20
|
+
c2 = AppWindow.new($hwnd).win_combobox("label" => "Se&cond Text")
|
21
|
+
assert_equal(c2.hwnd, $cmb_panel.hwnd('cmb2'))
|
22
|
+
c3 = AppWindow.new($hwnd).win_combobox("label" => "Thir&d")
|
23
|
+
assert_equal(c3.hwnd, $cmb_panel.hwnd('cmb3'))
|
24
|
+
c4 = AppWindow.new($hwnd).win_combobox("label" => "Cho&ice box")
|
25
|
+
assert_equal(c4.hwnd, $cmb_panel.hwnd('cmb4'))
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_get_by_label_regex()
|
29
|
+
c1 = AppWindow.new($hwnd).win_combobox("label" => /^T/)
|
30
|
+
assert_equal(c1.hwnd, $cmb_panel.hwnd('cmb1'))
|
31
|
+
c2 = AppWindow.new($hwnd).win_combobox("label" => /Text$/)
|
32
|
+
assert_equal(c2.hwnd, $cmb_panel.hwnd('cmb2'))
|
33
|
+
c3 = AppWindow.new($hwnd).win_combobox("label" => /Th.*d/)
|
34
|
+
assert_equal(c3.hwnd, $cmb_panel.hwnd('cmb3'))
|
35
|
+
c4 = AppWindow.new($hwnd).win_combobox("label" => /.*&i.*/)
|
36
|
+
assert_equal(c4.hwnd, $cmb_panel.hwnd('cmb4'))
|
37
|
+
end
|
38
|
+
|
39
|
+
def test_set()
|
40
|
+
c1 = AppWindow.new($hwnd).win_combobox("label" => "Tex&t1")
|
41
|
+
c1.set "new 1"
|
42
|
+
assert_equal($cmb_panel.get_value('cmb1'), "new 1")
|
43
|
+
c2 = AppWindow.new($hwnd).win_combobox("label" => "Se&cond Text")
|
44
|
+
c2.set "set previously blank"
|
45
|
+
assert_equal($cmb_panel.get_value('cmb2'), "set previously blank")
|
46
|
+
end
|
47
|
+
|
48
|
+
def test_select()
|
49
|
+
assert(false, "select has not yet been implemented")
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
end
|
data/tests/TestDialog.rb
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
require 'wet-winobj-tests.rb'
|
2
|
+
require 'timeout'
|
3
|
+
|
4
|
+
class TestDialog < Test::Unit::TestCase
|
5
|
+
|
6
|
+
def setup
|
7
|
+
if !$is_init
|
8
|
+
$common_wxw = ControlWindow.new()
|
9
|
+
$common_wxw.create("Dialog Tester")
|
10
|
+
$common_wxw.show()
|
11
|
+
$common_dlg = Dialog.new($common_wxw.get_frame, -1, "My new dialog", DEFAULT_POSITION, Size.new(400, 200))
|
12
|
+
|
13
|
+
#$cmb_panel = ComboPanel.new($common_dlg)
|
14
|
+
#b1 = ButtonPanel.new($common_dlg)
|
15
|
+
|
16
|
+
$lbl1 = StaticText.new($common_dlg, -1, "E&dit box", Point.new(10, 20))
|
17
|
+
$txt1 = TextCtrl.new($common_dlg, -1, "", Point.new(80, 20))
|
18
|
+
$cb1 = CheckBox.new($common_dlg, -1, "test cb", Point.new(10, 50))
|
19
|
+
$rad1 = RadioButton.new($common_dlg, -1, "test radio", Point.new(80, 50))
|
20
|
+
$lbl2 = StaticText.new($common_dlg, -1, "Co&mbo box", Point.new(175, 50))
|
21
|
+
$cmb1 = ComboBox.new($common_dlg, -1, "", Point.new(250, 50))
|
22
|
+
$btn1 = Button.new($common_dlg, -1, "OK", Point.new(10, 100))
|
23
|
+
|
24
|
+
|
25
|
+
$hwnd = $common_wxw.hwnd
|
26
|
+
$dlg_hwnd = $common_dlg.get_handle()
|
27
|
+
|
28
|
+
$is_init = true
|
29
|
+
end
|
30
|
+
#$common_wxw.main_loop
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_get_by_text_modal()
|
34
|
+
Thread.new {$common_dlg.show_modal}
|
35
|
+
d1 = AppWindow.new($hwnd).dialog("title" => "My new dialog")
|
36
|
+
assert_equal(d1.hwnd, $dlg_hwnd)
|
37
|
+
|
38
|
+
#Verify that not paramteres _do_ matter
|
39
|
+
d1 = AppWindow.new($hwnd).dialog("title" => "dfjdklejr")
|
40
|
+
assert_equal(d1.hwnd, -1)
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_get_by_text_modeless()
|
44
|
+
Thread.new {$common_dlg.show}
|
45
|
+
d1 = AppWindow.new($hwnd).dialog("title" => "My new dialog")
|
46
|
+
assert_equal(d1.hwnd, $dlg_hwnd)
|
47
|
+
|
48
|
+
#Verify that not paramteres _do_ matter
|
49
|
+
d1 = AppWindow.new($hwnd).dialog("title" => "dfjdklejr")
|
50
|
+
assert_equal(d1.hwnd, -1)
|
51
|
+
end
|
52
|
+
|
53
|
+
def common_children_tester()
|
54
|
+
d1 = AppWindow.new($hwnd).dialog("title" => "My new dialog")
|
55
|
+
|
56
|
+
lbl = d1.win_label("text" => "E&dit box")
|
57
|
+
assert_equal(lbl.hwnd, $lbl1.get_handle())
|
58
|
+
txt = d1.win_edit("label" => "E&dit box")
|
59
|
+
assert_equal(txt.hwnd, $txt1.get_handle())
|
60
|
+
cb = d1.win_checkbox("text" => "test cb")
|
61
|
+
assert_equal(cb.hwnd, $cb1.get_handle())
|
62
|
+
r = d1.win_radio("text" => "test radio")
|
63
|
+
assert_equal(r.hwnd, $rad1.get_handle())
|
64
|
+
cmb = d1.win_combobox("label" => "Co&mbo box")
|
65
|
+
assert_equal(cmb.hwnd, $cmb1.get_handle())
|
66
|
+
btn = d1.win_button("text" => "OK")
|
67
|
+
assert_equal(btn.hwnd, $btn1.get_handle())
|
68
|
+
end
|
69
|
+
|
70
|
+
def test_dialog_children_modal()
|
71
|
+
Thread.new {$common_dlg.show_modal}
|
72
|
+
common_children_tester()
|
73
|
+
end
|
74
|
+
|
75
|
+
def test_dialog_children_modeless()
|
76
|
+
Thread.new {$common_dlg.show}
|
77
|
+
common_children_tester()
|
78
|
+
end
|
79
|
+
|
80
|
+
def test_dialog_owner_modal()
|
81
|
+
Thread.new {$common_dlg.show_modal}
|
82
|
+
|
83
|
+
d = AppWindow.new($hwnd).dialog("title" => "My new dialog")
|
84
|
+
assert_equal(d.owner.hwnd, $hwnd)
|
85
|
+
end
|
86
|
+
|
87
|
+
def test_dialog_owner_modeless()
|
88
|
+
Thread.new {$common_dlg.show}
|
89
|
+
|
90
|
+
d = AppWindow.new($hwnd).dialog("title" => "My new dialog")
|
91
|
+
assert_equal(d.owner.hwnd, $hwnd)
|
92
|
+
end
|
93
|
+
|
94
|
+
def test_dialog_content_text_modal()
|
95
|
+
Thread.new {$common_dlg.show_modal}
|
96
|
+
d = AppWindow.new($hwnd).dialog("title" => "My new dialog")
|
97
|
+
assert_equal(d.content_text, "E&dit boxCo&mbo box")
|
98
|
+
end
|
99
|
+
|
100
|
+
def test_dialog_content_text_modeless()
|
101
|
+
Thread.new {$common_dlg.show}
|
102
|
+
d = AppWindow.new($hwnd).dialog("title" => "My new dialog")
|
103
|
+
assert_equal(d.content_text, "E&dit boxCo&mbo box")
|
104
|
+
end
|
105
|
+
|
106
|
+
def teardown()
|
107
|
+
$common_dlg.close()
|
108
|
+
sleep 1
|
109
|
+
end
|
110
|
+
|
111
|
+
end
|