11-26-2014 12:28 AM
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.
11-26-2014 02:28 AM
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