Sha256: 3d2be1530c6f51cd6384c77c794653538d27203487efca52394f713c7a711323

Contents?: true

Size: 985 Bytes

Versions: 12

Compression:

Stored size: 985 Bytes

Contents

module RAutomation
  module Adapter
    module MsUia

      class ListBox < Control
        include WaitHelper
        include Locators

        def count
          UiaDll::select_list_count search_information
        end

        def items
          UiaDll::table_values(search_information).map do |list_item|
            @window.list_item(:value => list_item)
          end
        end

        def strings
          UiaDll::table_values(search_information)
        end

        def value
          UiaDll::selection search_information
        end

        def exist?
          super && matches_type?(Constants::UIA_LIST_CONTROL_TYPE)
        end

        alias_method :exists?, :exist?

        def selected?(index)
          item = items[index]
          return item && item.selected?
        end

        def select(index)
          UiaDll::select_list_select_index search_information, index
        end

      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rautomation-2.0.1-x86-mingw32 lib/rautomation/adapter/ms_uia/list_box.rb
rautomation-2.0.1-x64-mingw32 lib/rautomation/adapter/ms_uia/list_box.rb
rautomation-1.1.0 lib/rautomation/adapter/ms_uia/list_box.rb
rautomation-1.0.0 lib/rautomation/adapter/ms_uia/list_box.rb
rautomation-0.17.0 lib/rautomation/adapter/ms_uia/list_box.rb
rautomation-0.16.0 lib/rautomation/adapter/ms_uia/list_box.rb
rautomation-0.15.0 lib/rautomation/adapter/ms_uia/list_box.rb
rautomation-0.14.1 lib/rautomation/adapter/ms_uia/list_box.rb
rautomation-0.14.0 lib/rautomation/adapter/ms_uia/list_box.rb
rautomation-0.13.0 lib/rautomation/adapter/ms_uia/list_box.rb
rautomation-0.12.0 lib/rautomation/adapter/ms_uia/list_box.rb
rautomation-0.11.0 lib/rautomation/adapter/ms_uia/list_box.rb