2.3.1.53 GETN_MULTI_COLS_BRANCH


Contents

Name

GETN_MULTI_COLS_BRANCH

Declaration

#define GETN_MULTI_COLS_BRANCH(_NCOLS, _GAP)		{DWORD __dwTemp = _GAP; DYNA_SET_NUMCOLS(__dwTemp, _NCOLS); _strTemp = __dwTemp; _tmpSubNode.SetAttribute(STR_ATTRIB_MULTI_COLS, _strTemp);}

Remark

Allow multiple controls in one row. Origin 2024b can arrange radio buttons by setting the number of radio buttons in one row.

Parameters

_NCOLS
[input] Number of control columns.
_GAP
[input]

set the branch option.It should be one of the following macros

DYNA_MULTI_COLS_LOCAL_WIDTH -- to arrange the controls one right after another, and not to subdivide the overall dialog width evenly
DYNA_MULTI_COLS_BY_COLUMN -- to arrange the controls vertically first
DYNA_MULTI_COLS_COMAPCT -- compact column width

Return

Examples

EX1

#include <GetNbox.h>
void GETN_MULTI_COLS_BRANCH_ex(int nVerticalFirst=0)
{
	DWORD dwMultiCols = DYNA_MULTI_COLS_LOCAL_WIDTH|3;// factor of 3 times the lable-control gap
	if(nVerticalFirst)
		dwMultiCols |= DYNA_MULTI_COLS_BY_COLUMN;
	
	GETN_TREE(testTree)
    GETN_BEGIN_BRANCH(Start, "Fitting Options ++++++++++++++++++++++++++++++++") 
    GETN_MULTI_COLS_BRANCH(2, dwMultiCols)
		GETN_OPTION_BRANCH(GETNBRANCH_OPEN)
		GETN_STR(from, "From", "0")	GETN_EDITOR_SIZE_USER_OPTION("#3") 
		GETN_STR(to, "To", "1") GETN_EDITOR_SIZE_USER_OPTION("#3")
		
		GETN_STR(read,"Read", "1") GETN_EDITOR_SIZE_USER_OPTION("#5")
		GETN_STR(skip,"Skip", "0") GETN_EDITOR_SIZE_USER_OPTION("#5")
    GETN_END_BRANCH(Start)    //Match GETN_BEGIN_BRANCH
    if(GetNBox(testTree, NULL, NULL, NULL, NULL))
        out_tree(testTree);
}

EX2 Origin 2024b

arrange radio buttons
#include <GetNbox.h>
void GETN_MULTI_COLS_BRANCH_Radio()
{		
	GETN_TREE(tr)
	GETN_RADIO_INDEX(Radio, 0, "Radio1|Radio2|Radio3|Radio4|Radio5|Radio6|Radio7|Radio8|Radio9|Radio0|")	GETN_OPTION_DISPLAY_FORMAT(DISPLAY_EDITOR_LEFT)	
	GETN_MULTI_COLS_BRANCH(5, 0);//second var not used
	GetNBox(tr);
}

EX3

make controls in two row align vertically
void GETN_MULTI_COLS()
{ 
	GETN_TREE(testTree)
        GETN_BEGIN_BRANCH(advanced, "Advanced")
        GETN_MULTI_COLS_BRANCH(3,0)  
			GETN_OPTION_BRANCH(GETNBRANCH_OPEN)
			
			GETN_CHECK(value, _L("Value"), 0) GETN_OPTION_DISPLAY_FORMAT(DISPLAY_EDITOR_CHECK_ON_LEFT)
			GETN_NUM(valuefrom, _L("From"), NANUM) GETN_CUEBANNER(_L("Auto"))
			GETN_NUM(valueto, _L("To"), NANUM) GETN_CUEBANNER(_L("Auto"))
			
			GETN_CHECK(rank, _L("Top N"), 0) GETN_OPTION_DISPLAY_FORMAT(DISPLAY_EDITOR_CHECK_ON_LEFT)
			GETN_NUM(rankn, " ", 10.0) //use space " " as placeholder to align the controls vertically
			GETN_LIST(rankitem, " ", 0, _L("Items|Percent")) 
				GETN_EDIT_DISPLAY_WIDTH_RANGE("13-13") //make list control same width as editbox
        GETN_END_BRANCH(advanced)   
        if(GetNBox(testTree))
            out_tree(testTree);
}

See Also

GETN_PAD, GETN_ADDITIONAL_TAB

Header to Include

GetNbox.h

Reference