| Einhugur Framework for C++ |
|
ContextMenu.Append Method
Use this method to append a menu item to the context menu.
public void Append(
String text,
Boolean enabled,
EventHandler eventHandler)
Parameters
- text
- The text of the menu item.
- enabled
- Set to true if the menu item should be enabled, false if its supposed to be disabled.
- eventHandler
- A pointer to the function that should handle the click event of the MenuItem. Use the MakeDelegate function to create a valid Delegate function pointer (See bellow).
Returns
- void
Remarks
Example:
void MyDialog::calendar_ContextMenuClick(Object* sender,ContextMenu* menu, int x , int y, void* args)
{
menu->Append(CFSTR("Item 1"),true,MakeDelegate(this,&MyDialog::item1_Click));
menu->Append(CFSTR("Item 2"),true,MakeDelegate(this,&MyDialog::item2_Click));
}
See Also
ContextMenu Class