LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

tree scroll bar

Hello,

 

Is there a natural way of having an horizontal scroll bar on a tree control which keeps the tree (the first column) allways visible ?

 

If this is not possible, do you think it would be easy to keep 2 tree controls "synced" to have an equivalent behaviour ?

 

Best regards.

 

0 Kudos
Message 1 of 2
(4,197 Views)

Hello crazyfwed,

 

To sync the scroll of 2 tree controls you could put in the control callback for both trees some code similar to this:

int CVICALLBACK TreeCB (int panel, int control, int event,
						 void *callbackData, int eventData1, int eventData2)
{
	int s;
	switch (event)
	{
		case EVENT_VSCROLL:
			GetCtrlAttribute(panel, PANEL_TREE, ATTR_VSCROLL_OFFSET, &s);
			SetCtrlAttribute(panel, PANEL_TREE_2, ATTR_VSCROLL_OFFSET, s);
			break;
	}
	return 0;
}

 If you want to sync also the selection, you could handle EVENT_SELECTION_CHANGE:

		case EVENT_SELECTION_CHANGE:
			SetTreeItemAttribute (panel, PANEL_TREE_2, eventData2, ATTR_SELECTED, eventData1);
			break;

 

Constantin

0 Kudos
Message 2 of 2
(4,190 Views)