2.3.1.2 GETN_ADD_AUTO


Name

GETN_ADD_AUTO

Declaration

#define GETN_ADD_AUTO(_CHECK)	_tmpSubNode.SetAttribute(STR_ATTRIB_AUTO, _CHECK?"1":"0");

Remark

Parameters

_CHECK

Return

Examples

EX1

#include <GetNbox.h>
void GETN_ADD_AUTO_ex1()
{
    GETN_TREE(tr)
 
    GETN_BEGIN_BRANCH(tt, _L("Output Find Specific X/Y Tables"))
        GETN_OPTION_BRANCH(GETNBRANCH_OPEN) 
        GETN_NUM(start, "Start Time", 1) GETN_ADD_AUTO(1)
        GETN_NUM(stop, "Stop Time", 100) GETN_ADD_AUTO(1)
    GETN_END_BRANCH(tt)
    if(GetNBox(tr))
    {
        tree_check_replace_auto(tr.tt.start, NANUM);
        tree_check_replace_auto(tr.tt.stop, -1);
        out_tree(tr);
    }
}

EX2

#include <GetNbox.h>

// to add Auto checkbox to text edit control
void GETN_ADD_AUTO_ex2()
{
    GETN_TREE(tr)    
    
    GETN_BUTTON(path, "Path", GetOriginPath() + "OriginC\\")    

    // add Auto checkbox. "Auto" can be replace with any other text. 
    GETN_CURRENT_SUBNODE.SetAttribute(STR_ATTRIB_AUTO, "1|Auto|1");
    
    GetNBox(tr, button_event);
}

static int button_event(TreeNode& tr, int nRow, int nEvent, DWORD& dwEnables, 
LPCSTR lpcszNodeName, WndContainer& getNContainer, string& strAux, string& strErrMsg)
{
	if( nRow < 0 )
		return 0; // dialog init time, nothing to do 
	
	if( 0 == strcmp(lpcszNodeName, "path") )
	{
		string strPath = BrowseGetPath(tr.path.strVal);
		tr.path.strVal = strPath;
		return 1;
	}	
	return 0;
}


EX3

#include <GetNbox.h>

// to add Auto checkbox to browser combo control
void GETN_ADD_AUTO_ex3()
{
    GETN_TREE(tr)    
        
    GETN_COMBO_BUTTON(fname, "Browse", "Picking a Data File", "File", "User.dat|System.dat|Group.dat", "Untitle.dat")
    GETN_CURRENT_SUBNODE.SetAttribute(STR_ATTRIB_AUTO, "1|Auto|1");
	
    GetNBox(tr);
    return;
}

See Also

Header to Include

GetNbox.h

Reference