2.3.1.57 GETN_OPTION_EVENT


Name

GETN_OPTION_EVENT

Declaration

#define GETN_OPTION_EVENT(_PFN)	{PEVENT_FUNC __dfn = _PFN;DWORD _dw_fn = (DWORD)__dfn;if(_dw_fn) {_strTemp = _dw_fn;_tmpSubNode.SetAttribute(STR_ATTRIB_HANDLER, _strTemp);}}

Remark

Add event handler at row level.

Parameters

_PFN
the function name of the event.

Return

Examples

EX1

#include <GetNbox.h>
void GETN_OPTION_EVENT_ex1()
{
    GETN_TREE(testTree)
    GETN_NUM(Factor, "Scale Factor", 12.3)
    GETN_BUTTON(Path, "File path", GetAppPath())
    GETN_OPTION_EVENT(GetN_option_event) 
    if(GetNBox(testTree, NULL, NULL, NULL, NULL))
          out_tree(testTree);
}
bool GetN_option_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_OPTION_EVENT_EX, GETN_SET_EVENT_EX_HANDLER

Header to Include

GetNbox.h

Reference