rautomation 0.7.3 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. data/.gitignore +9 -8
  2. data/Gemfile.lock +2 -2
  3. data/History.rdoc +13 -0
  4. data/README.rdoc +3 -2
  5. data/Rakefile +30 -10
  6. data/VERSION +1 -1
  7. data/ext/UiaDll/Release/UiaDll.dll +0 -0
  8. data/ext/UiaDll/UiaDll/AssemblyInfo.cpp +40 -0
  9. data/ext/UiaDll/UiaDll/AutomatedComboBox.cpp +66 -0
  10. data/ext/UiaDll/UiaDll/AutomatedComboBox.h +32 -0
  11. data/ext/UiaDll/UiaDll/AutomatedTable.cpp +50 -0
  12. data/ext/UiaDll/UiaDll/AutomatedTable.h +22 -0
  13. data/ext/UiaDll/UiaDll/AutomationClicker.cpp +50 -0
  14. data/ext/UiaDll/UiaDll/AutomationClicker.h +24 -0
  15. data/ext/UiaDll/UiaDll/ExpandCollapseHelper.cpp +53 -0
  16. data/ext/UiaDll/UiaDll/ExpandCollapseHelper.h +22 -0
  17. data/ext/UiaDll/UiaDll/MenuItemSelector.cpp +75 -0
  18. data/ext/UiaDll/UiaDll/MenuItemSelector.h +22 -0
  19. data/ext/UiaDll/UiaDll/ReadMe.txt +8 -18
  20. data/ext/UiaDll/UiaDll/StringHelper.cpp +9 -0
  21. data/ext/UiaDll/UiaDll/StringHelper.h +7 -0
  22. data/ext/UiaDll/UiaDll/ToggleStateHelper.cpp +33 -0
  23. data/ext/UiaDll/UiaDll/ToggleStateHelper.h +10 -0
  24. data/ext/UiaDll/UiaDll/UiaDll.cpp +458 -325
  25. data/ext/UiaDll/UiaDll/UiaDll.h +13 -0
  26. data/ext/UiaDll/UiaDll/UiaDll.vcxproj +45 -28
  27. data/ext/UiaDll/UiaDll/UiaDll.vcxproj.filters +66 -7
  28. data/ext/UiaDll/UiaDll/app.ico +0 -0
  29. data/ext/UiaDll/UiaDll/app.rc +0 -0
  30. data/ext/UiaDll/UiaDll/dllmain.cpp +5 -23
  31. data/ext/UiaDll/UiaDll/resource.h +3 -0
  32. data/ext/UiaDll/UiaDll/stdafx.cpp +0 -3
  33. data/ext/UiaDll/UiaDll/stdafx.h +23 -18
  34. data/ext/UiaDll/UiaDll.sln +6 -6
  35. data/ext/WindowsForms/Release/WindowsForms.exe +0 -0
  36. data/ext/WindowsForms/{src/WindowsForms/WindowsForms → WindowsForms}/AboutBox.Designer.cs +0 -0
  37. data/ext/WindowsForms/{src/WindowsForms/WindowsForms → WindowsForms}/AboutBox.cs +0 -0
  38. data/ext/WindowsForms/{src/WindowsForms/WindowsForms → WindowsForms}/AboutBox.resx +0 -0
  39. data/ext/WindowsForms/{src/WindowsForms/WindowsForms → WindowsForms}/DataEntryForm.Designer.cs +0 -0
  40. data/ext/WindowsForms/{src/WindowsForms/WindowsForms → WindowsForms}/DataEntryForm.cs +0 -0
  41. data/ext/WindowsForms/{src/WindowsForms/WindowsForms → WindowsForms}/DataEntryForm.resx +0 -0
  42. data/ext/WindowsForms/{src/WindowsForms/WindowsForms → WindowsForms}/MainFormWindow.Designer.cs +173 -76
  43. data/ext/WindowsForms/{src/WindowsForms/WindowsForms → WindowsForms}/MainFormWindow.cs +76 -77
  44. data/ext/WindowsForms/{src/WindowsForms/WindowsForms → WindowsForms}/MainFormWindow.resx +3 -0
  45. data/ext/WindowsForms/{src/WindowsForms/WindowsForms → WindowsForms}/PersonForm.Designer.cs +0 -0
  46. data/ext/WindowsForms/{src/WindowsForms/WindowsForms → WindowsForms}/PersonForm.cs +0 -0
  47. data/ext/WindowsForms/{src/WindowsForms/WindowsForms → WindowsForms}/PersonForm.resx +0 -0
  48. data/ext/WindowsForms/{src/WindowsForms/WindowsForms → WindowsForms}/Program.cs +0 -0
  49. data/ext/WindowsForms/{src/WindowsForms/WindowsForms → WindowsForms}/Properties/AssemblyInfo.cs +0 -0
  50. data/ext/WindowsForms/{src/WindowsForms/WindowsForms → WindowsForms}/Properties/Resources.Designer.cs +0 -0
  51. data/ext/WindowsForms/{src/WindowsForms/WindowsForms → WindowsForms}/Properties/Resources.resx +0 -0
  52. data/ext/WindowsForms/{src/WindowsForms/WindowsForms → WindowsForms}/Properties/Settings.Designer.cs +0 -0
  53. data/ext/WindowsForms/{src/WindowsForms/WindowsForms → WindowsForms}/Properties/Settings.settings +0 -0
  54. data/ext/WindowsForms/{src/WindowsForms/WindowsForms → WindowsForms}/SimpleElementsForm.Designer.cs +0 -0
  55. data/ext/WindowsForms/{src/WindowsForms/WindowsForms → WindowsForms}/SimpleElementsForm.cs +0 -0
  56. data/ext/WindowsForms/{src/WindowsForms/WindowsForms → WindowsForms}/SimpleElementsForm.resx +0 -0
  57. data/ext/WindowsForms/{src/WindowsForms/WindowsForms → WindowsForms}/WindowsForms.csproj +2 -2
  58. data/ext/WindowsForms/{src/WindowsForms/WindowsForms.sln → WindowsForms.sln} +0 -0
  59. data/lib/rautomation/adapter/ms_uia/constants.rb +1 -0
  60. data/lib/rautomation/adapter/ms_uia/control.rb +11 -0
  61. data/lib/rautomation/adapter/ms_uia/functions.rb +8 -5
  62. data/lib/rautomation/adapter/ms_uia/menu.rb +36 -0
  63. data/lib/rautomation/adapter/ms_uia/select_list.rb +4 -12
  64. data/lib/rautomation/adapter/ms_uia/table.rb +90 -11
  65. data/lib/rautomation/adapter/ms_uia/uia_dll.rb +48 -2
  66. data/lib/rautomation/adapter/ms_uia/window.rb +6 -1
  67. data/lib/rautomation/adapter/ms_uia.rb +1 -0
  68. data/spec/adapter/autoit/mouse_spec.rb +2 -2
  69. data/spec/adapter/ms_uia/functions_spec.rb +39 -0
  70. data/spec/adapter/ms_uia/select_list_spec.rb +26 -13
  71. data/spec/adapter/ms_uia/table_spec.rb +96 -2
  72. data/spec/adapter/ms_uia/window_spec.rb +37 -11
  73. data/spec/adapter/win_32/mouse_spec.rb +2 -2
  74. data/spec/adapter/win_32/window_spec.rb +0 -9
  75. data/spec/spec_helper.rb +3 -3
  76. data/spec/window_spec.rb +17 -6
  77. metadata +48 -40
  78. data/ext/ListViewExplorer/ListViewExplorer/ListViewExplorer.cpp +0 -174
  79. data/ext/ListViewExplorer/ListViewExplorer/ListViewExplorer.vcxproj +0 -95
  80. data/ext/ListViewExplorer/ListViewExplorer/ListViewExplorer.vcxproj.filters +0 -42
  81. data/ext/ListViewExplorer/ListViewExplorer/ListViewExplorer.vcxproj.user +0 -3
  82. data/ext/ListViewExplorer/ListViewExplorer/ReadMe.txt +0 -40
  83. data/ext/ListViewExplorer/ListViewExplorer/stdafx.cpp +0 -8
  84. data/ext/ListViewExplorer/ListViewExplorer/stdafx.h +0 -17
  85. data/ext/ListViewExplorer/ListViewExplorer/table_support.cpp +0 -250
  86. data/ext/ListViewExplorer/ListViewExplorer/table_support.h +0 -2
  87. data/ext/ListViewExplorer/ListViewExplorer/targetver.h +0 -8
  88. data/ext/ListViewExplorer/ListViewExplorer.sln +0 -20
  89. data/ext/ListViewExplorer/ListViewExplorer.suo +0 -0
  90. data/ext/UiaDll/UiaDll.suo +0 -0
  91. data/ext/WindowsForms/bin/WindowsForms.exe +0 -0
  92. data/ext/WindowsForms/src/WindowsForms/WindowsForms.suo +0 -0
@@ -1,33 +1,41 @@
1
- namespace WindowsForms
2
- {
3
- partial class MainFormWindow
4
- {
5
- /// <summary>
6
- /// Required designer variable.
7
- /// </summary>
8
- private System.ComponentModel.IContainer components = null;
9
-
10
- /// <summary>
11
- /// Clean up any resources being used.
12
- /// </summary>
13
- /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
14
- protected override void Dispose(bool disposing)
15
- {
16
- if (disposing && (components != null))
17
- {
18
- components.Dispose();
19
- }
20
- base.Dispose(disposing);
21
- }
22
-
23
- #region Windows Form Designer generated code
24
-
25
- /// <summary>
26
- /// Required method for Designer support - do not modify
27
- /// the contents of this method with the code editor.
28
- /// </summary>
29
- private void InitializeComponent()
30
- {
1
+ namespace WindowsForms
2
+ {
3
+ partial class MainFormWindow
4
+ {
5
+ /// <summary>
6
+ /// Required designer variable.
7
+ /// </summary>
8
+ private System.ComponentModel.IContainer components = null;
9
+
10
+ /// <summary>
11
+ /// Clean up any resources being used.
12
+ /// </summary>
13
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
14
+ protected override void Dispose(bool disposing)
15
+ {
16
+ if (disposing && (components != null))
17
+ {
18
+ components.Dispose();
19
+ }
20
+ base.Dispose(disposing);
21
+ }
22
+
23
+ #region Windows Form Designer generated code
24
+
25
+ /// <summary>
26
+ /// Required method for Designer support - do not modify
27
+ /// the contents of this method with the code editor.
28
+ /// </summary>
29
+ private void InitializeComponent()
30
+ {
31
+ System.Windows.Forms.TreeNode treeNode1 = new System.Windows.Forms.TreeNode("Child 1");
32
+ System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("Grandchild 1");
33
+ System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode("Child 2", new System.Windows.Forms.TreeNode[] {
34
+ treeNode2});
35
+ System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode("Parent One", new System.Windows.Forms.TreeNode[] {
36
+ treeNode1,
37
+ treeNode3});
38
+ System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("Parent Two");
31
39
  this.label1 = new System.Windows.Forms.Label();
32
40
  this.aboutButton = new System.Windows.Forms.Button();
33
41
  this.button1 = new System.Windows.Forms.Button();
@@ -52,14 +60,22 @@
52
60
  this.checkBoxDisabled = new System.Windows.Forms.CheckBox();
53
61
  this.textBoxDisabled = new System.Windows.Forms.TextBox();
54
62
  this.FruitListBox = new System.Windows.Forms.ListBox();
63
+ this.menuStrip1 = new System.Windows.Forms.MenuStrip();
64
+ this.faileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
65
+ this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
66
+ this.roundaboutWayToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
67
+ this.toToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
68
+ this.aboutToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
69
+ this.treeView = new System.Windows.Forms.TreeView();
55
70
  this.groupBox1.SuspendLayout();
56
71
  this.groupBox2.SuspendLayout();
72
+ this.menuStrip1.SuspendLayout();
57
73
  this.SuspendLayout();
58
74
  //
59
75
  // label1
60
76
  //
61
77
  this.label1.AutoSize = true;
62
- this.label1.Location = new System.Drawing.Point(139, 38);
78
+ this.label1.Location = new System.Drawing.Point(139, 65);
63
79
  this.label1.Name = "label1";
64
80
  this.label1.Size = new System.Drawing.Size(102, 13);
65
81
  this.label1.TabIndex = 0;
@@ -68,7 +84,7 @@
68
84
  //
69
85
  // aboutButton
70
86
  //
71
- this.aboutButton.Location = new System.Drawing.Point(12, 9);
87
+ this.aboutButton.Location = new System.Drawing.Point(12, 36);
72
88
  this.aboutButton.Name = "aboutButton";
73
89
  this.aboutButton.Size = new System.Drawing.Size(95, 23);
74
90
  this.aboutButton.TabIndex = 1;
@@ -78,7 +94,7 @@
78
94
  //
79
95
  // button1
80
96
  //
81
- this.button1.Location = new System.Drawing.Point(12, 96);
97
+ this.button1.Location = new System.Drawing.Point(12, 123);
82
98
  this.button1.Name = "button1";
83
99
  this.button1.Size = new System.Drawing.Size(95, 23);
84
100
  this.button1.TabIndex = 4;
@@ -88,7 +104,7 @@
88
104
  //
89
105
  // textField
90
106
  //
91
- this.textField.Location = new System.Drawing.Point(142, 69);
107
+ this.textField.Location = new System.Drawing.Point(142, 96);
92
108
  this.textField.Name = "textField";
93
109
  this.textField.Size = new System.Drawing.Size(184, 20);
94
110
  this.textField.TabIndex = 5;
@@ -97,7 +113,7 @@
97
113
  //
98
114
  this.checkBox.AutoSize = true;
99
115
  this.checkBox.FlatStyle = System.Windows.Forms.FlatStyle.System;
100
- this.checkBox.Location = new System.Drawing.Point(142, 105);
116
+ this.checkBox.Location = new System.Drawing.Point(142, 132);
101
117
  this.checkBox.Name = "checkBox";
102
118
  this.checkBox.Size = new System.Drawing.Size(80, 18);
103
119
  this.checkBox.TabIndex = 6;
@@ -108,7 +124,7 @@
108
124
  // checkBoxLabel
109
125
  //
110
126
  this.checkBoxLabel.AutoSize = true;
111
- this.checkBoxLabel.Location = new System.Drawing.Point(246, 106);
127
+ this.checkBoxLabel.Location = new System.Drawing.Point(246, 133);
112
128
  this.checkBoxLabel.Name = "checkBoxLabel";
113
129
  this.checkBoxLabel.Size = new System.Drawing.Size(80, 13);
114
130
  this.checkBoxLabel.TabIndex = 5;
@@ -121,7 +137,7 @@
121
137
  this.groupBox1.Controls.Add(this.radioButtonLabel);
122
138
  this.groupBox1.Controls.Add(this.radioButton2);
123
139
  this.groupBox1.Controls.Add(this.radioButton1);
124
- this.groupBox1.Location = new System.Drawing.Point(142, 136);
140
+ this.groupBox1.Location = new System.Drawing.Point(142, 163);
125
141
  this.groupBox1.Name = "groupBox1";
126
142
  this.groupBox1.Size = new System.Drawing.Size(325, 89);
127
143
  this.groupBox1.TabIndex = 6;
@@ -191,7 +207,7 @@
191
207
  this.groupBox2.Controls.Add(this.comboBoxDisabled);
192
208
  this.groupBox2.Controls.Add(this.fruitsLabel);
193
209
  this.groupBox2.Controls.Add(this.FruitsComboBox);
194
- this.groupBox2.Location = new System.Drawing.Point(142, 231);
210
+ this.groupBox2.Location = new System.Drawing.Point(142, 258);
195
211
  this.groupBox2.Name = "groupBox2";
196
212
  this.groupBox2.Size = new System.Drawing.Size(325, 63);
197
213
  this.groupBox2.TabIndex = 7;
@@ -241,7 +257,7 @@
241
257
  //
242
258
  // nextFormButton
243
259
  //
244
- this.nextFormButton.Location = new System.Drawing.Point(12, 38);
260
+ this.nextFormButton.Location = new System.Drawing.Point(12, 65);
245
261
  this.nextFormButton.Name = "nextFormButton";
246
262
  this.nextFormButton.Size = new System.Drawing.Size(95, 23);
247
263
  this.nextFormButton.TabIndex = 2;
@@ -252,7 +268,7 @@
252
268
  // label2
253
269
  //
254
270
  this.label2.AutoSize = true;
255
- this.label2.Location = new System.Drawing.Point(139, 14);
271
+ this.label2.Location = new System.Drawing.Point(139, 41);
256
272
  this.label2.Name = "label2";
257
273
  this.label2.Size = new System.Drawing.Size(108, 13);
258
274
  this.label2.TabIndex = 9;
@@ -260,7 +276,7 @@
260
276
  //
261
277
  // buttonButton
262
278
  //
263
- this.buttonButton.Location = new System.Drawing.Point(12, 67);
279
+ this.buttonButton.Location = new System.Drawing.Point(12, 94);
264
280
  this.buttonButton.Name = "buttonButton";
265
281
  this.buttonButton.Size = new System.Drawing.Size(95, 23);
266
282
  this.buttonButton.TabIndex = 3;
@@ -270,7 +286,7 @@
270
286
  //
271
287
  // enabledButton
272
288
  //
273
- this.enabledButton.Location = new System.Drawing.Point(574, 27);
289
+ this.enabledButton.Location = new System.Drawing.Point(574, 54);
274
290
  this.enabledButton.Name = "enabledButton";
275
291
  this.enabledButton.Size = new System.Drawing.Size(75, 23);
276
292
  this.enabledButton.TabIndex = 10;
@@ -280,7 +296,7 @@
280
296
  // disabledButton
281
297
  //
282
298
  this.disabledButton.Enabled = false;
283
- this.disabledButton.Location = new System.Drawing.Point(574, 69);
299
+ this.disabledButton.Location = new System.Drawing.Point(574, 96);
284
300
  this.disabledButton.Name = "disabledButton";
285
301
  this.disabledButton.Size = new System.Drawing.Size(75, 23);
286
302
  this.disabledButton.TabIndex = 11;
@@ -292,7 +308,7 @@
292
308
  this.checkBoxDisabled.AutoSize = true;
293
309
  this.checkBoxDisabled.Enabled = false;
294
310
  this.checkBoxDisabled.FlatStyle = System.Windows.Forms.FlatStyle.System;
295
- this.checkBoxDisabled.Location = new System.Drawing.Point(353, 102);
311
+ this.checkBoxDisabled.Location = new System.Drawing.Point(353, 129);
296
312
  this.checkBoxDisabled.Name = "checkBoxDisabled";
297
313
  this.checkBoxDisabled.Size = new System.Drawing.Size(121, 18);
298
314
  this.checkBoxDisabled.TabIndex = 12;
@@ -302,7 +318,7 @@
302
318
  // textBoxDisabled
303
319
  //
304
320
  this.textBoxDisabled.Enabled = false;
305
- this.textBoxDisabled.Location = new System.Drawing.Point(332, 69);
321
+ this.textBoxDisabled.Location = new System.Drawing.Point(332, 96);
306
322
  this.textBoxDisabled.Name = "textBoxDisabled";
307
323
  this.textBoxDisabled.Size = new System.Drawing.Size(184, 20);
308
324
  this.textBoxDisabled.TabIndex = 13;
@@ -314,16 +330,86 @@
314
330
  "Apple",
315
331
  "Orange",
316
332
  "Mango"});
317
- this.FruitListBox.Location = new System.Drawing.Point(490, 136);
333
+ this.FruitListBox.Location = new System.Drawing.Point(490, 163);
318
334
  this.FruitListBox.Name = "FruitListBox";
319
335
  this.FruitListBox.Size = new System.Drawing.Size(159, 95);
320
336
  this.FruitListBox.TabIndex = 14;
321
337
  //
338
+ // menuStrip1
339
+ //
340
+ this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
341
+ this.faileToolStripMenuItem});
342
+ this.menuStrip1.Location = new System.Drawing.Point(0, 0);
343
+ this.menuStrip1.Name = "menuStrip1";
344
+ this.menuStrip1.Size = new System.Drawing.Size(724, 24);
345
+ this.menuStrip1.TabIndex = 15;
346
+ this.menuStrip1.Text = "menuStrip1";
347
+ //
348
+ // faileToolStripMenuItem
349
+ //
350
+ this.faileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
351
+ this.aboutToolStripMenuItem,
352
+ this.roundaboutWayToolStripMenuItem});
353
+ this.faileToolStripMenuItem.Name = "faileToolStripMenuItem";
354
+ this.faileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
355
+ this.faileToolStripMenuItem.Text = "&File";
356
+ //
357
+ // aboutToolStripMenuItem
358
+ //
359
+ this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
360
+ this.aboutToolStripMenuItem.Size = new System.Drawing.Size(166, 22);
361
+ this.aboutToolStripMenuItem.Text = "&About";
362
+ this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutButton_Click);
363
+ //
364
+ // roundaboutWayToolStripMenuItem
365
+ //
366
+ this.roundaboutWayToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
367
+ this.toToolStripMenuItem});
368
+ this.roundaboutWayToolStripMenuItem.Name = "roundaboutWayToolStripMenuItem";
369
+ this.roundaboutWayToolStripMenuItem.Size = new System.Drawing.Size(166, 22);
370
+ this.roundaboutWayToolStripMenuItem.Text = "Roundabout Way";
371
+ //
372
+ // toToolStripMenuItem
373
+ //
374
+ this.toToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
375
+ this.aboutToolStripMenuItem1});
376
+ this.toToolStripMenuItem.Name = "toToolStripMenuItem";
377
+ this.toToolStripMenuItem.Size = new System.Drawing.Size(88, 22);
378
+ this.toToolStripMenuItem.Text = "To";
379
+ //
380
+ // aboutToolStripMenuItem1
381
+ //
382
+ this.aboutToolStripMenuItem1.Name = "aboutToolStripMenuItem1";
383
+ this.aboutToolStripMenuItem1.Size = new System.Drawing.Size(107, 22);
384
+ this.aboutToolStripMenuItem1.Text = "&About";
385
+ this.aboutToolStripMenuItem1.Click += new System.EventHandler(this.aboutButton_Click);
386
+ //
387
+ // treeView
388
+ //
389
+ this.treeView.Location = new System.Drawing.Point(490, 285);
390
+ this.treeView.Name = "treeView";
391
+ treeNode1.Name = "Child 1";
392
+ treeNode1.Text = "Child 1";
393
+ treeNode2.Name = "Grandchild 1";
394
+ treeNode2.Text = "Grandchild 1";
395
+ treeNode3.Name = "Child 2";
396
+ treeNode3.Text = "Child 2";
397
+ treeNode4.Name = "Parent One";
398
+ treeNode4.Text = "Parent One";
399
+ treeNode5.Name = "Parent Two";
400
+ treeNode5.Text = "Parent Two";
401
+ this.treeView.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
402
+ treeNode4,
403
+ treeNode5});
404
+ this.treeView.Size = new System.Drawing.Size(159, 177);
405
+ this.treeView.TabIndex = 16;
406
+ //
322
407
  // MainFormWindow
323
408
  //
324
409
  this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
325
410
  this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
326
411
  this.ClientSize = new System.Drawing.Size(724, 474);
412
+ this.Controls.Add(this.treeView);
327
413
  this.Controls.Add(this.FruitListBox);
328
414
  this.Controls.Add(this.textBoxDisabled);
329
415
  this.Controls.Add(this.checkBoxDisabled);
@@ -340,43 +426,54 @@
340
426
  this.Controls.Add(this.button1);
341
427
  this.Controls.Add(this.aboutButton);
342
428
  this.Controls.Add(this.label1);
429
+ this.Controls.Add(this.menuStrip1);
430
+ this.MainMenuStrip = this.menuStrip1;
343
431
  this.Name = "MainFormWindow";
344
432
  this.Text = "MainFormWindow";
345
433
  this.groupBox1.ResumeLayout(false);
346
434
  this.groupBox1.PerformLayout();
347
435
  this.groupBox2.ResumeLayout(false);
348
436
  this.groupBox2.PerformLayout();
437
+ this.menuStrip1.ResumeLayout(false);
438
+ this.menuStrip1.PerformLayout();
349
439
  this.ResumeLayout(false);
350
440
  this.PerformLayout();
351
441
 
352
- }
353
-
354
- #endregion
355
-
356
- private System.Windows.Forms.Label label1;
357
- private System.Windows.Forms.Button aboutButton;
358
- private System.Windows.Forms.Button button1;
359
- private System.Windows.Forms.TextBox textField;
360
- private System.Windows.Forms.CheckBox checkBox;
361
- private System.Windows.Forms.Label checkBoxLabel;
362
- private System.Windows.Forms.GroupBox groupBox1;
363
- private System.Windows.Forms.Label radioButtonLabel;
364
- private System.Windows.Forms.RadioButton radioButton2;
365
- private System.Windows.Forms.RadioButton radioButton1;
366
- private System.Windows.Forms.Button radioButtonReset;
367
- private System.Windows.Forms.GroupBox groupBox2;
368
- private System.Windows.Forms.ComboBox FruitsComboBox;
369
- private System.Windows.Forms.Label fruitsLabel;
370
- private System.Windows.Forms.Button nextFormButton;
371
- private System.Windows.Forms.Label label2;
372
- private System.Windows.Forms.Button buttonButton;
373
- private System.Windows.Forms.Button enabledButton;
374
- private System.Windows.Forms.Button disabledButton;
375
- private System.Windows.Forms.CheckBox checkBoxDisabled;
376
- private System.Windows.Forms.RadioButton radioButtonDisabled;
377
- private System.Windows.Forms.TextBox textBoxDisabled;
378
- private System.Windows.Forms.ComboBox comboBoxDisabled;
442
+ }
443
+
444
+ #endregion
445
+
446
+ private System.Windows.Forms.Label label1;
447
+ private System.Windows.Forms.Button aboutButton;
448
+ private System.Windows.Forms.Button button1;
449
+ private System.Windows.Forms.TextBox textField;
450
+ private System.Windows.Forms.CheckBox checkBox;
451
+ private System.Windows.Forms.Label checkBoxLabel;
452
+ private System.Windows.Forms.GroupBox groupBox1;
453
+ private System.Windows.Forms.Label radioButtonLabel;
454
+ private System.Windows.Forms.RadioButton radioButton2;
455
+ private System.Windows.Forms.RadioButton radioButton1;
456
+ private System.Windows.Forms.Button radioButtonReset;
457
+ private System.Windows.Forms.GroupBox groupBox2;
458
+ private System.Windows.Forms.ComboBox FruitsComboBox;
459
+ private System.Windows.Forms.Label fruitsLabel;
460
+ private System.Windows.Forms.Button nextFormButton;
461
+ private System.Windows.Forms.Label label2;
462
+ private System.Windows.Forms.Button buttonButton;
463
+ private System.Windows.Forms.Button enabledButton;
464
+ private System.Windows.Forms.Button disabledButton;
465
+ private System.Windows.Forms.CheckBox checkBoxDisabled;
466
+ private System.Windows.Forms.RadioButton radioButtonDisabled;
467
+ private System.Windows.Forms.TextBox textBoxDisabled;
468
+ private System.Windows.Forms.ComboBox comboBoxDisabled;
379
469
  private System.Windows.Forms.ListBox FruitListBox;
380
- }
381
- }
382
-
470
+ private System.Windows.Forms.MenuStrip menuStrip1;
471
+ private System.Windows.Forms.ToolStripMenuItem faileToolStripMenuItem;
472
+ private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
473
+ private System.Windows.Forms.ToolStripMenuItem roundaboutWayToolStripMenuItem;
474
+ private System.Windows.Forms.ToolStripMenuItem toToolStripMenuItem;
475
+ private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem1;
476
+ private System.Windows.Forms.TreeView treeView;
477
+ }
478
+ }
479
+
@@ -1,78 +1,77 @@
1
- using System;
2
- using System.Collections.Generic;
3
- using System.ComponentModel;
4
- using System.Data;
5
- using System.Drawing;
6
- using System.Linq;
7
- using System.Text;
8
- using System.Windows.Forms;
9
-
10
- namespace WindowsForms
11
- {
12
- public partial class MainFormWindow : Form
13
- {
14
- public MainFormWindow()
15
- {
16
- InitializeComponent();
1
+ using System;
2
+ using System.Collections.Generic;
3
+ using System.ComponentModel;
4
+ using System.Data;
5
+ using System.Drawing;
6
+ using System.Linq;
7
+ using System.Text;
8
+ using System.Windows.Forms;
9
+
10
+ namespace WindowsForms
11
+ {
12
+ public partial class MainFormWindow : Form
13
+ {
14
+ public MainFormWindow()
15
+ {
16
+ InitializeComponent();
17
+ }
18
+
19
+ private void label1_Click(object sender, EventArgs e)
20
+ {
21
+
22
+ }
23
+
24
+ private void aboutButton_Click(object sender, EventArgs e)
25
+ {
26
+ AboutBox aboutBox = new AboutBox();
27
+ aboutBox.Show();
28
+ }
29
+
30
+ private void button1_Click(object sender, EventArgs e)
31
+ {
32
+ this.Close();
33
+ }
34
+
35
+ private void checkBox_CheckedChanged(object sender, EventArgs e)
36
+ {
37
+ if (checkBox.Checked == true)
38
+ checkBoxLabel.Text = "checkBox is on";
39
+ else
40
+ checkBoxLabel.Text = "checkBox is off";
41
+ }
42
+
43
+ private void radioButton1_CheckedChanged(object sender, EventArgs e)
44
+ {
45
+ radioButtonLabel.Text = "Option 1 selected";
46
+ }
47
+
48
+ private void radioButton2_CheckedChanged(object sender, EventArgs e)
49
+ {
50
+ radioButtonLabel.Text = "Option 2 selected";
51
+ }
52
+
53
+ private void radioButtonReset_Click(object sender, EventArgs e)
54
+ {
55
+ radioButton1.Checked = false;
56
+ radioButton2.Checked = false;
57
+ radioButtonLabel.Text = "No option selected";
58
+ }
59
+
60
+ private void FruitsComboBox_SelectedIndexChanged(object sender, EventArgs e)
61
+ {
62
+ fruitsLabel.Text = FruitsComboBox.Text;
63
+ }
64
+
65
+ private void nextFormButton_Click(object sender, EventArgs e)
66
+ {
67
+ DataEntryForm form = new DataEntryForm();
68
+ form.Show();
69
+ }
70
+
71
+ private void buttonButton_Click(object sender, EventArgs e)
72
+ {
73
+ SimpleElementsForm buttonForm = new SimpleElementsForm();
74
+ buttonForm.Show();
17
75
  }
18
-
19
- private void label1_Click(object sender, EventArgs e)
20
- {
21
-
22
- }
23
-
24
- private void aboutButton_Click(object sender, EventArgs e)
25
- {
26
- AboutBox aboutBox = new AboutBox();
27
- aboutBox.Show();
28
- }
29
-
30
- private void button1_Click(object sender, EventArgs e)
31
- {
32
- this.Close();
33
- }
34
-
35
- private void checkBox_CheckedChanged(object sender, EventArgs e)
36
- {
37
- if (checkBox.Checked == true)
38
- checkBoxLabel.Text = "checkBox is on";
39
- else
40
- checkBoxLabel.Text = "checkBox is off";
41
- }
42
-
43
- private void radioButton1_CheckedChanged(object sender, EventArgs e)
44
- {
45
- radioButtonLabel.Text = "Option 1 selected";
46
- }
47
-
48
- private void radioButton2_CheckedChanged(object sender, EventArgs e)
49
- {
50
- radioButtonLabel.Text = "Option 2 selected";
51
- }
52
-
53
- private void radioButtonReset_Click(object sender, EventArgs e)
54
- {
55
- radioButton1.Checked = false;
56
- radioButton2.Checked = false;
57
- radioButtonLabel.Text = "No option selected";
58
- }
59
-
60
- private void FruitsComboBox_SelectedIndexChanged(object sender, EventArgs e)
61
- {
62
- fruitsLabel.Text = FruitsComboBox.Text;
63
- }
64
-
65
- private void nextFormButton_Click(object sender, EventArgs e)
66
- {
67
- DataEntryForm form = new DataEntryForm();
68
- form.Show();
69
- }
70
-
71
- private void buttonButton_Click(object sender, EventArgs e)
72
- {
73
- SimpleElementsForm buttonForm = new SimpleElementsForm();
74
- buttonForm.Show();
75
- }
76
-
77
- }
78
- }
76
+ }
77
+ }
@@ -117,4 +117,7 @@
117
117
  <resheader name="writer">
118
118
  <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
119
  </resheader>
120
+ <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121
+ <value>17, 17</value>
122
+ </metadata>
120
123
  </root>
@@ -19,7 +19,7 @@
19
19
  <DebugSymbols>true</DebugSymbols>
20
20
  <DebugType>full</DebugType>
21
21
  <Optimize>false</Optimize>
22
- <OutputPath>bin\Debug\</OutputPath>
22
+ <OutputPath>..\Debug\</OutputPath>
23
23
  <DefineConstants>DEBUG;TRACE</DefineConstants>
24
24
  <ErrorReport>prompt</ErrorReport>
25
25
  <WarningLevel>4</WarningLevel>
@@ -28,7 +28,7 @@
28
28
  <PlatformTarget>x86</PlatformTarget>
29
29
  <DebugType>pdbonly</DebugType>
30
30
  <Optimize>true</Optimize>
31
- <OutputPath>bin\Release\</OutputPath>
31
+ <OutputPath>..\Release\</OutputPath>
32
32
  <DefineConstants>TRACE</DefineConstants>
33
33
  <ErrorReport>prompt</ErrorReport>
34
34
  <WarningLevel>4</WarningLevel>
@@ -91,6 +91,7 @@ module RAutomation
91
91
  # UI Automation control type IDs
92
92
  UIA_LIST_CONTROL_TYPE = 50008
93
93
  UIA_LIST_ITEM_CONTROL_TYPE = 50007
94
+ UIA_DATA_GRID_CONTROL_TYPE =50028
94
95
  UIA_DATA_ITEM_CONTROL_TYPE =50029
95
96
  UIA_CHECKBOX_CONTROL_TYPE = 50002
96
97
  UIA_BUTTON_CONTROL_TYPE = 50000
@@ -174,6 +174,17 @@ module RAutomation
174
174
  def assert_enabled
175
175
  raise "Cannot interact with disabled control #{@locators.inspect} on window #{@window.locators.inspect}!" if disabled?
176
176
  end
177
+
178
+ def expand(which_item)
179
+ UiaDll::expand_by_value hwnd, which_item if which_item.is_a? String
180
+ UiaDll::expand_by_index hwnd, which_item if which_item.is_a? Integer
181
+ end
182
+
183
+ def collapse(which_item)
184
+ UiaDll::collapse_by_value hwnd, which_item if which_item.is_a? String
185
+ UiaDll::collapse_by_index hwnd, which_item if which_item.is_a? Integer
186
+ end
187
+
177
188
  end
178
189
  end
179
190
  end
@@ -128,7 +128,7 @@ module RAutomation
128
128
  locators.merge!(:hwnd => popup_hwnd) if locators_match?(locators, popup_properties)
129
129
  end
130
130
  end
131
- locators
131
+ locators.merge(:adapter => :ms_uia)
132
132
  end
133
133
 
134
134
  def window_pid(hwnd)
@@ -198,7 +198,11 @@ module RAutomation
198
198
  end
199
199
 
200
200
  def control_click(control_hwnd)
201
- post_message(control_hwnd, Constants::BM_CLICK, 0, nil)
201
+ string_buffer = FFI::MemoryPointer.new :char, 1024
202
+ UiaDll::control_mouse_click control_hwnd, string_buffer, 1024
203
+ error_info = string_buffer.read_string
204
+ raise error_info unless error_info.empty?
205
+ true
202
206
  end
203
207
 
204
208
  def set_control_focus(control_hwnd)
@@ -224,10 +228,9 @@ module RAutomation
224
228
  end
225
229
 
226
230
  def retrieve_combobox_item_text(control_hwnd, item_no)
227
- text_len = send_message(control_hwnd, Constants::CB_GETLBTEXTLEN, item_no, nil)
228
-
231
+ text_len = 1024
229
232
  string_buffer = FFI::MemoryPointer.new :char, text_len
230
- send_message(control_hwnd, Constants::CB_GETLBTEXT, item_no, string_buffer)
233
+ UiaDll::get_combobox_value control_hwnd, item_no, string_buffer, text_len
231
234
  string_buffer.read_string
232
235
  end
233
236