rautomation 0.4.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. data/History.rdoc +16 -1
  2. data/LICENSE +1 -1
  3. data/README.rdoc +25 -7
  4. data/Rakefile +4 -0
  5. data/VERSION +1 -1
  6. data/ext/IAccessibleDLL/IAccessibleDLL.sln +20 -0
  7. data/ext/IAccessibleDLL/IAccessibleDLL.suo +0 -0
  8. data/ext/IAccessibleDLL/IAccessibleDLL/IAccessibleDLL.cpp +36 -0
  9. data/ext/IAccessibleDLL/IAccessibleDLL/IAccessibleDLL.vcxproj +100 -0
  10. data/ext/IAccessibleDLL/IAccessibleDLL/IAccessibleDLL.vcxproj.filters +39 -0
  11. data/ext/IAccessibleDLL/IAccessibleDLL/IAccessibleDLL.vcxproj.user +3 -0
  12. data/ext/IAccessibleDLL/IAccessibleDLL/ReadMe.txt +48 -0
  13. data/ext/IAccessibleDLL/IAccessibleDLL/dllmain.cpp +19 -0
  14. data/ext/IAccessibleDLL/IAccessibleDLL/stdafx.cpp +8 -0
  15. data/ext/IAccessibleDLL/IAccessibleDLL/stdafx.h +16 -0
  16. data/ext/IAccessibleDLL/IAccessibleDLL/targetver.h +8 -0
  17. data/ext/IAccessibleDLL/Release/IAccessibleDLL.dll +0 -0
  18. data/ext/IAccessibleDLL/Release/IAccessibleDLL.exp +0 -0
  19. data/ext/IAccessibleDLL/Release/IAccessibleDLL.lib +0 -0
  20. data/ext/WindowsForms/bin/WindowsForms.exe +0 -0
  21. data/ext/WindowsForms/src/WindowsForms/WindowsForms.sln +20 -0
  22. data/ext/WindowsForms/src/WindowsForms/WindowsForms.suo +0 -0
  23. data/ext/WindowsForms/src/WindowsForms/WindowsForms/AboutBox.Designer.cs +80 -0
  24. data/ext/WindowsForms/src/WindowsForms/WindowsForms/AboutBox.cs +103 -0
  25. data/ext/WindowsForms/src/WindowsForms/WindowsForms/AboutBox.resx +120 -0
  26. data/ext/WindowsForms/src/WindowsForms/WindowsForms/DataEntryForm.Designer.cs +167 -0
  27. data/ext/WindowsForms/src/WindowsForms/WindowsForms/DataEntryForm.cs +45 -0
  28. data/ext/WindowsForms/src/WindowsForms/WindowsForms/DataEntryForm.resx +120 -0
  29. data/ext/WindowsForms/src/WindowsForms/WindowsForms/MainFormWindow.Designer.cs +278 -0
  30. data/ext/WindowsForms/src/WindowsForms/WindowsForms/MainFormWindow.cs +78 -0
  31. data/ext/WindowsForms/src/WindowsForms/WindowsForms/MainFormWindow.resx +120 -0
  32. data/ext/WindowsForms/src/WindowsForms/WindowsForms/PersonForm.Designer.cs +119 -0
  33. data/ext/WindowsForms/src/WindowsForms/WindowsForms/PersonForm.cs +34 -0
  34. data/ext/WindowsForms/src/WindowsForms/WindowsForms/PersonForm.resx +120 -0
  35. data/ext/WindowsForms/src/WindowsForms/WindowsForms/Program.cs +21 -0
  36. data/ext/WindowsForms/src/WindowsForms/WindowsForms/Properties/AssemblyInfo.cs +36 -0
  37. data/ext/WindowsForms/src/WindowsForms/WindowsForms/Properties/Resources.Designer.cs +71 -0
  38. data/ext/WindowsForms/src/WindowsForms/WindowsForms/Properties/Resources.resx +117 -0
  39. data/ext/WindowsForms/src/WindowsForms/WindowsForms/Properties/Settings.Designer.cs +30 -0
  40. data/ext/WindowsForms/src/WindowsForms/WindowsForms/Properties/Settings.settings +7 -0
  41. data/ext/WindowsForms/src/WindowsForms/WindowsForms/SimpleElementsForm.Designer.cs +93 -0
  42. data/ext/WindowsForms/src/WindowsForms/WindowsForms/SimpleElementsForm.cs +19 -0
  43. data/ext/WindowsForms/src/WindowsForms/WindowsForms/SimpleElementsForm.resx +120 -0
  44. data/ext/WindowsForms/src/WindowsForms/WindowsForms/WindowsForms.csproj +123 -0
  45. data/ext/WindowsForms/src/WindowsForms/WindowsForms/bin/Debug/WindowsForms.exe +0 -0
  46. data/ext/WindowsForms/src/WindowsForms/WindowsForms/bin/Debug/WindowsForms.pdb +0 -0
  47. data/ext/WindowsForms/src/WindowsForms/WindowsForms/bin/Debug/WindowsForms.vshost.exe +0 -0
  48. data/ext/WindowsForms/src/WindowsForms/WindowsForms/bin/Debug/WindowsForms.vshost.exe.manifest +11 -0
  49. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/DesignTimeResolveAssemblyReferences.cache +0 -0
  50. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/DesignTimeResolveAssemblyReferencesInput.cache +0 -0
  51. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/GenerateResource.read.1.tlog +0 -0
  52. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/GenerateResource.write.1.tlog +0 -0
  53. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/ResolveAssemblyReference.cache +0 -0
  54. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.AboutBox.resources +0 -0
  55. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.DataEntryForm.resources +0 -0
  56. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.MainFormWindow.resources +0 -0
  57. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.PersonForm.resources +0 -0
  58. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.Properties.Resources.resources +0 -0
  59. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.SimpleElementsForm.resources +0 -0
  60. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.csproj.FileListAbsolute.txt +25 -0
  61. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.exe +0 -0
  62. data/ext/WindowsForms/src/WindowsForms/WindowsForms/obj/x86/Debug/WindowsForms.pdb +0 -0
  63. data/lib/{RAutomation.rb → rautomation.rb} +3 -1
  64. data/lib/rautomation/adapter/autoit/button.rb +7 -4
  65. data/lib/rautomation/adapter/autoit/locators.rb +4 -2
  66. data/lib/rautomation/adapter/autoit/text_field.rb +8 -5
  67. data/lib/rautomation/adapter/autoit/window.rb +23 -7
  68. data/lib/rautomation/adapter/win_ffi.rb +9 -3
  69. data/lib/rautomation/adapter/win_ffi/button.rb +3 -34
  70. data/lib/rautomation/adapter/win_ffi/button_helper.rb +24 -0
  71. data/lib/rautomation/adapter/win_ffi/checkbox.rb +12 -0
  72. data/lib/rautomation/adapter/win_ffi/constants.rb +21 -0
  73. data/lib/rautomation/adapter/win_ffi/control.rb +46 -0
  74. data/lib/rautomation/adapter/win_ffi/functions.rb +52 -1
  75. data/lib/rautomation/adapter/win_ffi/locators.rb +2 -1
  76. data/lib/rautomation/adapter/win_ffi/radio.rb +12 -0
  77. data/lib/rautomation/adapter/win_ffi/select_list.rb +64 -0
  78. data/lib/rautomation/adapter/win_ffi/table.rb +18 -0
  79. data/lib/rautomation/adapter/win_ffi/text_field.rb +4 -20
  80. data/lib/rautomation/adapter/win_ffi/window.rb +48 -10
  81. data/lib/rautomation/element_collections.rb +44 -0
  82. data/lib/rautomation/window.rb +29 -5
  83. data/spec/adapter/win_ffi/checkbox_spec.rb +29 -0
  84. data/spec/adapter/win_ffi/radio_spec.rb +21 -0
  85. data/spec/adapter/win_ffi/select_list_spec.rb +41 -0
  86. data/spec/adapter/win_ffi/table_spec.rb +20 -0
  87. data/spec/adapter/win_ffi/window_spec.rb +6 -12
  88. data/spec/button_spec.rb +28 -20
  89. data/spec/buttons_spec.rb +21 -0
  90. data/spec/spec_helper.rb +46 -37
  91. data/spec/text_field_spec.rb +11 -11
  92. data/spec/text_fields_spec.rb +22 -0
  93. data/spec/window_spec.rb +11 -19
  94. data/spec/windows_spec.rb +55 -0
  95. metadata +84 -9
  96. data/.gitignore +0 -25
  97. data/rautomation.gemspec +0 -90
  98. data/spec/test.html +0 -15
@@ -0,0 +1,45 @@
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 DataEntryForm : Form
13
+ {
14
+ public DataEntryForm()
15
+ {
16
+ InitializeComponent();
17
+ }
18
+
19
+ private void closeDataEntryFormButton_Click(object sender, EventArgs e)
20
+ {
21
+ this.Close();
22
+ }
23
+
24
+ private void addItemButton_Click(object sender, EventArgs e)
25
+ {
26
+ PersonForm personForm = new PersonForm(this);
27
+ personForm.Show();
28
+ }
29
+
30
+ public void addPerson(String personName, String dateOfBirth)
31
+ {
32
+ ListViewItem newItem = new ListViewItem(personName);
33
+ newItem.SubItems.Add(dateOfBirth);
34
+ personListView.Items.Add(newItem);
35
+ }
36
+
37
+ private void deleteItemButton_Click(object sender, EventArgs e)
38
+ {
39
+ foreach (ListViewItem item in personListView.SelectedItems)
40
+ {
41
+ personListView.Items.Remove(item);
42
+ }
43
+ }
44
+ }
45
+ }
@@ -0,0 +1,120 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <root>
3
+ <!--
4
+ Microsoft ResX Schema
5
+
6
+ Version 2.0
7
+
8
+ The primary goals of this format is to allow a simple XML format
9
+ that is mostly human readable. The generation and parsing of the
10
+ various data types are done through the TypeConverter classes
11
+ associated with the data types.
12
+
13
+ Example:
14
+
15
+ ... ado.net/XML headers & schema ...
16
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
17
+ <resheader name="version">2.0</resheader>
18
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
24
+ </data>
25
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
+ <comment>This is a comment</comment>
28
+ </data>
29
+
30
+ There are any number of "resheader" rows that contain simple
31
+ name/value pairs.
32
+
33
+ Each data row contains a name, and value. The row also contains a
34
+ type or mimetype. Type corresponds to a .NET class that support
35
+ text/value conversion through the TypeConverter architecture.
36
+ Classes that don't support this are serialized and stored with the
37
+ mimetype set.
38
+
39
+ The mimetype is used for serialized objects, and tells the
40
+ ResXResourceReader how to depersist the object. This is currently not
41
+ extensible. For a given mimetype the value must be set accordingly:
42
+
43
+ Note - application/x-microsoft.net.object.binary.base64 is the format
44
+ that the ResXResourceWriter will generate, however the reader can
45
+ read any of the formats listed below.
46
+
47
+ mimetype: application/x-microsoft.net.object.binary.base64
48
+ value : The object must be serialized with
49
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
+ : and then encoded with base64 encoding.
51
+
52
+ mimetype: application/x-microsoft.net.object.soap.base64
53
+ value : The object must be serialized with
54
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
+ : and then encoded with base64 encoding.
56
+
57
+ mimetype: application/x-microsoft.net.object.bytearray.base64
58
+ value : The object must be serialized into a byte array
59
+ : using a System.ComponentModel.TypeConverter
60
+ : and then encoded with base64 encoding.
61
+ -->
62
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
+ <xsd:element name="root" msdata:IsDataSet="true">
65
+ <xsd:complexType>
66
+ <xsd:choice maxOccurs="unbounded">
67
+ <xsd:element name="metadata">
68
+ <xsd:complexType>
69
+ <xsd:sequence>
70
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
+ </xsd:sequence>
72
+ <xsd:attribute name="name" use="required" type="xsd:string" />
73
+ <xsd:attribute name="type" type="xsd:string" />
74
+ <xsd:attribute name="mimetype" type="xsd:string" />
75
+ <xsd:attribute ref="xml:space" />
76
+ </xsd:complexType>
77
+ </xsd:element>
78
+ <xsd:element name="assembly">
79
+ <xsd:complexType>
80
+ <xsd:attribute name="alias" type="xsd:string" />
81
+ <xsd:attribute name="name" type="xsd:string" />
82
+ </xsd:complexType>
83
+ </xsd:element>
84
+ <xsd:element name="data">
85
+ <xsd:complexType>
86
+ <xsd:sequence>
87
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
+ </xsd:sequence>
90
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
+ <xsd:attribute ref="xml:space" />
94
+ </xsd:complexType>
95
+ </xsd:element>
96
+ <xsd:element name="resheader">
97
+ <xsd:complexType>
98
+ <xsd:sequence>
99
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
+ </xsd:sequence>
101
+ <xsd:attribute name="name" type="xsd:string" use="required" />
102
+ </xsd:complexType>
103
+ </xsd:element>
104
+ </xsd:choice>
105
+ </xsd:complexType>
106
+ </xsd:element>
107
+ </xsd:schema>
108
+ <resheader name="resmimetype">
109
+ <value>text/microsoft-resx</value>
110
+ </resheader>
111
+ <resheader name="version">
112
+ <value>2.0</value>
113
+ </resheader>
114
+ <resheader name="reader">
115
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
+ </resheader>
117
+ <resheader name="writer">
118
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
+ </resheader>
120
+ </root>
@@ -0,0 +1,278 @@
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
+ this.label1 = new System.Windows.Forms.Label();
32
+ this.aboutButton = new System.Windows.Forms.Button();
33
+ this.button1 = new System.Windows.Forms.Button();
34
+ this.textField = new System.Windows.Forms.TextBox();
35
+ this.checkBox = new System.Windows.Forms.CheckBox();
36
+ this.checkBoxLabel = new System.Windows.Forms.Label();
37
+ this.groupBox1 = new System.Windows.Forms.GroupBox();
38
+ this.radioButtonReset = new System.Windows.Forms.Button();
39
+ this.radioButtonLabel = new System.Windows.Forms.Label();
40
+ this.radioButton2 = new System.Windows.Forms.RadioButton();
41
+ this.radioButton1 = new System.Windows.Forms.RadioButton();
42
+ this.groupBox2 = new System.Windows.Forms.GroupBox();
43
+ this.fruitsLabel = new System.Windows.Forms.Label();
44
+ this.FruitsComboBox = new System.Windows.Forms.ComboBox();
45
+ this.nextFormButton = new System.Windows.Forms.Button();
46
+ this.label2 = new System.Windows.Forms.Label();
47
+ this.buttonButton = new System.Windows.Forms.Button();
48
+ this.groupBox1.SuspendLayout();
49
+ this.groupBox2.SuspendLayout();
50
+ this.SuspendLayout();
51
+ //
52
+ // label1
53
+ //
54
+ this.label1.AutoSize = true;
55
+ this.label1.Location = new System.Drawing.Point(139, 38);
56
+ this.label1.Name = "label1";
57
+ this.label1.Size = new System.Drawing.Size(102, 13);
58
+ this.label1.TabIndex = 0;
59
+ this.label1.Text = "This is a sample text";
60
+ this.label1.Click += new System.EventHandler(this.label1_Click);
61
+ //
62
+ // aboutButton
63
+ //
64
+ this.aboutButton.Location = new System.Drawing.Point(12, 9);
65
+ this.aboutButton.Name = "aboutButton";
66
+ this.aboutButton.Size = new System.Drawing.Size(95, 23);
67
+ this.aboutButton.TabIndex = 1;
68
+ this.aboutButton.Text = "&About";
69
+ this.aboutButton.UseVisualStyleBackColor = true;
70
+ this.aboutButton.Click += new System.EventHandler(this.aboutButton_Click);
71
+ //
72
+ // button1
73
+ //
74
+ this.button1.Location = new System.Drawing.Point(12, 96);
75
+ this.button1.Name = "button1";
76
+ this.button1.Size = new System.Drawing.Size(95, 23);
77
+ this.button1.TabIndex = 2;
78
+ this.button1.Text = "Close";
79
+ this.button1.UseVisualStyleBackColor = true;
80
+ this.button1.Click += new System.EventHandler(this.button1_Click);
81
+ //
82
+ // textField
83
+ //
84
+ this.textField.Location = new System.Drawing.Point(142, 69);
85
+ this.textField.Name = "textField";
86
+ this.textField.Size = new System.Drawing.Size(253, 20);
87
+ this.textField.TabIndex = 3;
88
+ //
89
+ // checkBox
90
+ //
91
+ this.checkBox.AutoSize = true;
92
+ this.checkBox.Location = new System.Drawing.Point(142, 105);
93
+ this.checkBox.Name = "checkBox";
94
+ this.checkBox.Size = new System.Drawing.Size(74, 17);
95
+ this.checkBox.TabIndex = 4;
96
+ this.checkBox.Text = "checkBox";
97
+ this.checkBox.UseVisualStyleBackColor = true;
98
+ this.checkBox.CheckedChanged += new System.EventHandler(this.checkBox_CheckedChanged);
99
+ //
100
+ // checkBoxLabel
101
+ //
102
+ this.checkBoxLabel.AutoSize = true;
103
+ this.checkBoxLabel.Location = new System.Drawing.Point(246, 106);
104
+ this.checkBoxLabel.Name = "checkBoxLabel";
105
+ this.checkBoxLabel.Size = new System.Drawing.Size(80, 13);
106
+ this.checkBoxLabel.TabIndex = 5;
107
+ this.checkBoxLabel.Text = "checkBox is off";
108
+ //
109
+ // groupBox1
110
+ //
111
+ this.groupBox1.Controls.Add(this.radioButtonReset);
112
+ this.groupBox1.Controls.Add(this.radioButtonLabel);
113
+ this.groupBox1.Controls.Add(this.radioButton2);
114
+ this.groupBox1.Controls.Add(this.radioButton1);
115
+ this.groupBox1.Location = new System.Drawing.Point(142, 136);
116
+ this.groupBox1.Name = "groupBox1";
117
+ this.groupBox1.Size = new System.Drawing.Size(234, 89);
118
+ this.groupBox1.TabIndex = 6;
119
+ this.groupBox1.TabStop = false;
120
+ this.groupBox1.Text = "Groupd of radio buttons";
121
+ //
122
+ // radioButtonReset
123
+ //
124
+ this.radioButtonReset.Location = new System.Drawing.Point(143, 56);
125
+ this.radioButtonReset.Name = "radioButtonReset";
126
+ this.radioButtonReset.Size = new System.Drawing.Size(75, 23);
127
+ this.radioButtonReset.TabIndex = 3;
128
+ this.radioButtonReset.Text = "Reset";
129
+ this.radioButtonReset.UseVisualStyleBackColor = true;
130
+ this.radioButtonReset.Click += new System.EventHandler(this.radioButtonReset_Click);
131
+ //
132
+ // radioButtonLabel
133
+ //
134
+ this.radioButtonLabel.AutoSize = true;
135
+ this.radioButtonLabel.Location = new System.Drawing.Point(6, 61);
136
+ this.radioButtonLabel.Name = "radioButtonLabel";
137
+ this.radioButtonLabel.Size = new System.Drawing.Size(96, 13);
138
+ this.radioButtonLabel.TabIndex = 2;
139
+ this.radioButtonLabel.Text = "No option selected";
140
+ //
141
+ // radioButton2
142
+ //
143
+ this.radioButton2.AutoSize = true;
144
+ this.radioButton2.Location = new System.Drawing.Point(107, 28);
145
+ this.radioButton2.Name = "radioButton2";
146
+ this.radioButton2.Size = new System.Drawing.Size(65, 17);
147
+ this.radioButton2.TabIndex = 1;
148
+ this.radioButton2.TabStop = true;
149
+ this.radioButton2.Text = "Option 2";
150
+ this.radioButton2.UseVisualStyleBackColor = true;
151
+ this.radioButton2.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged);
152
+ //
153
+ // radioButton1
154
+ //
155
+ this.radioButton1.AutoSize = true;
156
+ this.radioButton1.Location = new System.Drawing.Point(9, 28);
157
+ this.radioButton1.Name = "radioButton1";
158
+ this.radioButton1.Size = new System.Drawing.Size(65, 17);
159
+ this.radioButton1.TabIndex = 0;
160
+ this.radioButton1.TabStop = true;
161
+ this.radioButton1.Text = "Option 1";
162
+ this.radioButton1.UseVisualStyleBackColor = true;
163
+ this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
164
+ //
165
+ // groupBox2
166
+ //
167
+ this.groupBox2.Controls.Add(this.fruitsLabel);
168
+ this.groupBox2.Controls.Add(this.FruitsComboBox);
169
+ this.groupBox2.Location = new System.Drawing.Point(142, 231);
170
+ this.groupBox2.Name = "groupBox2";
171
+ this.groupBox2.Size = new System.Drawing.Size(325, 63);
172
+ this.groupBox2.TabIndex = 7;
173
+ this.groupBox2.TabStop = false;
174
+ this.groupBox2.Text = "Drop down list";
175
+ //
176
+ // fruitsLabel
177
+ //
178
+ this.fruitsLabel.AutoSize = true;
179
+ this.fruitsLabel.Location = new System.Drawing.Point(133, 30);
180
+ this.fruitsLabel.Name = "fruitsLabel";
181
+ this.fruitsLabel.Size = new System.Drawing.Size(35, 13);
182
+ this.fruitsLabel.TabIndex = 1;
183
+ this.fruitsLabel.Text = "label2";
184
+ //
185
+ // FruitsComboBox
186
+ //
187
+ this.FruitsComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
188
+ this.FruitsComboBox.FormattingEnabled = true;
189
+ this.FruitsComboBox.Items.AddRange(new object[] {
190
+ "Apple",
191
+ "Caimito",
192
+ "Coconut",
193
+ "Orange",
194
+ "Passion Fruit"});
195
+ this.FruitsComboBox.Location = new System.Drawing.Point(6, 27);
196
+ this.FruitsComboBox.Name = "FruitsComboBox";
197
+ this.FruitsComboBox.Size = new System.Drawing.Size(121, 21);
198
+ this.FruitsComboBox.TabIndex = 0;
199
+ this.FruitsComboBox.SelectedIndexChanged += new System.EventHandler(this.FruitsComboBox_SelectedIndexChanged);
200
+ //
201
+ // nextFormButton
202
+ //
203
+ this.nextFormButton.Location = new System.Drawing.Point(12, 38);
204
+ this.nextFormButton.Name = "nextFormButton";
205
+ this.nextFormButton.Size = new System.Drawing.Size(95, 23);
206
+ this.nextFormButton.TabIndex = 8;
207
+ this.nextFormButton.Text = "Data Entry Form";
208
+ this.nextFormButton.UseVisualStyleBackColor = true;
209
+ this.nextFormButton.Click += new System.EventHandler(this.nextFormButton_Click);
210
+ //
211
+ // label2
212
+ //
213
+ this.label2.AutoSize = true;
214
+ this.label2.Location = new System.Drawing.Point(139, 14);
215
+ this.label2.Name = "label2";
216
+ this.label2.Size = new System.Drawing.Size(108, 13);
217
+ this.label2.TabIndex = 9;
218
+ this.label2.Text = "Assorted UI Elements";
219
+ //
220
+ // buttonButton
221
+ //
222
+ this.buttonButton.Location = new System.Drawing.Point(12, 67);
223
+ this.buttonButton.Name = "buttonButton";
224
+ this.buttonButton.Size = new System.Drawing.Size(95, 23);
225
+ this.buttonButton.TabIndex = 10;
226
+ this.buttonButton.Text = "Simple Elements";
227
+ this.buttonButton.UseVisualStyleBackColor = true;
228
+ this.buttonButton.Click += new System.EventHandler(this.buttonButton_Click);
229
+ //
230
+ // MainFormWindow
231
+ //
232
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
233
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
234
+ this.ClientSize = new System.Drawing.Size(724, 474);
235
+ this.Controls.Add(this.buttonButton);
236
+ this.Controls.Add(this.label2);
237
+ this.Controls.Add(this.nextFormButton);
238
+ this.Controls.Add(this.groupBox2);
239
+ this.Controls.Add(this.groupBox1);
240
+ this.Controls.Add(this.checkBoxLabel);
241
+ this.Controls.Add(this.checkBox);
242
+ this.Controls.Add(this.textField);
243
+ this.Controls.Add(this.button1);
244
+ this.Controls.Add(this.aboutButton);
245
+ this.Controls.Add(this.label1);
246
+ this.Name = "MainFormWindow";
247
+ this.Text = "MainFormWindow";
248
+ this.groupBox1.ResumeLayout(false);
249
+ this.groupBox1.PerformLayout();
250
+ this.groupBox2.ResumeLayout(false);
251
+ this.groupBox2.PerformLayout();
252
+ this.ResumeLayout(false);
253
+ this.PerformLayout();
254
+
255
+ }
256
+
257
+ #endregion
258
+
259
+ private System.Windows.Forms.Label label1;
260
+ private System.Windows.Forms.Button aboutButton;
261
+ private System.Windows.Forms.Button button1;
262
+ private System.Windows.Forms.TextBox textField;
263
+ private System.Windows.Forms.CheckBox checkBox;
264
+ private System.Windows.Forms.Label checkBoxLabel;
265
+ private System.Windows.Forms.GroupBox groupBox1;
266
+ private System.Windows.Forms.Label radioButtonLabel;
267
+ private System.Windows.Forms.RadioButton radioButton2;
268
+ private System.Windows.Forms.RadioButton radioButton1;
269
+ private System.Windows.Forms.Button radioButtonReset;
270
+ private System.Windows.Forms.GroupBox groupBox2;
271
+ private System.Windows.Forms.ComboBox FruitsComboBox;
272
+ private System.Windows.Forms.Label fruitsLabel;
273
+ private System.Windows.Forms.Button nextFormButton;
274
+ private System.Windows.Forms.Label label2;
275
+ private System.Windows.Forms.Button buttonButton;
276
+ }
277
+ }
278
+
@@ -0,0 +1,78 @@
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();
75
+ }
76
+
77
+ }
78
+ }