// Need to uninstall accelerator FXMenuCommand::~FXMenuCommand(){ FXAccelTable *table; FXWindow *own; if(acckey){ own=getShell()->getOwner(); if(own){ table=own->getAccelTable(); if(table){ table->removeAccel(acckey); } } } }
// Command menu item FXMenuCommand::FXMenuCommand(FXComposite* p,const FXString& text,FXIcon* ic,FXObject* tgt,FXSelector sel,FXuint opts): FXMenuCaption(p,text,ic,opts){ FXAccelTable *table; FXWindow *own; flags|=FLAG_ENABLED; defaultCursor=getApp()->getDefaultCursor(DEF_RARROW_CURSOR); target=tgt; message=sel; accel=text.section('\t',1); acckey=parseAccel(accel); if(acckey){ own=getShell()->getOwner(); if(own){ table=own->getAccelTable(); if(table){ table->addAccel(acckey,this,FXSEL(SEL_COMMAND,ID_ACCEL)); } } } }