GETN_FONT
#define GETN_FONT(_NODE_NAME, _NODE_LABEL, _DEFAULT_VAL) _tmpSubNode = _tmpNode.AddNumericNode(_DEFAULT_VAL, #_NODE_NAME, ONODETYPE_DROPLIST_FONTS);TREE_ADD_LABEL(_NODE_LABEL);
This macro creates a font combo list in the dialogbox.
EX1
void FONT_Example() { //font name list out_str("Font List:"); vector<string> vsNames; int nSize = GetFontNames(&vsNames); for(int ii = 0; ii < min(10, nSize); ii++)//show no more than 10 names out_str( vsNames[ii] ); //name of font int nIndex = 4; out_str( "\nInput Font = " + GetFontNameByIndex(nIndex) ); //convert between font index and font DWORD GETN_TREE(testTree) GETN_FONT(Face, "face", FontFaceIndex_to_DWORD(nIndex)) if(GetNBox(testTree)) { int nSel = FontFaceDWORD_to_Index(testTree.Face.nVal); out_str( "User's Font = " + GetFontNameByIndex(nSel) ); } }
GetNBox.h