상속: IElement
예제 #1
0
		public TextEventHandler (Element element)
		{
			this.element = element;

			element.accessible.ObjectEvents.TextChanged += OnTextChanged;
			element.accessible.ObjectEvents.TextSelectionChanged += OnTextSelectionChanged;
		}
예제 #2
0
		public ValueEventHandler (Element element)
		{
			this.element = element;

			currentValue = Text.GetText ();
			element.accessible.ObjectEvents.TextChanged += OnTextChanged;
		}
예제 #3
0
		public SelectionEventHandler (Element element, SelectionSource source)
		{
			this.source = source;
			this.element = element;

			oldSelection = source.GetSelection ();
			element.accessible.ObjectEvents.SelectionChanged += OnSelectionChanged;
		}
예제 #4
0
		public GridEventHandler (Element element)
		{
			this.element = element;

			element.accessible.ObjectEvents.RowInserted += OnRowInserted;
			element.accessible.ObjectEvents.RowDeleted += OnRowDeleted;
			element.accessible.ObjectEvents.ColumnInserted += OnColumnInserted;
			element.accessible.ObjectEvents.ColumnDeleted += OnColumnDeleted;
		}
예제 #5
0
		public RangeValueEventHandler (Element element)
		{
			this.element = element;
			try {
				currentValue = Value.CurrentValue;
			} catch (Exception) { }

			element.accessible.ObjectEvents.PropertyChange += OnPropertyChange;
		}
예제 #6
0
		public ExpandCollapseSource (Element element)
		{
			accessible = (element is DataItemElement
				? ((Element)element.FirstChild).Accessible
			: element.Accessible);
			action = accessible.QueryAction ();

			ActionDescription [] actions = action.Actions;
			for (int i = 0; i < actions.Length; i++) {
				if (actions [i].Name == "expand or contract" ||
					actions [i].Name == "expand or collapse") {
					expandOrContractAction = i;
					break;
				}
			}
		}
예제 #7
0
		public IElement [] GetColumnHeaderItems ()
		{
			// TODO: would be nice if at-spi made this easier
			Accessible accessible = table.GetColumnHeader (0);
			// If that returned null, then maybe we have no
			// headers, so not going to query every single row
			if (accessible == null)
				return new Element [0];
			int count = table.NColumns;
			Element [] elements = new Element [count];
			elements [0] = Element.GetElement (accessible);
			for (int i = 1; i < count; i++) {
				accessible = table.GetColumnHeader (i);
				if (accessible != null)
					elements [i] = Element.GetElement (accessible);
			}
			return elements;
		}
예제 #8
0
파일: Element.cs 프로젝트: mono/uia2atk
		internal static Element GetElement (Accessible accessible, bool create)
		{
			if (accessible == null)
				return null;
			// We expose the children of Applications as top-level,
			// to be more like UIA
			if (accessible.Role == Role.Application)
				return null;
			if (elements.ContainsKey (accessible))
			return elements [accessible];
			if (!create)
				return null;
			Element element;
			if (IsTable (accessible))
				element = new TableElement (accessible);
			else if (IsTableHeaderItem (accessible))
				element = new TableHeaderItemElement (accessible);
			else if (IsTreeItem (accessible))
				element = new TreeItemElement (accessible);
			else
				element = new Element (accessible);
			return element;
		}
예제 #9
0
파일: Element.cs 프로젝트: mono/uia2atk
		public Element (Accessible accessible)
		{
			extraChildren = new List<Element> ();
			if (!elements.ContainsKey (accessible))
				elements [accessible] = this;
			patterns = new List<ISourceEventHandler> ();
			this.accessible = accessible;
			runtimeId = -1;

			if (accessible.Role == Role.Dialog &&
				accessible.Parent.Role == Role.Application &&
				accessible.QueryComponent () != null) {
				// Try to figure out if the dialog is painted
				// on top of another window
				BoundingBox curExtents = accessible.QueryComponent ().GetExtents (CoordType.Screen);
				int count = accessible.Parent.Children.Count;
				for (int i = 0; i < count; i++) {
					Accessible child = accessible.Parent.Children [i];
					if (child == null ||
						child.Role != Role.Frame)
						continue;
					Component childComponent = child.QueryComponent ();
					if (childComponent == null)
						continue;
					BoundingBox windowExtents = childComponent.GetExtents (CoordType.Screen);
					if (windowExtents.X <= curExtents.X &&
						windowExtents.Y <= curExtents.Y &&
						(windowExtents.X + windowExtents.Width) > curExtents.X &&
						(windowExtents.Y + windowExtents.Height) > curExtents.Y) {
						parent = GetElement (child);
						parent.extraChildren.Add (this);
						break;
					}
				}
			}
			if (parent == null)
				parent = GetElement (accessible.Parent);
			AddEvents (true);
		}
예제 #10
0
파일: TextSource.cs 프로젝트: mono/uia2atk
		public TextSource (Element element)
		{
			accessible = element.Accessible;
			text = accessible.QueryText ();
		}
예제 #11
0
		public SelectionItemSource (Element element)
		{
			accessible = element.Accessible;
		}
예제 #12
0
		public ToggleSource (Element element)
		{
			accessible = element.Accessible;
			action = accessible.QueryAction ();
		}
예제 #13
0
		public TableItemSource (Element element) : base (element)
		{
		}
예제 #14
0
파일: ValueSource.cs 프로젝트: mono/uia2atk
		public ValueSource (Element element)
		{
			accessible = element.Accessible;
			text = accessible.QueryText ();
			editableText = accessible.QueryEditableText ();
		}
예제 #15
0
		public RangeValueSource (Element element)
		{
			accessible = element.Accessible;
		}
예제 #16
0
		public GridItemSource (Element element)
		{
			accessible = element.Accessible;
			table = accessible.Parent.QueryTable ();
		}