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;
}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s