| 2.3.1.11 GETN_BUTTON
 NameGETN_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, "..."); RemarkThis 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
 ReturnExamplesEX1
 this example shows how to handle the button event
 #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;
}EX2
 this example shows how to use keyword "File" in COMBO attribute to open corresponding file browser. For more keywords, see GETN_COMBO_BUTTON
 #include <GetNbox.h>
void getfiles_ex()
{	
	GETN_TREE(tr)
	
	//single file browser for txt file
	GETN_BUTTON(file1, "Sigle File", "")
	tr.file1.SetAttribute(STR_COMBO_ATTRIB,"...File:*.txt");
	
	//multiple file browser for csv and txt file, use '|' to separate the file type and extension
	GETN_BUTTON(file2, "Files", "")
	tr.file2.SetAttribute(STR_COMBO_ATTRIB,"...Files:[CSV (*.csv)] *.csv|[Text (*.txt)] *.txt");
	
	//multiple file browser for Origin file. There're some file extension groups: Origin, Image, ASCII etc.
	GETN_BUTTON(file3, "Origin Files", "")
	tr.file3.SetAttribute(STR_COMBO_ATTRIB,"...Files:Origin");
	
	GetNBox(tr);
}See AlsoGETN_BUTTON_BRANCH, GETN_COMBO_BUTTON
 Header to IncludeGetNbox.h
 Reference |