GETN_NUM

 

Name

GETN_NUM

Declaration

#define GETN_NUM(_NODE_NAME, _NODE_LABEL, _DEFAULT_VAL) _tmpSubNode = _tmpNode.AddNumericNode(_DEFAULT_VAL, #_NODE_NAME, TRGP_DOUBLE);TREE_ADD_LABEL(_NODE_LABEL);

Remark

This macro creates a numeric edit box in the dialogbox.

Parameters

_NODE_NAME
[input] the name of the new node to be added to the tree
_NODE_LABEL
[input] the string value to show the numeric edit box name in the dialogbox
_DEFAULT_VAL
[input] numeric contents as the default value to show in the edit box

Return

Examples

EX1

#include <GetNBox.h>
static int _event_func_ex(TreeNode& tr, int nRow, int nEvent, DWORD& dwEnables, LPCSTR lpcszNodeName, WndContainer& getNContainer, string& strAux, string& strErrMsg)
{
    if(tr.Factor.dVal <= 0)
    {
        O_SET_BIT(dwEnables, GETNGEVT_OK_ENABLE, false);         
        strErrMsg = "Factor must more than 0";
    }

    return true;
}

void GETN_NUM_ex1()
{
    GETN_BOX( treeTest );
    double ff = 1.23;
       GETN_NUM(Factor, "Scale Factor", ff)
    if( GetNBox( treeTest, _event_func_ex ))
        out_tree( treeTest );
}

See Also

GETN_OPTION_NUM_FORMAT

header to Include

GetNbox.h

Reference