2.3.1.87 GETN_SPINNOR_DOUBLE


Name

GETN_SPINNOR_DOUBLE

Declaration

#define		GETN_SPINNOR_DOUBLE(_NODE_NAME, _NODE_LABEL, _DEFAULT_VAL, _COMBO_STR)	_strTemp = _DEFAULT_VAL; _tmpSubNode = _tmpNode.AddTextNode(_strTemp, #_NODE_NAME, ONODETYPE_EDIT_BOX_FLOAT_SPINOR);TREE_ADD_LABEL(_NODE_LABEL);TREE_ADD_LABEL(_NODE_LABEL);_tmpSubNode.SetAttribute(STR_COMBO_ATTRIB, _COMBO_STR);

Remark

This macro is used to construct a spinner on dynamic control

Parameters

_NODE_NAME
[input] name of the control node
_NODE_LABEL
[input] label of the control node
_DEFAULT_VAL
[input] default value of the control, if not in series generated by _COMBO_STR, will get the smallest value that are bigger than it in the series as default value
_COMBO_STR
[input] set the start value, increment and number of steps, like "0.0|1.0|5" wll get value series as {0, 1, 2, 3, 4, 5}

Return

Examples

EX1

#include <GetNbox.h>
void GETN_SPINNOR_DOUBLE_ex1()
{
    GETN_BOX(trRoot)
    GETN_SPINNOR_DOUBLE(Value, "Value", 0.9, "0.0|0.2|6") //start at 0.0, increment as 0.2 steps = 6, and there can be 6+1 different values
    if ( GetNBox(trRoot) )
        out_tree(trRoot);
    return;
}

EX2

#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(lstrcmpi(lpcszNodeName, "Value") == 0)
    {
		out_double("", tr.Value.dVal);
    }

    return true;
}

void GETN_SPINNOR_DOUBLE_ex2()
{
    GETN_BOX(trRoot)
    GETN_SPINNOR_DOUBLE(Value, "Value", 2, "0.0|0.5|10") 
    if( GetNBox( trRoot, _event_func_ex ))
        out_tree(trRoot);
    return;
}

See Also

Header to Include

GetNBox.h

Reference