List on String Edit/Context()

As shown in the below Images: Upon right click on field we get the desired list to select from it, on overriding the context()
method of the string field on form.

context

On selecting any of the element(ENUM) in list, we can further manipulate it.

contextpatient

Create An Enum with the desired elements :


public void context()
{
int selMenu,id;
DictEnum dEnum= new DictEnum(enumName2Id('TemplateEnum'));
PopupMenu menu;
menu = new PopupMenu(element.hWnd());

for(id=0; id<=dEnum.values()-1;id++)
{

menu.insertItem(dEnum.value2Name(id));
}

selMenu = menu.draw();

switch(selMenu)
{

case enum2int( TemplateEnum::Doctor) +2:
Template_Text.text(Template_Text.text()+enum2str(TemplateEnum::Doctor));
break;

case enum2int( TemplateEnum::Patient) +2:
Template_Text.text(Template_Text.text()+enum2str(TemplateEnum::Patient));
break;

case enum2int( TemplateEnum::Visiter) +2:
Template_Text.text(Template_Text.text()+enum2str(TemplateEnum::Visiter));
break;
}
}