GETN_BUTTON

 

Name

GETN_BUTTON

Declaration

#define GETN_BUTTON(_NODE_NAME, _NODE_LABEL, _DEFAULT_VAL) _tmpSubNode = _tmpNode.AddTextNode(_DEFAULT_VAL, #_NODE_NAME, TRGP_STR_BUTTON); TREE_ADD_LABEL(_NODE_LABEL);_tmpSubNode.SetAttribute(STR_COMBO_ATTRIB, "...");

Remark

This macro creates a button in a string edit box in GetN_Box dialog.

Parameters

_NODE_NAME
[input] the name of the new node to be added to the tree
_NODE_LABEL
[input] the string value to show as the node name in the dialogbox
_DEFAULT_VAL
[input] the command for the button click

Return

Examples

EX1

#include <GetNbox.h>
void GETN_BUTTON_ex1()
{
    GETN_TREE(testTree)
    GETN_NUM(Factor, "Scale Factor", 12.3)
    GETN_BUTTON(Path, "File path", GetAppPath())
    GETN_OPTION_EVENT(button_event) 
    if(GetNBox(testTree, NULL, NULL, NULL, NULL))
        out_tree(testTree);
}
bool button_event(TreeNode& myTree, int nRow, int nType, Dialog& theDlg)
{
        if(TRGP_STR_BUTTON == nType && nRow >= 0)
        {
                string strPath = BrowseGetPath(myTree.Path.strVal);
                myTree.Path.strVal = strPath;
                return true;
        }
        else
                return false;
}

See Also

GETN_BUTTON_BRANCH

Header to Include

GetNbox.h

Reference