rautomation 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. data/History.rdoc +14 -0
  2. data/README.rdoc +1 -1
  3. data/VERSION +1 -1
  4. data/ext/IAccessibleDLL/IAccessibleDLL.suo +0 -0
  5. data/ext/IAccessibleDLL/IAccessibleDLL/IAccessibleDLL.cpp +0 -6
  6. data/ext/IAccessibleDLL/IAccessibleDLL/IAccessibleDLL.vcxproj +2 -0
  7. data/ext/IAccessibleDLL/IAccessibleDLL/IAccessibleDLL.vcxproj.filters +3 -0
  8. data/ext/IAccessibleDLL/IAccessibleDLL/stdafx.h +9 -3
  9. data/ext/IAccessibleDLL/IAccessibleDLL/table_support.cpp +282 -0
  10. data/ext/IAccessibleDLL/Release/IAccessibleDLL.dll +0 -0
  11. data/ext/ListViewExplorer/ListViewExplorer.sln +20 -0
  12. data/ext/ListViewExplorer/ListViewExplorer.suo +0 -0
  13. data/ext/ListViewExplorer/ListViewExplorer/ListViewExplorer.cpp +174 -0
  14. data/ext/ListViewExplorer/ListViewExplorer/ListViewExplorer.vcxproj +95 -0
  15. data/ext/ListViewExplorer/ListViewExplorer/ListViewExplorer.vcxproj.filters +42 -0
  16. data/ext/ListViewExplorer/ListViewExplorer/ListViewExplorer.vcxproj.user +3 -0
  17. data/ext/ListViewExplorer/ListViewExplorer/ReadMe.txt +40 -0
  18. data/ext/ListViewExplorer/ListViewExplorer/stdafx.cpp +8 -0
  19. data/ext/ListViewExplorer/ListViewExplorer/stdafx.h +17 -0
  20. data/ext/ListViewExplorer/ListViewExplorer/table_support.cpp +250 -0
  21. data/ext/ListViewExplorer/ListViewExplorer/table_support.h +2 -0
  22. data/ext/ListViewExplorer/ListViewExplorer/targetver.h +8 -0
  23. data/ext/UiaDll/Release/UiaDll.dll +0 -0
  24. data/ext/UiaDll/UiaDll.sln +20 -0
  25. data/ext/UiaDll/UiaDll.suo +0 -0
  26. data/ext/UiaDll/UiaDll/ReadMe.txt +48 -0
  27. data/ext/UiaDll/UiaDll/UiaDll.cpp +205 -0
  28. data/ext/UiaDll/UiaDll/UiaDll.vcxproj +104 -0
  29. data/ext/UiaDll/UiaDll/UiaDll.vcxproj.filters +42 -0
  30. data/ext/UiaDll/UiaDll/dllmain.cpp +39 -0
  31. data/ext/UiaDll/UiaDll/globals.h +3 -0
  32. data/ext/UiaDll/UiaDll/stdafx.cpp +8 -0
  33. data/ext/UiaDll/UiaDll/stdafx.h +19 -0
  34. data/ext/UiaDll/UiaDll/targetver.h +8 -0
  35. data/ext/WindowsForms/bin/WindowsForms.exe +0 -0
  36. data/ext/WindowsForms/src/WindowsForms/WindowsForms.suo +0 -0
  37. data/ext/WindowsForms/src/WindowsForms/WindowsForms/DataEntryForm.Designer.cs +27 -7
  38. data/ext/WindowsForms/src/WindowsForms/WindowsForms/DataEntryForm.cs +1 -0
  39. data/ext/WindowsForms/src/WindowsForms/WindowsForms/MainFormWindow.Designer.cs +110 -11
  40. data/ext/WindowsForms/src/WindowsForms/WindowsForms/bin/Release/WindowsForms.exe +0 -0
  41. data/lib/rautomation.rb +2 -3
  42. data/lib/rautomation/adapter/autoit.rb +2 -2
  43. data/lib/rautomation/adapter/win_ffi.rb +4 -0
  44. data/lib/rautomation/adapter/win_ffi/button.rb +6 -0
  45. data/lib/rautomation/adapter/win_ffi/checkbox.rb +7 -0
  46. data/lib/rautomation/adapter/win_ffi/constants.rb +44 -3
  47. data/lib/rautomation/adapter/win_ffi/control.rb +36 -3
  48. data/lib/rautomation/adapter/win_ffi/functions.rb +37 -3
  49. data/lib/rautomation/adapter/win_ffi/keystroke_converter.rb +67 -0
  50. data/lib/rautomation/adapter/win_ffi/label.rb +21 -0
  51. data/lib/rautomation/adapter/win_ffi/list_box.rb +60 -0
  52. data/lib/rautomation/adapter/win_ffi/locators.rb +0 -1
  53. data/lib/rautomation/adapter/win_ffi/ms_uia/uia_dll.rb +36 -0
  54. data/lib/rautomation/adapter/win_ffi/radio.rb +7 -0
  55. data/lib/rautomation/adapter/win_ffi/select_list.rb +30 -7
  56. data/lib/rautomation/adapter/win_ffi/table.rb +42 -3
  57. data/lib/rautomation/adapter/win_ffi/text_field.rb +17 -1
  58. data/lib/rautomation/adapter/win_ffi/window.rb +47 -8
  59. data/lib/rautomation/button.rb +5 -0
  60. data/lib/rautomation/element_collections.rb +8 -5
  61. data/lib/rautomation/text_field.rb +10 -0
  62. data/lib/rautomation/window.rb +20 -14
  63. data/spec/adapter/win_ffi/button_spec.rb +41 -0
  64. data/spec/adapter/win_ffi/checkbox_spec.rb +19 -0
  65. data/spec/adapter/win_ffi/keystroke_converter_spec.rb +47 -0
  66. data/spec/adapter/win_ffi/label_spec.rb +21 -0
  67. data/spec/adapter/win_ffi/listbox_spec.rb +52 -0
  68. data/spec/adapter/win_ffi/radio_spec.rb +16 -0
  69. data/spec/adapter/win_ffi/select_list_spec.rb +29 -4
  70. data/spec/adapter/win_ffi/table_spec.rb +20 -1
  71. data/spec/adapter/win_ffi/text_field_spec.rb +23 -0
  72. data/spec/adapter/win_ffi/window_spec.rb +29 -0
  73. data/spec/button_spec.rb +1 -0
  74. data/spec/spec_helper.rb +4 -1
  75. data/spec/text_field_spec.rb +27 -15
  76. metadata +52 -34
  77. data/ext/IAccessibleDLL/Release/IAccessibleDLL.exp +0 -0
  78. data/ext/IAccessibleDLL/Release/IAccessibleDLL.lib +0 -0
  79. data/ext/WindowsForms/src/WindowsForms/WindowsForms/bin/Debug/WindowsForms.exe +0 -0
  80. data/ext/WindowsForms/src/WindowsForms/WindowsForms/bin/Debug/WindowsForms.pdb +0 -0
  81. data/ext/WindowsForms/src/WindowsForms/WindowsForms/bin/Debug/WindowsForms.vshost.exe +0 -0
  82. data/ext/WindowsForms/src/WindowsForms/WindowsForms/bin/Debug/WindowsForms.vshost.exe.manifest +0 -11
  83. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache +0 -0
  84. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache +0 -0
  85. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/GenerateResource.read.1.tlog +0 -0
  86. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/GenerateResource.write.1.tlog +0 -0
  87. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/ResolveAssemblyReference.cache +0 -0
  88. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.AboutBox.resources +0 -0
  89. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.DataEntryForm.resources +0 -0
  90. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.MainFormWindow.resources +0 -0
  91. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.PersonForm.resources +0 -0
  92. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.Properties.Resources.resources +0 -0
  93. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.SimpleElementsForm.resources +0 -0
  94. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.csproj.FileListAbsolute.txt +0 -25
  95. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.exe +0 -0
  96. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.pdb +0 -0
@@ -0,0 +1,3 @@
1
+
2
+ IUIAutomation* getGlobalIUIAutomation() ;
3
+
@@ -0,0 +1,8 @@
1
+ // stdafx.cpp : source file that includes just the standard includes
2
+ // UiaDll.pch will be the pre-compiled header
3
+ // stdafx.obj will contain the pre-compiled type information
4
+
5
+ #include "stdafx.h"
6
+
7
+ // TODO: reference any additional headers you need in STDAFX.H
8
+ // and not in this file
@@ -0,0 +1,19 @@
1
+ // stdafx.h : include file for standard system include files,
2
+ // or project specific include files that are used frequently, but
3
+ // are changed infrequently
4
+ //
5
+
6
+ #pragma once
7
+
8
+ #include "targetver.h"
9
+
10
+ #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
11
+ // Windows Header Files:
12
+ #include <windows.h>
13
+ #include <ObjBase.h>
14
+ #include <UIAutomation.h>
15
+ #include <comutil.h>
16
+
17
+ // TODO: reference additional headers your program requires here
18
+
19
+ #include "globals.h"
@@ -0,0 +1,8 @@
1
+ #pragma once
2
+
3
+ // Including SDKDDKVer.h defines the highest available Windows platform.
4
+
5
+ // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
6
+ // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
7
+
8
+ #include <SDKDDKVer.h>
Binary file
@@ -28,10 +28,11 @@
28
28
  /// </summary>
29
29
  private void InitializeComponent()
30
30
  {
31
- System.Windows.Forms.ListViewItem listViewItem3 = new System.Windows.Forms.ListViewItem(new string[] {
31
+ System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem(new string[] {
32
32
  "John Doe",
33
- "12/15/1967"}, -1);
34
- System.Windows.Forms.ListViewItem listViewItem4 = new System.Windows.Forms.ListViewItem(new string[] {
33
+ "12/15/1967",
34
+ "FL"}, -1);
35
+ System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem(new string[] {
35
36
  "Anna Doe",
36
37
  "3/4/1975"}, -1);
37
38
  this.deleteItemButton = new System.Windows.Forms.Button();
@@ -40,9 +41,11 @@
40
41
  this.personListView = new System.Windows.Forms.ListView();
41
42
  this.columnName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
42
43
  this.columnDateOfBirth = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
44
+ this.columnState = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
43
45
  this.closeDataEntryFormButton = new System.Windows.Forms.Button();
44
46
  this.maskedTextBox1 = new System.Windows.Forms.MaskedTextBox();
45
47
  this.label1 = new System.Windows.Forms.Label();
48
+ this.maskedTextBox2 = new System.Windows.Forms.MaskedTextBox();
46
49
  this.groupBox3.SuspendLayout();
47
50
  this.SuspendLayout();
48
51
  //
@@ -82,12 +85,13 @@
82
85
  //
83
86
  this.personListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
84
87
  this.columnName,
85
- this.columnDateOfBirth});
88
+ this.columnDateOfBirth,
89
+ this.columnState});
86
90
  this.personListView.GridLines = true;
87
91
  this.personListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
88
92
  this.personListView.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
89
- listViewItem3,
90
- listViewItem4});
93
+ listViewItem1,
94
+ listViewItem2});
91
95
  this.personListView.Location = new System.Drawing.Point(6, 26);
92
96
  this.personListView.Name = "personListView";
93
97
  this.personListView.Size = new System.Drawing.Size(314, 74);
@@ -98,13 +102,17 @@
98
102
  // columnName
99
103
  //
100
104
  this.columnName.Text = "Name";
101
- this.columnName.Width = 200;
105
+ this.columnName.Width = 148;
102
106
  //
103
107
  // columnDateOfBirth
104
108
  //
105
109
  this.columnDateOfBirth.Text = "Date of birth";
106
110
  this.columnDateOfBirth.Width = 100;
107
111
  //
112
+ // columnState
113
+ //
114
+ this.columnState.Text = "State";
115
+ //
108
116
  // closeDataEntryFormButton
109
117
  //
110
118
  this.closeDataEntryFormButton.Location = new System.Drawing.Point(12, 12);
@@ -132,11 +140,21 @@
132
140
  this.label1.TabIndex = 13;
133
141
  this.label1.Text = "Phone number";
134
142
  //
143
+ // maskedTextBox2
144
+ //
145
+ this.maskedTextBox2.Location = new System.Drawing.Point(425, 280);
146
+ this.maskedTextBox2.Mask = "00/00/0000";
147
+ this.maskedTextBox2.Name = "maskedTextBox2";
148
+ this.maskedTextBox2.Size = new System.Drawing.Size(100, 20);
149
+ this.maskedTextBox2.TabIndex = 14;
150
+ this.maskedTextBox2.ValidatingType = typeof(System.DateTime);
151
+ //
135
152
  // DataEntryForm
136
153
  //
137
154
  this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
138
155
  this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
139
156
  this.ClientSize = new System.Drawing.Size(724, 474);
157
+ this.Controls.Add(this.maskedTextBox2);
140
158
  this.Controls.Add(this.label1);
141
159
  this.Controls.Add(this.maskedTextBox1);
142
160
  this.Controls.Add(this.closeDataEntryFormButton);
@@ -163,5 +181,7 @@
163
181
  private System.Windows.Forms.Button closeDataEntryFormButton;
164
182
  private System.Windows.Forms.MaskedTextBox maskedTextBox1;
165
183
  private System.Windows.Forms.Label label1;
184
+ private System.Windows.Forms.ColumnHeader columnState;
185
+ private System.Windows.Forms.MaskedTextBox maskedTextBox2;
166
186
  }
167
187
  }
@@ -41,5 +41,6 @@ namespace WindowsForms
41
41
  personListView.Items.Remove(item);
42
42
  }
43
43
  }
44
+
44
45
  }
45
46
  }
@@ -35,16 +35,23 @@
35
35
  this.checkBox = new System.Windows.Forms.CheckBox();
36
36
  this.checkBoxLabel = new System.Windows.Forms.Label();
37
37
  this.groupBox1 = new System.Windows.Forms.GroupBox();
38
+ this.radioButtonDisabled = new System.Windows.Forms.RadioButton();
38
39
  this.radioButtonReset = new System.Windows.Forms.Button();
39
40
  this.radioButtonLabel = new System.Windows.Forms.Label();
40
41
  this.radioButton2 = new System.Windows.Forms.RadioButton();
41
42
  this.radioButton1 = new System.Windows.Forms.RadioButton();
42
43
  this.groupBox2 = new System.Windows.Forms.GroupBox();
44
+ this.comboBoxDisabled = new System.Windows.Forms.ComboBox();
43
45
  this.fruitsLabel = new System.Windows.Forms.Label();
44
46
  this.FruitsComboBox = new System.Windows.Forms.ComboBox();
45
47
  this.nextFormButton = new System.Windows.Forms.Button();
46
48
  this.label2 = new System.Windows.Forms.Label();
47
49
  this.buttonButton = new System.Windows.Forms.Button();
50
+ this.enabledButton = new System.Windows.Forms.Button();
51
+ this.disabledButton = new System.Windows.Forms.Button();
52
+ this.checkBoxDisabled = new System.Windows.Forms.CheckBox();
53
+ this.textBoxDisabled = new System.Windows.Forms.TextBox();
54
+ this.FruitListBox = new System.Windows.Forms.ListBox();
48
55
  this.groupBox1.SuspendLayout();
49
56
  this.groupBox2.SuspendLayout();
50
57
  this.SuspendLayout();
@@ -74,7 +81,7 @@
74
81
  this.button1.Location = new System.Drawing.Point(12, 96);
75
82
  this.button1.Name = "button1";
76
83
  this.button1.Size = new System.Drawing.Size(95, 23);
77
- this.button1.TabIndex = 2;
84
+ this.button1.TabIndex = 4;
78
85
  this.button1.Text = "Close";
79
86
  this.button1.UseVisualStyleBackColor = true;
80
87
  this.button1.Click += new System.EventHandler(this.button1_Click);
@@ -83,8 +90,8 @@
83
90
  //
84
91
  this.textField.Location = new System.Drawing.Point(142, 69);
85
92
  this.textField.Name = "textField";
86
- this.textField.Size = new System.Drawing.Size(253, 20);
87
- this.textField.TabIndex = 3;
93
+ this.textField.Size = new System.Drawing.Size(184, 20);
94
+ this.textField.TabIndex = 5;
88
95
  //
89
96
  // checkBox
90
97
  //
@@ -92,7 +99,7 @@
92
99
  this.checkBox.Location = new System.Drawing.Point(142, 105);
93
100
  this.checkBox.Name = "checkBox";
94
101
  this.checkBox.Size = new System.Drawing.Size(74, 17);
95
- this.checkBox.TabIndex = 4;
102
+ this.checkBox.TabIndex = 6;
96
103
  this.checkBox.Text = "checkBox";
97
104
  this.checkBox.UseVisualStyleBackColor = true;
98
105
  this.checkBox.CheckedChanged += new System.EventHandler(this.checkBox_CheckedChanged);
@@ -108,23 +115,36 @@
108
115
  //
109
116
  // groupBox1
110
117
  //
118
+ this.groupBox1.Controls.Add(this.radioButtonDisabled);
111
119
  this.groupBox1.Controls.Add(this.radioButtonReset);
112
120
  this.groupBox1.Controls.Add(this.radioButtonLabel);
113
121
  this.groupBox1.Controls.Add(this.radioButton2);
114
122
  this.groupBox1.Controls.Add(this.radioButton1);
115
123
  this.groupBox1.Location = new System.Drawing.Point(142, 136);
116
124
  this.groupBox1.Name = "groupBox1";
117
- this.groupBox1.Size = new System.Drawing.Size(234, 89);
125
+ this.groupBox1.Size = new System.Drawing.Size(325, 89);
118
126
  this.groupBox1.TabIndex = 6;
119
127
  this.groupBox1.TabStop = false;
120
128
  this.groupBox1.Text = "Groupd of radio buttons";
121
129
  //
130
+ // radioButtonDisabled
131
+ //
132
+ this.radioButtonDisabled.AutoSize = true;
133
+ this.radioButtonDisabled.Enabled = false;
134
+ this.radioButtonDisabled.Location = new System.Drawing.Point(188, 28);
135
+ this.radioButtonDisabled.Name = "radioButtonDisabled";
136
+ this.radioButtonDisabled.Size = new System.Drawing.Size(100, 17);
137
+ this.radioButtonDisabled.TabIndex = 10;
138
+ this.radioButtonDisabled.TabStop = true;
139
+ this.radioButtonDisabled.Text = "Option Disabled";
140
+ this.radioButtonDisabled.UseVisualStyleBackColor = true;
141
+ //
122
142
  // radioButtonReset
123
143
  //
124
144
  this.radioButtonReset.Location = new System.Drawing.Point(143, 56);
125
145
  this.radioButtonReset.Name = "radioButtonReset";
126
146
  this.radioButtonReset.Size = new System.Drawing.Size(75, 23);
127
- this.radioButtonReset.TabIndex = 3;
147
+ this.radioButtonReset.TabIndex = 9;
128
148
  this.radioButtonReset.Text = "Reset";
129
149
  this.radioButtonReset.UseVisualStyleBackColor = true;
130
150
  this.radioButtonReset.Click += new System.EventHandler(this.radioButtonReset_Click);
@@ -144,7 +164,7 @@
144
164
  this.radioButton2.Location = new System.Drawing.Point(107, 28);
145
165
  this.radioButton2.Name = "radioButton2";
146
166
  this.radioButton2.Size = new System.Drawing.Size(65, 17);
147
- this.radioButton2.TabIndex = 1;
167
+ this.radioButton2.TabIndex = 8;
148
168
  this.radioButton2.TabStop = true;
149
169
  this.radioButton2.Text = "Option 2";
150
170
  this.radioButton2.UseVisualStyleBackColor = true;
@@ -156,7 +176,7 @@
156
176
  this.radioButton1.Location = new System.Drawing.Point(9, 28);
157
177
  this.radioButton1.Name = "radioButton1";
158
178
  this.radioButton1.Size = new System.Drawing.Size(65, 17);
159
- this.radioButton1.TabIndex = 0;
179
+ this.radioButton1.TabIndex = 7;
160
180
  this.radioButton1.TabStop = true;
161
181
  this.radioButton1.Text = "Option 1";
162
182
  this.radioButton1.UseVisualStyleBackColor = true;
@@ -164,6 +184,7 @@
164
184
  //
165
185
  // groupBox2
166
186
  //
187
+ this.groupBox2.Controls.Add(this.comboBoxDisabled);
167
188
  this.groupBox2.Controls.Add(this.fruitsLabel);
168
189
  this.groupBox2.Controls.Add(this.FruitsComboBox);
169
190
  this.groupBox2.Location = new System.Drawing.Point(142, 231);
@@ -173,6 +194,22 @@
173
194
  this.groupBox2.TabStop = false;
174
195
  this.groupBox2.Text = "Drop down list";
175
196
  //
197
+ // comboBoxDisabled
198
+ //
199
+ this.comboBoxDisabled.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
200
+ this.comboBoxDisabled.Enabled = false;
201
+ this.comboBoxDisabled.FormattingEnabled = true;
202
+ this.comboBoxDisabled.Items.AddRange(new object[] {
203
+ "Apple",
204
+ "Caimito",
205
+ "Coconut",
206
+ "Orange",
207
+ "Passion Fruit"});
208
+ this.comboBoxDisabled.Location = new System.Drawing.Point(235, 27);
209
+ this.comboBoxDisabled.Name = "comboBoxDisabled";
210
+ this.comboBoxDisabled.Size = new System.Drawing.Size(84, 21);
211
+ this.comboBoxDisabled.TabIndex = 11;
212
+ //
176
213
  // fruitsLabel
177
214
  //
178
215
  this.fruitsLabel.AutoSize = true;
@@ -195,7 +232,7 @@
195
232
  this.FruitsComboBox.Location = new System.Drawing.Point(6, 27);
196
233
  this.FruitsComboBox.Name = "FruitsComboBox";
197
234
  this.FruitsComboBox.Size = new System.Drawing.Size(121, 21);
198
- this.FruitsComboBox.TabIndex = 0;
235
+ this.FruitsComboBox.TabIndex = 10;
199
236
  this.FruitsComboBox.SelectedIndexChanged += new System.EventHandler(this.FruitsComboBox_SelectedIndexChanged);
200
237
  //
201
238
  // nextFormButton
@@ -203,7 +240,7 @@
203
240
  this.nextFormButton.Location = new System.Drawing.Point(12, 38);
204
241
  this.nextFormButton.Name = "nextFormButton";
205
242
  this.nextFormButton.Size = new System.Drawing.Size(95, 23);
206
- this.nextFormButton.TabIndex = 8;
243
+ this.nextFormButton.TabIndex = 2;
207
244
  this.nextFormButton.Text = "Data Entry Form";
208
245
  this.nextFormButton.UseVisualStyleBackColor = true;
209
246
  this.nextFormButton.Click += new System.EventHandler(this.nextFormButton_Click);
@@ -222,16 +259,71 @@
222
259
  this.buttonButton.Location = new System.Drawing.Point(12, 67);
223
260
  this.buttonButton.Name = "buttonButton";
224
261
  this.buttonButton.Size = new System.Drawing.Size(95, 23);
225
- this.buttonButton.TabIndex = 10;
262
+ this.buttonButton.TabIndex = 3;
226
263
  this.buttonButton.Text = "Simple Elements";
227
264
  this.buttonButton.UseVisualStyleBackColor = true;
228
265
  this.buttonButton.Click += new System.EventHandler(this.buttonButton_Click);
229
266
  //
267
+ // enabledButton
268
+ //
269
+ this.enabledButton.Location = new System.Drawing.Point(574, 27);
270
+ this.enabledButton.Name = "enabledButton";
271
+ this.enabledButton.Size = new System.Drawing.Size(75, 23);
272
+ this.enabledButton.TabIndex = 10;
273
+ this.enabledButton.Text = "Enabled";
274
+ this.enabledButton.UseVisualStyleBackColor = true;
275
+ //
276
+ // disabledButton
277
+ //
278
+ this.disabledButton.Enabled = false;
279
+ this.disabledButton.Location = new System.Drawing.Point(574, 69);
280
+ this.disabledButton.Name = "disabledButton";
281
+ this.disabledButton.Size = new System.Drawing.Size(75, 23);
282
+ this.disabledButton.TabIndex = 11;
283
+ this.disabledButton.Text = "Disabled";
284
+ this.disabledButton.UseVisualStyleBackColor = true;
285
+ //
286
+ // checkBoxDisabled
287
+ //
288
+ this.checkBoxDisabled.AutoSize = true;
289
+ this.checkBoxDisabled.Enabled = false;
290
+ this.checkBoxDisabled.Location = new System.Drawing.Point(353, 102);
291
+ this.checkBoxDisabled.Name = "checkBoxDisabled";
292
+ this.checkBoxDisabled.Size = new System.Drawing.Size(115, 17);
293
+ this.checkBoxDisabled.TabIndex = 12;
294
+ this.checkBoxDisabled.Text = "checkBoxDisabled";
295
+ this.checkBoxDisabled.UseVisualStyleBackColor = true;
296
+ //
297
+ // textBoxDisabled
298
+ //
299
+ this.textBoxDisabled.Enabled = false;
300
+ this.textBoxDisabled.Location = new System.Drawing.Point(332, 69);
301
+ this.textBoxDisabled.Name = "textBoxDisabled";
302
+ this.textBoxDisabled.Size = new System.Drawing.Size(184, 20);
303
+ this.textBoxDisabled.TabIndex = 13;
304
+ //
305
+ // FruitListBox
306
+ //
307
+ this.FruitListBox.FormattingEnabled = true;
308
+ this.FruitListBox.Items.AddRange(new object[] {
309
+ "Apple",
310
+ "Orange",
311
+ "Mango"});
312
+ this.FruitListBox.Location = new System.Drawing.Point(490, 136);
313
+ this.FruitListBox.Name = "FruitListBox";
314
+ this.FruitListBox.Size = new System.Drawing.Size(159, 95);
315
+ this.FruitListBox.TabIndex = 14;
316
+ //
230
317
  // MainFormWindow
231
318
  //
232
319
  this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
233
320
  this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
234
321
  this.ClientSize = new System.Drawing.Size(724, 474);
322
+ this.Controls.Add(this.FruitListBox);
323
+ this.Controls.Add(this.textBoxDisabled);
324
+ this.Controls.Add(this.checkBoxDisabled);
325
+ this.Controls.Add(this.disabledButton);
326
+ this.Controls.Add(this.enabledButton);
235
327
  this.Controls.Add(this.buttonButton);
236
328
  this.Controls.Add(this.label2);
237
329
  this.Controls.Add(this.nextFormButton);
@@ -273,6 +365,13 @@
273
365
  private System.Windows.Forms.Button nextFormButton;
274
366
  private System.Windows.Forms.Label label2;
275
367
  private System.Windows.Forms.Button buttonButton;
368
+ private System.Windows.Forms.Button enabledButton;
369
+ private System.Windows.Forms.Button disabledButton;
370
+ private System.Windows.Forms.CheckBox checkBoxDisabled;
371
+ private System.Windows.Forms.RadioButton radioButtonDisabled;
372
+ private System.Windows.Forms.TextBox textBoxDisabled;
373
+ private System.Windows.Forms.ComboBox comboBoxDisabled;
374
+ private System.Windows.Forms.ListBox FruitListBox;
276
375
  }
277
376
  }
278
377
 
data/lib/rautomation.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require "rautomation/wait_helper"
2
2
  require "rautomation/adapter/helper"
3
- require "rautomation/element_collections"
4
- require "rautomation/window"
5
3
  require "rautomation/button"
6
4
  require "rautomation/text_field"
7
-
5
+ require "rautomation/element_collections"
6
+ require "rautomation/window"
@@ -1,5 +1,5 @@
1
1
  require "win32ole"
2
2
  require File.dirname(__FILE__) + "/autoit/locators"
3
- require File.dirname(__FILE__) + "/autoit/window"
4
3
  require File.dirname(__FILE__) + "/autoit/button"
5
- require File.dirname(__FILE__) + "/autoit/text_field"
4
+ require File.dirname(__FILE__) + "/autoit/text_field"
5
+ require File.dirname(__FILE__) + "/autoit/window"
@@ -5,6 +5,7 @@ rescue Gem::LoadError
5
5
  end
6
6
  require "ffi"
7
7
  require File.dirname(__FILE__) + "/win_ffi/constants"
8
+ require File.dirname(__FILE__) + "/win_ffi/keystroke_converter"
8
9
  require File.dirname(__FILE__) + "/win_ffi/functions"
9
10
  require File.dirname(__FILE__) + "/win_ffi/locators"
10
11
  require File.dirname(__FILE__) + "/win_ffi/window"
@@ -16,3 +17,6 @@ require File.dirname(__FILE__) + "/win_ffi/radio"
16
17
  require File.dirname(__FILE__) + "/win_ffi/text_field"
17
18
  require File.dirname(__FILE__) + "/win_ffi/select_list"
18
19
  require File.dirname(__FILE__) + "/win_ffi/table"
20
+ require File.dirname(__FILE__) + "/win_ffi/label"
21
+ require File.dirname(__FILE__) + "/win_ffi/list_box"
22
+ require File.dirname(__FILE__) + "/win_ffi/ms_uia/uia_dll.rb"
@@ -13,6 +13,12 @@ module RAutomation
13
13
  Functions.control_value(Functions.control_hwnd(@window.hwnd, @locators))
14
14
  end
15
15
 
16
+ def exist?
17
+ @locators[:id].nil? ? super : super && matches_type(Constants::UIA_BUTTON_CONTROL_TYPE)
18
+ end
19
+
20
+ alias_method :exists?, :exist?
21
+
16
22
  end
17
23
  end
18
24
  end
@@ -6,6 +6,13 @@ module RAutomation
6
6
  include Locators
7
7
  include ButtonHelper
8
8
 
9
+
10
+ def exist?
11
+ @locators[:id].nil? ? super : super && matches_type(Constants::UIA_CHECKBOX_CONTROL_TYPE)
12
+ end
13
+
14
+ alias_method :exists?, :exist?
15
+
9
16
  end
10
17
  end
11
18
  end