wxMenuBar::SetAutoWindowMenu(
false);
66wxApp::s_macHelpMenuTitleName =
wxT(
"&Help");
98 m_Frame->GetEventHandler()->AddPendingEvent(event);
106wxMenu* menu =
newwxMenu();
109unique_ptr<const wxMenu> c_menu( contributor.
GetMenu() );
111 Merge(*menu, *c_menu);
123wxMenuBar* newBar =
newwxMenuBar();
125wxMenuItemList& items = menu->GetMenuItems();
126 ITERATE( wxMenuItemList, it, items ){
127wxMenuItem* item = *it;
128 if( item->GetSubMenu() ){
129wxMenu* sub_menu =
CloneMenu( *item->GetSubMenu() );
132wxString
label= wxStripMenuCodes(item->GetItemLabelText(), wxStrip_Mnemonics);
133newBar->Append( sub_menu,
label);
139unique_ptr<wxMenuBar> oldBar(
m_Frame->GetMenuBar());
147newBar->MacInstallMenuBar();
158 if(contributor ==
NULL) {
159 ERR_POST(
"CMenuService::AddContributor() - NULL contributor.");
161TContributors::const_iterator it =
167 ERR_POST(
"CMenuService::AddContributor() - contributor already added");
177 if(contributor ==
NULL) {
178 ERR_POST(
"CMenuService::AddContributor() - NULL contributor.");
180TContributors::iterator it =
183 ERR_POST(
"CMenuService::RemoveContributor() - not found");
CUICommandRegistry is a centralized registry where all application commands should be registered.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
virtual void ResetMenuBar()
virtual void ShutDownService()
virtual void AddPendingCommand(int cmd)
add commands for processing (simulates choosing the command from a menu)
virtual void AddContributor(IMenuContributor *contributor)
the service does NOT assume ownership of the contributor
virtual void SetFrame(wxFrame *frame, CUICommandRegistry &cmd_reg)
virtual void RemoveContributor(IMenuContributor *contributor)
CUICommandRegistry * m_CmdReg
virtual void InitService()
TContributors m_Contributors
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static const char label[]
wxEVT_COMMAND_MENU_SELECTED
void Merge(wxMenu &menu_1, const wxMenu &menu_2)
merges all items form menu_2 into menu_1, preserving the structure if possible
wxMenu * CloneMenu(const wxMenu &menu)
create a copy of the given menu
void CleanupSeparators(wxMenu &menu)
Removes extra separators (in the begining or at the end of the menu, ot those that precede other sepa...
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4