Sha256: e86c5d53c1fbfba1ad1579c20578516d35de616c28578b6054a4589011a27eb5

Contents?: true

Size: 1.37 KB

Versions: 3

Compression:

Stored size: 1.37 KB

Contents

#pragma once
#include "AutomationControl.h"
#include "AutomationClicker.h"
#include "StringHelper.h"

using namespace System::Windows::Automation;

ref class AutomatedSelectList : public AutomationControl
{
public:
	AutomatedSelectList(const HWND windowHandle);
	AutomatedSelectList(const FindInformation& findInformation);
	bool SelectByIndex(const int whichItem);
	bool SelectByValue(const char* whichItem);
	bool GetValueByIndex(const int whichItem, char* comboValue, const int comboValueSize);
  int GetOptions(const char* options[]);

  property array<String^>^ Selection {
    array<String^>^ get();
  }

	property int Count {
		int get() { return SelectionItems->Count; }
	}

	property int SelectedIndex {
		int get();
	}

private:
	void Select(AutomationElement^ itemToSelect);

	property SelectionPattern^ AsSelectionPattern {
		SelectionPattern^ get() {
			return dynamic_cast<SelectionPattern^>(_control->GetCurrentPattern(SelectionPattern::Pattern));
		}
	}

	property AutomationElementCollection^ SelectionItems {
	  AutomationElementCollection^ get() { return _control->FindAll(System::Windows::Automation::TreeScope::Subtree, SelectionCondition); }
	}

	property PropertyCondition^ SelectionCondition {
	  PropertyCondition^ get() { return gcnew PropertyCondition(AutomationElement::IsSelectionItemPatternAvailableProperty, true); }
	}
};

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rautomation-0.10.0 ext/UiaDll/UiaDll/AutomatedSelectList.h
rautomation-0.9.4 ext/UiaDll/UiaDll/AutomatedSelectList.h
rautomation-0.9.3 ext/UiaDll/UiaDll/AutomatedSelectList.h