2.3.1.37 GETN_ID_REPEAT_BRANCH


Name

GETN_ID_REPEAT_BRANCH

Declaration

#define GETN_ID_REPEAT_BRANCH(_NN)	_tmpNode.SetAttribute(STR_REPEAT_ID_ATTRIB ,_NN);

Remark

In GetN_box dialog, user can save the settings to theme file, but not allow the duplicate DataID,

If you want to use same DataID in node of different branch, you can set the branch with GETN_ID_REPEAT_BRANCH,

else can not use same DataID in whold node.

This GETN_ID_REPEAT_BRANCH will combine with subnode's DataID.

Parameters

_NN
value of repeat ID, should >0 and < MAX_REPEAT_ID_VALUE

Return

Examples

EX1

#include <GetNbox.h>
#define BRANCH_DATAID  12
#define BRANCH2_DATAID  14
#define CONTROL_DATAID  13
void GETN_ID_REPEAT_BRANCH_ex1()
{
    GETN_TREE(tr)

    GETN_BEGIN_BRANCH(WhichDay, "Test Branch with Combo") GETN_ID_BRANCH( BRANCH_DATAID) GETN_ID_REPEAT_BRANCH(1)
        GETN_LIST(Smooth, "Smoothing Method", 0, "Adj Ave|Savisky-Golay|FFT Filter") GETN_ID(CONTROL_DATAID);
        GETN_COMBO(npts, "Smooth Pts",1, "|1|2|3|4|5|6")
    GETN_END_BRANCH(WhichDay)    //Match GETN_BEGIN_BRANCH

    GETN_BEGIN_BRANCH(WhichDay2, "Test Branch with Combo2") GETN_ID_BRANCH( BRANCH2_DATAID) GETN_ID_REPEAT_BRANCH(2)
        GETN_LIST(Smooth, "Smoothing Method", 0, "Adj Ave|Savisky-Golay|FFT Filter") GETN_ID(CONTROL_DATAID);
        GETN_COMBO(npts, "Smooth Pts",1, "|1|2|3|4|5|6")
    GETN_END_BRANCH(WhichDay)    //Match GETN_BEGIN_BRANCH
    vector<string> vsValue;
    vector<int> vn;
    int nRet = tree_get_values_with_ids(tr, vn, vsValue);
    ASSERT(nRet != 0 );
    if(GetNBox(tr, NULL, NULL, NULL, NULL))
    {
        out_int("Test Combo = ", tr.WhichDay.Use);
    }
}

See Also

Header to Include

GetNbox.h

Reference