Delphi VCL Object TStatusBar and TVirtualStringTree TChart
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-04-2010
07:36 PM
02-04-2010
07:36 PM
Delphi VCL Object TStatusBar and TVirtualStringTree TChart
Hi,
I would like to know how to get the information displayed on a TVirtualStringTree.
I can see only the number of RootNodeCount, but how to get the element displayed.
Same question on the TStatusBar. I can see the number of element wPartCount, but
when i try to acces the element using wText(n), i cannot get the text displayed.
Same question on TChart object.
Regards.
I would like to know how to get the information displayed on a TVirtualStringTree.
I can see only the number of RootNodeCount, but how to get the element displayed.
Same question on the TStatusBar. I can see the number of element wPartCount, but
when i try to acces the element using wText(n), i cannot get the text displayed.
Same question on TChart object.
Regards.
10 REPLIES 10
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2010
03:08 AM
02-10-2010
03:08 AM
Hi Karim,
- TVirtualStringTree
To work with this control, you need to use the Object Mapping feature of TestComplete. Please follow the steps below:
1. Double-click your project node in the Project Explorer panel.
2. Switch to the Properties tab in the project editor.
3. Select the Object Mapping section of the project properties.
4. Expand the "Win32 Controls and Windows" node.
5. Select the Tree view item.
6. Click the "Add Class Name" button.
7. Type "TVirtualStringTree" to make TestComplete treat controls of the TVirtualStringTree class as standard TreeView controls.
After that, TestComplete will be able to record high-level tests with TVirtualStringTree controls.
- TStatusBar
Probably, the items of the problematic status bar are owner-drawn. In this case, you can try obtaining the text displayed in these owner-drawn items by using the panels collection returned by the Panels native property of status bar objects. Use native methods and properties of items from this collection to get information on them.
- TChart
Currently, this control is not supported by TestComplete. However, you can work with the control's data by using its native Series property. You can find more information on the Series property in the Delphi IDE help system.
Please note that, to make TestComplete be able to access native properties of Delphi applications, you need to include debug information in your application (see the Using Debug Info Agent With Delphi Applications help topic).
Let me know if you have additional questions.
- TVirtualStringTree
To work with this control, you need to use the Object Mapping feature of TestComplete. Please follow the steps below:
1. Double-click your project node in the Project Explorer panel.
2. Switch to the Properties tab in the project editor.
3. Select the Object Mapping section of the project properties.
4. Expand the "Win32 Controls and Windows" node.
5. Select the Tree view item.
6. Click the "Add Class Name" button.
7. Type "TVirtualStringTree" to make TestComplete treat controls of the TVirtualStringTree class as standard TreeView controls.
After that, TestComplete will be able to record high-level tests with TVirtualStringTree controls.
- TStatusBar
Probably, the items of the problematic status bar are owner-drawn. In this case, you can try obtaining the text displayed in these owner-drawn items by using the panels collection returned by the Panels native property of status bar objects. Use native methods and properties of items from this collection to get information on them.
- TChart
Currently, this control is not supported by TestComplete. However, you can work with the control's data by using its native Series property. You can find more information on the Series property in the Delphi IDE help system.
Please note that, to make TestComplete be able to access native properties of Delphi applications, you need to include debug information in your application (see the Using Debug Info Agent With Delphi Applications help topic).
Let me know if you have additional questions.
--
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2010
03:30 AM
06-24-2010
03:30 AM
Hi Karim,
Did you manage to work with TVirtualStringTree object?? After following the steps provided by david, i can get the name of each individual node item. But i can not perform Select, Expand and Collapse actions on the node Items.
I appreciate any suggestions.
Many thanks,
Veeresh Kumar
Did you manage to work with TVirtualStringTree object?? After following the steps provided by david, i can get the name of each individual node item. But i can not perform Select, Expand and Collapse actions on the node Items.
I appreciate any suggestions.
Many thanks,
Veeresh Kumar
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2010
01:53 AM
06-29-2010
01:53 AM
Hi Karim,
Here is a sample script that demonstrates how to expand the TVirtualStringTree object's nodes:
Sub Main
' This script works with the "<vt contributions>\Examples\Delphi\Minimal\Minimal.exe" sample.
' Before executing the script, add four nodes to the tree making the next node a child of the previous one.
Dim p, wMain, wTree, strItem
Set p = Sys.Process("Minimal")
Set wMain = p.VCLObject("MainForm")
Set wTree = wMain.VCLObject("VST")
strItem = "Level 0, Index 0|Level 1, Index 0|Level 2, Index 0|Level 3, Index 0|Level 4, Index 0"
If clickNode(wTree, strItem) Then
Log.Message "The '" & strItem & "' node was successfully clicked."
End If
End Sub
Function clickNode(wTree, strItem)
Dim tempRes
wTree.FullCollapse(wTree.RootNode)
wTree.ClearSelection
wTree.SetFocusedNode(wTree.RootNode)
Log.LockEvents(1)
tempRes = dblClickNode(wTree, strItem)
Log.UnlockEvents
clickNode = tempRes
If tempRes Then
Log.Event "The '" & strItem & "' node was clicked."
Else
Log.Error "The '" & strItem & "' node was not found."
End If
End Function
Function dblClickNode(wTree, strItem)
Dim wSelected, arrayItem, itemCount, itemId, item
dblClickNode = False
If Len(strItem)= 0 Then
dblClickNode = True
Exit Function
End If
wSelected = wTree.wSelection
arrayItem = Split(strItem, "|")
itemCount = wTree.wItemCount
For itemId = 0 To itemCount - 1
item = wTree.wItem(itemId)
If SameText(item, arrayItem(0)) Then
Call wTree.DblClickItem(wSelected & "|" & arrayItem(0))
arrayItem(0) = ""
dblClickNode = dblClickNode(wTree, Replace(Join(arrayItem, "|"), "|", "", 1, 1))
Exit Function
End If
Next
End Function
--
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2011
11:57 PM
01-20-2011
11:57 PM
Do you have something like this for Delphi?
We have a VirtualStringTree with a dynamical number of nodes. All nodes are Level1 children of the root.
We want to get a specific item (by its name or another property). Its position in the tree can change at every start of the process.
Methods like "GetFirst", "Get Next" or "GetNodeData" are not available for the mapped object in TestComplete.
We have a VirtualStringTree with a dynamical number of nodes. All nodes are Level1 children of the root.
We want to get a specific item (by its name or another property). Its position in the tree can change at every start of the process.
Methods like "GetFirst", "Get Next" or "GetNodeData" are not available for the mapped object in TestComplete.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2011
01:38 AM
01-26-2011
01:38 AM
Hi Sven,
Please continue working via e-mail with Brian.
--
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2011
09:40 PM
06-23-2011
09:40 PM
Has anyone found a solution to this'TvirtualTree' object.
Valentine C. Obodoechi
http://www.targit.com/
http://www.targit.com/
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2011
09:40 PM
06-23-2011
09:40 PM
Has anyone found a solution to this'TVirtualStringTree' object.
Valentine C. Obodoechi
http://www.targit.com/
http://www.targit.com/
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2011
08:42 PM
07-03-2011
08:42 PM
Hi Valentine,
Can you describe the issue you're having in detail? If you mean this:
Methods like "GetFirst", "Get Next" or "GetNodeData" are not available for the mapped object in TestComplete.
the issue was that Sven addressed a wrong Aliases object in a script.
--
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2011
09:11 PM
07-03-2011
09:11 PM
This is not what I mean.
we have a 'TVirtualStringTree' object which is populated at runtime.
we have a 'TVirtualStringTree' object which is populated at runtime.
- The tree then has Items, which in turn can have sub-tree items
- The property'wItemCount' is 23 as well as the 'wRootItemCount for instance.
- But when i try to access the 'wItem' property of a specific item or the 'wItems' the application crashes.
- How do I access these elelments?
Valentine C. Obodoechi
http://www.targit.com/
http://www.targit.com/
