LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

cvi tree control column change events

Hello all,
 
I would like to use a tree control and have a ring, text box or command button activated in the cell when left_clicking the cell in the tree.  This is similar to the example supplied by 'jared' which is the text box implementation.  The change that I would like to make though is to keep the control active and have it resize along with the column when the tree column is resized.  I can find no EVENT that would allow this.  Does anyone have experience with this?
 
tim
0 Kudos
Message 1 of 4
(3,298 Views)

In CVI 8.0, there is a new EVENT_COLUMN_SIZE_CHANGE. 8.0 beta should be released the first week of August.

In 7.1, you could use a timer. Enable the timer on the EVENT_LEFT_CLICK when the area clicked on is the column size area (call GetIndexFromPoint to find the area). In the timer callback's EVENT_TIMER_TICK, call GetRelativeMouseState to get the mouse coordinates and whether the left button is down. When the left button is not down, disable the timer and get the new column width. You also have to check in the tree's EVENT_LEFT_DOUBLE_CLICK to see if the user double clicked on the column divider, which will auto size the column. Again, call GetIndexFromPoint, and if the area is VAL_COLUMN_SIZE_AREA, call SetColumnWidthToWidestCellContents to get the new width, set the new width yourself, and swallow the EVENT_LEFT_DOUBLE_CLICK.

Hope this helps.

- jared

0 Kudos
Message 2 of 4
(3,289 Views)
Jared,
I thought of this method but discarded it due to the open-endedness of the timer.  I think I will use your first method.  Thank you for your response (and the example).
Tim Lesher
0 Kudos
Message 3 of 4
(3,285 Views)

Greetings Tim

If you would like to evaluate the CVI 8.0 beta, you can sign up by going to this link . You will get notified when it is available for download.

Thanks

Bilal Durrani
NI
0 Kudos
Message 4 of 4
(3,277 Views)