GETN_COMBO
#define GETN_COMBO(_NODE_NAME, _NODE_LABEL, _DEFAULT_VAL, _COMBO_STR) _tmpSubNode = _tmpNode.AddNumericNode((double)_DEFAULT_VAL, #_NODE_NAME, TRGP_NUMERIC_LIST); TREE_ADD_LABEL(_NODE_LABEL);_tmpSubNode.SetAttribute(STR_COMBO_ATTRIB, _COMBO_STR);
This macro creates a combo control containing numeric values in the GetN_Box dialogbox.
EX1
#include <GetNBox.h> void GETN_COMBO_ex1() { GETN_BOX( treeTest ); GETN_COMBO(order, "Polynomial Order", 2, "2|3|4|5|6") // dropdown list, only allow to choose one from list GETN_LIST(Type, "Analysis Type", 1, "t-Test|Correlation|NLSF|Polynomial Fit|Statistics") GETN_STRLIST(WksName, "Worksheet Name", "one", "|one|two|three|four|five") // editable, choose one from list or directly type string into control if( GetNBox( treeTest, _event_func_ex )) // to open getn dialog out_tree( treeTest ); } int _event_func_ex(TreeNode& tr, int nRow, int nEvent, DWORD& dwEnables, LPCSTR lpcszNodeName, WndContainer& getNContainer, string& strAux, string& strErrMsg) { TreeNode trEdited; // check nEvent switch(nEvent) { case GETNE_ON_INIT: out_str("Dialog Init event."); break; case GETNE_ON_OK: out_str("Cliked OK button. "); break; case GETNE_ON_VALUE_CHANGE: trEdited = tree_get_node(tr, nRow); if( trEdited ) printf("%s control changed.\n", trEdited.tagName); break; } // use lpcszNodeName to get the changed node if(lstrcmpi(lpcszNodeName,"WksName") == 0) { out_str(tr.WksName.strVal); } return true; }
GetNbox.h