Hi Kathryn,
Explain why the vista.TcxPopupEditPopupWindow.TcxGrid object is at a higher level than the drop-down? |
This behavior is programmed by the tested application developers.
and why it says it's a grid object when it really isn't? |
Developers gave the TcxGrid class name to the control. It is equal to QuantumGrid's class name, and TC recognizes it as a grid.
and how to look at the properties, methods, etc, of this object when they only display when the drop-down is activated |
Open the Object Properties window (see the "Object Properties Window" help topic), select "Select Object with Cursor", move your mouse over your control and once it is obtained by TC, press the shortcut (Tools | Options | Global | Global Shortcuts | Fix information) to fix the information.
First of all, make sure your application is compilled with debug info (see the "Debug Info Agent" help topic).
Here is a sample script:
Sub Main
Dim wCombo, rowId, strCol
Set wCombo = <Path_To_Your_Combo_Box(FullName property value)>
rowId = <Row_Number>
strCol = "<Column>"
If clickItem(wCombo, rowId, strCol) Then
Log.Message "The [" & rowId & ", '" & strCol & "'] cell was successfully clicked."
End If
End Sub
Function clickItem(wCombo, rowId, strCol)
Dim p, wDropDown, rowCount, colCount, colId, bounds
Log.LockEvents(1)
Call wCombo.Click(wCombo.Width - wCombo.Height / 2, wCombo.Height / 2)
Set p = getProcess(wCombo)
Set wDropDown = <Path_To_Drop_Down_Form(FullName)>
rowCount = wDropDown.ViewInfo.Rows.Count
If rowId < 0 Or rowId > rowCount - 1 Then
Log.Error "Wrong row index."
clickItem = False
Exit Function
End If
colCount = wDropDown.ViewInfo.Rows.Items(rowId).Count
colId = getColIdByName(wDropDown, strCol)
If colId = -1 Then
Log.Error "Wrong column name."
clickItem = False
Exit Function
End If
Set bounds = wDropDown.ViewInfo.Rows.Items(rowId).Items(colId).Bounds
Call wDropDown.Click((bounds.Left + bounds.Right) / 2, (bounds.Top + bounds.Bottom) / 2)
Log.UnlockEvents
Log.Event "The [" & rowId & ", '" & strCol & "'] cell was clicked."
clickItem = True
End Function
Function getProcess(obj)
Do While Not IsSupported(obj, "ProcessName")
Set obj = obj.Parent
Loop
Set getProcess = obj
End Function
Function getColIdByName(wDropDown, strCol)
Dim colId, colCount, colObj
colCount = wDropDown.ViewInfo.Columns.Count
For colId = 0 To colCount - 1
Set colObj = wDropDown.ViewInfo.Columns.Items(colId)
If SameText(colObj.Text, strCol) Then
getColIdByName = colId
Exit Function
End If
Next
getColIdByName = -1
End Function
If it does not work for you, let us know the name, vendor and version of your combo box control.