GETN_ADD_LEFT_CHECK
Name
GETN_ADD_LEFT_CHECK
Declaration
#define GETN_ADD_LEFT_CHECK(_CHECK) _tmpSubNode.SetAttribute(STR_ATTRIB_DYNACONTROL_USE_CHECK, _CHECK ? 1 : 0);
Remark
This macro creates a checkbox control on the left side of a TreeNode.
Parameters
- _CHECK
- [input] the default states of checkbox.
- If true, the checkbox is checked as default.
- If false, the checkbox is unchecked as default.
Return
Examples
EX1
void GETN_ADD_LEFT_CHECK_ex1()
{
GETN_TREE( tr );
GETN_STR_GROUP(stats, "Please pick a few US Stats", "MA", "|MA|CA|RI|VT|NY")GETN_ADD_LEFT_CHECK(true)
if( GetNBox( tr ))
out_tree( tr );
}
EX2
void GETN_ADD_CONTROL_OPTION_BOX_AND_LEFT_CHECK_Ex()
{
GETN_TREE(testTree)
//GETN_CONTROL_OPTION_BOX and GETN_ADD_LEFT_CHECK are the same
GETN_STR_GROUP(ctrlh, "Uncheck to hide", "A", "|A|C|R|V|Y")
GETN_CONTROL_OPTION_BOX(0)
GETN_NUM(ctrle, "Uncheck to disable", 1.23)
GETN_ADD_LEFT_CHECK(0)
GETN_ADD_LEFT_CHECK_TYPE(DYNA_USE_CHECK_TYPE_ENABLE)
if( GetNBox(testTree, _on_change) )
{
if( tree_is_left_checkbox_checked(testTree.ctrlh) )
{
printf("%s=%s\n", testTree.ctrlh.tagName, testTree.ctrlh.strVal);
if( tree_is_left_checkbox_checked(testTree.ctrle) )
out_double(testTree.ctrle.tagName + "=", testTree.ctrle.dVal);
}
}
}
static int _on_change(TreeNode& tr, int nRow, int nEvent, DWORD& dwEnables, LPCSTR lpcszNodeName, WndContainer& getNContainer, string& strAux, string& strErrMsg)
{
tr.ctrle.Show = tree_is_left_checkbox_checked(tr.ctrlh);
return true;
}
See Also
- GETN_CONTROL_OPTION_BOX
- GETN_ADD_LEFT_CHECK_TYPE
- tree_is_left_checkbox_checked
- GETN_ADD_AUTO
header to Included
GetNBox.h
Reference
|