GETN_COMBO_REFRESH_BUTTON

 

Name

GETN_COMBO_REFRESH_BUTTON

Declaration

#define GETN_COMBO_REFRESH_BUTTON(_NODE_NAME, _NODE_LABEL, _COMBO_STR, _DEFAULT_VAL)  _tmpSubNode = _tmpNode.AddTextNode(_DEFAULT_VAL, #_NODE_NAME, ONODETYPE_BROWSECOMBO);TREE_ADD_LABEL(_NODE_LABEL); _tmpSubNode.SetAttribute(STR_COMBO_ATTRIB, make_combo_button_attribute("R", "User", _COMBO_STR));

Remark

combo control with a refresh button that will call your event handler so you can update the combo entries

Parameters

_NODE_NAME
[input] name of the control node
_NODE_LABEL
[input] label to display on dynamic control
_COMBO_STR
[input] tokens contains in this control
_DEFAULT_VAL
[input] default value of the combo list

Return

Examples

EX1

static bool _test_events(TreeNode& myTree, int nRow, int nType, Dialog& dlgGetNBox)    
{
    if(nRow < 0) // On dialog init, nothing to do
        return false;
    if(ONODETYPE_BROWSECOMBO == nType) {
        vector<string> vs;
        vs.Add("John");vs.Add("Scott");vs.Add("Peter");
        update_combo_from_refresh(myTree.name, vs, UCFB_CLEAR);
        //return true; //if you need to udpate the dialog
        
    }    
    return false;
}
void combo_button()
{
    GETN_BOX(tr)
    GETN_COMBO_REFRESH_BUTTON(name, "Pick a Name","", "Tom")
    if ( GetNBox(tr, "Combo With Refresh Button", NULL, NULL, _test_events))
        printf("You have selected %s\n", tr.name.strVal);
    else
        printf("User Cancel\n");
}

header to Included

GetNbox.h

See Also

GETN_COMBO_BUTTON

getn_combo_refresh_button

Reference