2.3.1.10 GETN_BRANCH_OPTION_BOX


Name

GETN_BRANCH_OPTION_BOX

Declaration

#define GETN_BRANCH_OPTION_BOX(BDEFAULT)			_tmpNode.SetAttribute(STR_ATTRIB_DYNACONTROL_USE_CHECK, BDEFAULT);

Remark

This macro allow user to change to enable status of a branch

Parameters

BDEFAULT
[input] Default enable status:true/false

Return

Examples

EX1

#include <GetNbox.h>
void GETN_BRANCH_OPTION_BOX_ex1()
{
    GETN_BOX(trRoot)
    GETN_STR(STR, "Tips", "Nothing")
    GETN_BEGIN_BRANCH(Details, "Details")
        GETN_BRANCH_OPTION_BOX(false)
        GETN_NUM(Min, "Min", 0)
        GETN_NUM(Max, "Max", 100)
    GETN_END_BRANCH(Details)
    if ( GetNBox(trRoot) )
    {
    	//Returns whether the left checkbox of the node is checked.
    	bool bCheck = tree_is_left_checkbox_checked(trRoot.Details);
    	if(!bCheck)
    		trRoot.RemoveChild("Details");
    	out_tree(trRoot);
    }
    return;
}

EX2

checkbox branch still have multiple columns, and subbranch also can have multiple columns
#include <GetNbox.h>
void GETN_BRANCH_OPTION_BOX_ex2()
{
	GETN_TREE(tr)

	GETN_BEGIN_BRANCH(Part1, "Branch1")   GETN_MULTI_COLS_BRANCH(2, 0) GETN_OPTION_GROUP_BRANCH(GETNBRANCH_OPEN)
		GETN_CHECK(Day, "Glasses", false)
		GETN_CHECK(Night, "Headphone", false)
		GETN_BEGIN_BRANCH(Part2, "Branch2") GETN_CHECKBOX_BRANCH(1) GETN_MULTI_COLS_BRANCH(2, 0) GETN_OPTION_GROUP_BRANCH(GETNBRANCH_OPEN)
			GETN_CHECK(time1, "8:00 - 9:00", false)
			GETN_CHECK(time2, "10:00 - 11:00", false)
			GETN_CHECK(time3, "14:00 - 15:00", false)
			GETN_CHECK(time4, "16:00 - 17:00", false)
		GETN_END_BRANCH(Part2)
	GETN_END_BRANCH(Part1)

	if( GetNBox(tr, "Booking", NULL, NULL, NULL) )
		out_tree(tr);
}

See Also

tree_is_left_checkbox_checked

Header to Include

GetNBox.h

Reference