uia 0.3 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,4 +1,8 @@
1
- === Version 0.3 /2014-05-06
1
+ === Version 0.3.1 / 2014-05-07
2
+ * Enhancements
3
+ * added Table#row_at method
4
+
5
+ === Version 0.3 / 2014-05-06
2
6
  * Enhancements
3
7
  * added the ability to list more than one pattern to search for
4
8
 
@@ -24,4 +24,14 @@ extern "C" {
24
24
  return 0;
25
25
  }
26
26
  }
27
+
28
+ __declspec(dllexport) ElementInformationPtr Table_Row(ElementInformationPtr element, const int index, char* errorInfo, const int errorInfoLength) {
29
+ try {
30
+ auto table = ElementFrom(element);
31
+ return ElementInformation::From(table->Find(TreeScope::Children, gcnew PropertyCondition(AutomationElement::ControlTypeProperty, ControlType::DataItem))[index]);
32
+ } catch(Exception^ e) {
33
+ StringHelper::CopyToUnmanagedString(e->Message, errorInfo, errorInfoLength);
34
+ return NULL;
35
+ }
36
+ }
27
37
  }
@@ -133,6 +133,7 @@ module Uia
133
133
 
134
134
  # TablePattern methods
135
135
  attach_throwable_function :table_info, :Table_Information, [:pointer], TableInformation.by_ref
136
+ attach_throwable_function :table_row, :Table_Row, [:pointer, :int], ManagedElementStruct.by_ref, &element_or_nil
136
137
  elements_from :table_headers, :Table_Headers, [:pointer]
137
138
 
138
139
  # TableItemPattern methods
@@ -19,6 +19,10 @@ module Uia
19
19
  Library.table_headers @element
20
20
  end
21
21
 
22
+ def row_at(index)
23
+ Library.table_row(@element, index).extend Row
24
+ end
25
+
22
26
  def rows
23
27
  find_all(control_type: :data_item).each { |e| e.extend Row }
24
28
  end
@@ -1,3 +1,3 @@
1
1
  module Uia
2
- VERSION = '0.3'
2
+ VERSION = '0.3.1'
3
3
  end
@@ -31,4 +31,8 @@ describe Uia::Patterns::Table do
31
31
  end
32
32
  end
33
33
  end
34
+
35
+ context '#row_at' do
36
+ Then { data_grid.row_at(1).items[1].name == '3/4/1975'}
37
+ end
34
38
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uia
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: 0.3.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-06 00:00:00.000000000 Z
12
+ date: 2014-05-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi
@@ -257,7 +257,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
257
257
  version: '0'
258
258
  segments:
259
259
  - 0
260
- hash: 914295965
260
+ hash: 471307667
261
261
  required_rubygems_version: !ruby/object:Gem::Requirement
262
262
  none: false
263
263
  requirements:
@@ -266,7 +266,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
266
266
  version: '0'
267
267
  segments:
268
268
  - 0
269
- hash: 914295965
269
+ hash: 471307667
270
270
  requirements: []
271
271
  rubyforge_project:
272
272
  rubygems_version: 1.8.28