Hi Tyro,
if I've understood this correctly, the answer is to have a callback for the radio buttons that only gives you the exclusivity (only one radio button at a time working) and updates the checkbox with the current value of Enable_1 or Enable_2 as appropriate. You then use a callback for the checkbox to find out which radio button is pressed, and then write this to the Enable_1 or Enable_2 as appropriate.
I've created an example (CVI 6.0)
Hope that helps (also done the code snippet below just in case)
S.
int CVICALLBACK CheckBoxCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
int radio_1 = 0;
int radio_2 = 0;
int checkbox = 0;
switch (event)
{
case EVENT_COMMIT:
{
GetCtrlAttribute (panel, PANEL_RADIOBUTTON_1, ATTR_CTRL_VAL, &radio_1);
GetCtrlAttribute (panel, PANEL_RADIOBUTTON_2, ATTR_CTRL_VAL, &radio_2);
GetCtrlAttribute (panel, PANEL_CHECKBOX, ATTR_CTRL_VAL, &checkbox);
if (radio_1==1)
{
Enable_1 = checkbox;
}
if (radio_2==1)
{
Enable_2 = checkbox;
}
}
break;
}
return 0;
}
int CVICALLBACK RadioButtonCB (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
{
switch(control)
{
case PANEL_RADIOBUTTON_1:
{ // make sure we've de-selected the old control
SetCtrlAttribute (panel, PANEL_RADIOBUTTON_2, ATTR_CTRL_VAL, 0);
SetCtrlAttribute (panel, PANEL_CHECKBOX, ATTR_CTRL_VAL, Enable_1);
}
break;
case PANEL_RADIOBUTTON_2:
{ // make sure we've de-selected the old control
SetCtrlAttribute (panel, PANEL_RADIOBUTTON_1, ATTR_CTRL_VAL, 0);
SetCtrlAttribute (panel, PANEL_CHECKBOX, ATTR_CTRL_VAL, Enable_2);
}
break;
}
}
break;
}
return 0;
}
// it takes almost no time to rate an answer