Origin Ver. and Service Release Origin 8 SR6
Operating System: Win XP
Hi,
when programmatically changing value of a radio button, in a GetNBox dialog (GETN_RADIO_INDEX)
more than one of the elements are lightened.
please have a look at following code:
// event function - called when changing value in dialog
static bool gender_choose_event(TreeNode& myTree, int nRow, int nType, Dialog& dlgGetNBox)
{
TreeNode tn;
if(nRow < 0) // On dialog init, nothing to do
return false;
if(true) // <-- missing the type: TRGP_RADIO_INDEX why doesnt exist??
{
tn = myTree.GetNode("gender");
if(!tn)
return false;
// changing value of the radio button
tn.nVal = 0;
tn.nVal = 1;
tn.nVal = 2;
return true;
}
return false;
}
void GetNBox_ex2()
{
GETN_TREE(myTree)
GETN_RADIO_INDEX(gender, 0, "male|femal|other")
if( GetNBox(myTree, "gender", "what have you got", NULL, gender_choose_event) )
{
// do something
}
}
btw: why the type TRGP_RADIO_INDEX does not exist? - to check if radio button changed in event function...
|-- TreeNode
...|-- a??
...|-- ha!!