This event signifies a mouse click on the source component. A mouse click the combination of a mouse press and a mouse release, both of which must have occurred over the source component. Note that this event fires after the pressed and released events have fired.
.source | The component that fired this event |
.button | The code for the button that caused this event to fire. |
.clickCount | The number of mouse clicks associated with this event. |
.x | The x-coordinate (with respect to the source component) of this mouse event. |
.y | The y-coordinate (with respect to the source component) of this mouse event. |
.popupTrigger | Returns True (1) if this mouse event is a popup trigger. What constitutes a popup trigger is operating system dependent, which is why this abstraction exists. |
.altDown | True (1) if the Alt key was held down during this event, false (0) otherwise. |
.controlDown | True (1) if the Control key was held down during this event, false (0) otherwise. |
.shiftDown | True (1) if the Shift key was held down during this event, false (0) otherwise. |
2 Comments
Anonymous
There is no examples... :
Anonymous
Don't know how to format this well, but this code will work.
#get the current dataset from the tree view object
tvItems = event.source.parent.getComponent('Tree View').data
#convert it to a pydataset so we can iterate through it
pyDS = system.dataset.toPyDataSet(tvItems)
#delete the existing rows
for node in pyDS:
print node[0]
tvItems = system.dataset.deleteRow(tvItems,0)
#go get the tags to build the tree with, look for a specific tag string match, get tags in subfolders, and sort them ascending
tags = system.tag.browseTags("Folder1/Folder2/Folder3",tagPath="*DCI*",recursive="True",sort="ASC")
#iterate through the tags and add them to the treeview
#tag paths are split up so we can build the treeview with only the info we want in the node hierarchy
for tag in tags:
#print tag.path
t = tag.path.split('/')
path = t[2]+"/"+t[3]
if len(t)>4:
text = t[4]
#add details to the colums that define the properties and behaviour of the node, or just define the path and text
tvItems = system.dataset.addRow(tvItems,[path,text,"","","","","","","","","","",""])
#assign the new dataset to the component data property
event.source.parent.getComponent('Tree View').data = tvItems