48 vector<wxEvtHandler*>& handlers,
49 const string& anExtPointId,
57 if( aCmdReg ==
NULL ){
62 vector< CIRef<IObjectCmdContributor> > contributors;
66 for(
size_t i = 0;
i < contributors.size();
i++ ){
70 wxMenu* obj_menu = contrib.first;
72 Merge( aMenu, *obj_menu );
75 wxEvtHandler*
handler = contrib.second;
CUICommandRegistry is a centralized registry where all application commands should be registered.
static CUICommandRegistry & GetInstance()
the main instance associated with the application
wxMenu * CreateMenu(const SwxMenuItemRec *items)
create a menu from a static definition (see WX_*_MENU macros)
IObjectCmdContributor - contributes commands applicable to scoped objects.
pair< wxMenu *, wxEvtHandler * > TContribution
virtual TContribution GetMenu(TConstScopedObjects &objects)=0
returns a menu with commands applicable to the objects and optional command handler for the commands ...
void(*)(CSeq_entry_Handle seh, IWorkbench *wb, const CSerialObject &obj) handler
void GetExtensionAsInterface(const string &ext_point_id, vector< CIRef< I > > &interfaces)
GetExtensionAsInterface() is a helper function that extracts all extensions implementing the specifie...
vector< SConstScopedObject > TConstScopedObjects
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
void AddCommandsForScopedObjects(wxMenu &aMenu, vector< wxEvtHandler * > &handlers, const string &anExtPointId, TConstScopedObjects &objects, CUICommandRegistry *aCmdReg)
Helper function for adding commands provided by contributors to the menu.
wxMenu * CreateContextMenuBackbone()
#define WX_DEFINE_MENU(name)
New macros for defining menus for use with CUICommandRegistry.
#define WX_MENU_SEPARATOR_L(label)
void Merge(wxMenu &menu_1, const wxMenu &menu_2)
merges all items form menu_2 into menu_1, preserving the structure if possible