2.4.12 PEVENT_NODE_FUNC


Name

PEVENT_NODE_FUNC

Declaration

typedef bool (* PEVENT_NODE_FUNC)(TreeNode& tr, int nRow, int nCol, TreeNode& trNode, DWORD nEventInfo, int nCntrlType, WndContainer& getNContainer)

Examples

EX1

#include <GetNbox.h>

void PEVENT_NODE_FUNC_ex1()
{
	GETN_TREE(testTree)
	GETN_NUM(Factor, "Scale Factor", 12.3)
	GETN_BUTTON(Path, "File path", GetAppPath())
	GETN_OPTION_EVENT_EX(button_event) 
	if(GetNBox(testTree, NULL, NULL, NULL, NULL))
	out_tree(testTree);
}
bool button_event(TreeNode& myTree, int nRow, int nCol, TreeNode& trNode, DWORD dwCntrl, int nType, WndContainer& theDlg)
{
	printf("row = %d, col=%d, cntrl=%X, type = %d\n", nRow, nCol, dwCntrl, nType);

	if(TRGP_STR_BUTTON == nType && nRow >= 0 && !(dwCntrl & GETNEVENT_ON_INIT))
	{
		string strPath = BrowseGetPath(myTree.Path.strVal);
		myTree.Path.strVal = strPath;
		return true;
	}
	else
	return false;
}

Remark

function pointer of more general version in tree node event handler that will receive both row and col positions

also, Dialog is replaced by WndContainer to allow support for GetN tree inside splitter control etc.

Header to Include

GetNbox.h

Reference