GETN_CONTROL_OPTION_BOX
Name
GETN_CONTROL_OPTION_BOX
Declaration
#define GETN_CONTROL_OPTION_BOX(BDEFAULT) _tmpSubNode.SetAttribute(STR_ATTRIB_DYNACONTROL_USE_CHECK, BDEFAULT);
Remark
This macro allow user to change to enable or disable status of a control
Parameters
- BDEFAULT
- [input] Default enable status: true/false
Return
Examples
EX1
#include <GetNbox.h>
void GETN_CONTROL_OPTION_BOX_ex1()
{
GETN_BOX(trRoot)
GETN_NUM(Min, "Min", 0) GETN_CONTROL_OPTION_BOX(false)
GETN_NUM(Max, "Max", 100) GETN_CONTROL_OPTION_BOX(true)
if ( GetNBox(trRoot) )
out_tree(trRoot);
return;
}
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_ADD_LEFT_CHECK
- GETN_ADD_LEFT_CHECK_TYPE
- tree_is_left_checkbox_checked
- GETN_ADD_AUTO
header to Include
GetNBox.h
Reference
|