7. Working with List Views and Tree Views : Listview Fields : Listview Field Events
 
Share this page                  
Listview Field Events
Several useful events are associated with listview fields. The script for listview_example illustrates how you can use them. The script also shows how you can resize a listview field on a WindowResized event.
If you run OpenROAD Workbench with the trace window enabled, the listview_examples frame posts messages to the trace window when one of the following events occurs:
Click
DoubleClick
HeaderClick
SetValue
The messages in the trace window display the order in which events are generated. These are:
Click and DoubleClick Event
The first click causes a SetValue event. A DoubleClick event occurs when the user double-clicks the text in the first column or on the associated bitmap. The second click, if done quickly, causes a DoubleClick event. In listview_examples, a message is displayed in the frame's status bar when a DoubleClick event occurs. You might use the DoubleClick event to do something such as updating another frame.
Note:  You may lose a DoubleClick event if too much time is spent processing the preceding SetValue event.
HeaderClick Event
Occurs when the user clicks one of the column headers of the listview field when the style is LVFS_DETAIL. The ReasonCode attribute of the FrameExec contains the number of the column. In the listview_example, the listview data is sorted on the HeaderClick event.
SetValue Event
Occurs when the style is LVFS_DETAIL and the user clicks the text in the first column or on the associated bitmap. In the other modes, a SetValue event occurs when the user clicks either the text or the bitmap. In listview_examples, a message is displayed in the frame's status bar when a SetValue event occurs.