Do you know a trick to do the same using CVI 2010 ?
I know that my checkbox won't be dimmed, but I want to keep the active state. Example :
+ root
| + item 1
| + item 2 (dimmed)
| + item 3
All my checkboxes are unchecked except the item 2. If I try to uncheck the item 2 in this configuration : no worries. If I check the item 3, then I can uncheck as I want the item 2....
Here is my code sample :
int CVICALLBACK tree_interact(int panel, int control, int event, void *callbackData,
int eventData1, int eventData2)
{
int testIndex = 0;
int testStatusDimmed = 0;
switch (event)
{
case EVENT_MARK_STATE_CHANGE:
{
GetCtrlIndex (panel, control, &testIndex);
GetTreeItemAttribute(PANEL, PANEL_TREE, testIndex, ATTR_CELL_DIMMED, &testStatusDimmed);
if(checks[testIndex].dimmed != 0)
{
SetTreeItemAttribute(PANEL, PANEL_TREE, testIndex, ATTR_MARK_STATE, checks[testIndex].checked);
}
break;
}
}
return 0;
}