quote:
Originally posted by couturier
I come up again with this topic
I have a dialog in which thoses nodes are added like this
TreeNode trC = myTree.Param.AddTextNode(strText, "Cycle" + ii);
trC.SetAttribute(STR_LABEL_ATTRIB, "Cycle " + ii);
trC.SetAttribute(STR_ATTRIB_DYNACONTROL_USE_CHECK, 1 );
trC.SetAttribute(STR_ATTRIB_HANDLER_RC, dialog_event);
dialog_event will be triggered when user edits the node text
However i'd like the event to be triggered WHEN users checks or unchecks the left checkbox.
How can I do that ?
thanks
The event will be triggered when toggling the checkbox or updating the text. I'm not sure if you can have it triggered only when toggling the checkbox. Have a try of this:
bool node_event(TreeNode& tr, int nRow, int nCol, TreeNode& trNode, DWORD nEventInfo, int nCntrlType, WndContainer& getNContainer)
{
if(trNode.DataID == 0x01000000)
printf("%s: %s\n", tree_is_left_checkbox_checked(trNode) ? "Checked" : "Cleared", trNode.strVal);
return true;
}
void MyTriggerEvent()
{
Tree myTree;
TreeNode trC = myTree.Param.AddTextNode("Text Value", "Cycle", ONODETYPE_EDIT_BOX_ONELINE_TEXT);
trC.SetAttribute(STR_ATTRIB_DYNACONTROL_USE_CHECK, 1 );
trC.SetAttribute(STR_LABEL_ATTRIB, "Cycle Value");
trC.DataID = 0x01000000;
trC.SetAttribute(STR_ATTRIB_HANDLER_RC, node_event);
if(GetNBox(myTree))
return;
}
Show your code if toggling the checkbox does not trigger the event.
------------------------------------------
Be The Change
You Want To See
In The World
------------------------------------------