GETN_COMBO_BUTTON

 

Name

GETN_COMBO_BUTTON

Declaration

#define GETN_COMBO_BUTTON(_NODE_NAME, _BUTTON_NAME, _NODE_LABEL, _BUTTON_MODE, _COMBO_STR, _DEFAULT_VAL)  _tmpSubNode = _tmpNode.AddTextNode(_DEFAULT_VAL, #_NODE_NAME, ONODETYPE_BROWSECOMBO);TREE_ADD_LABEL(_NODE_LABEL); string str=#_BUTTON_NAME + ".."+ _BUTTON_MODE + "|:|" +_COMBO_STR;_tmpSubNode.SetAttribute(STR_COMBO_ATTRIB, str);

Remark

This macro allows user to pick different kind of string to fill into an editable combo box. Programmer can prefill the combo dropdown as hints

Parameters

_NODE_NAME
[input] name of the control node
_BUTTON_NAME
[input] string to display on the button if _BUTTON_MODE is valid
_NODE_LABEL
[input] label to display on dynamic control
_BUTTON_MODE
[input] specify which type of dialog to open, valid mode are {"Sheet", "Sheets", "Column", "Columns", "File", "Files", "FileMultiSel", "Save", "SaveAs", "Graph", "Graphs", "Report", "Reports", "Path"}
_COMBO_STR
[input] tokens contains in this control
_DEFAULT_VAL
[input] default value of the combo list

Return

Examples

EX1

#include <GetNbox.h>
void GETN_COMBO_BUTTON_ex1()
{
    //this example prefill the combo with User.Dat, System.Dat, Group.Dat for user to pick
    //but also allow a browe button to let user browe to pick a file
    //the combo is prefilled with Untitle.dat
    GETN_BOX(tr)
    GETN_COMBO_BUTTON(fname, "Browse", "Picking a Data File", "File", "User.dat|System.dat|Group.dat", "Untitle.dat")
    if ( GetNBox(tr) )
        printf("You have selected %s\n", tr.fname.strVal);
    else
        printf("User Cancel\n");
}

See Also

header to Include

GetNBox.h

Reference