21) : GroupItem{ stringId }
42 : pUserData{ pUserData_ } {}
46 void Popup( wxWindow &window,
const wxPoint &pos )
override;
60 std::make_unique<PopupMenuImpl>(mMenu->pUserData);
61 mMenu = newMenu.get();
62 mMenus.push_back(std::move(newMenu));
70 mMenu->Append(
entry.id,
entry.caption.Translation());
75 mMenu->AppendRadioItem(
entry.id,
entry.caption.Translation());
80 mMenu->AppendCheckItem(
entry.id,
entry.caption.Translation());
90 entry.handler.InitUserData(mpUserData);
101 auto subMenu = std::move(mMenus.back());
103 mMenu = mMenus.empty() ? mRoot : mMenus.back().get();
109 mMenu->AppendSeparator();
114 , mpUserData{ pUserData }
117 std::vector< std::unique_ptr<PopupMenuImpl> >
mMenus;
122PopupMenuImpl::~PopupMenuImpl()
129void PopupMenuImpl::Popup( wxWindow &window,
const wxPoint &pos )
139 auto &theMenu =
dynamic_cast<PopupMenuImpl&
>(menu);
141 PopupMenuBuilder visitor{ table, theMenu, theMenu.pUserData };
151 Append( std::make_unique<Entry>(
152 stringId, type,
id,
string, memFn, *
this, init ) );
157 auto uSection = std::make_unique< PopupMenuSection >(
name );
158 auto section = uSection.get();
159 mStack.back()->push_back( std::move( uSection ) );
160 mStack.push_back( section );
173 auto theMenu = std::make_unique<PopupMenuImpl>( pUserData );
static ProjectFileIORegistry::AttributeWriterEntry entry
void Popup(const BasicUI::WindowPlacement &window, const Point &pos={})
Display the menu at pos, invoke at most one action, then hide it.
An explicitly nonlocalized string, not meant for the user to see.
Holds a msgid for the translation catalog; may also bind format arguments.
wxString Translation() const
void VisitWithFunctions(const VisitorFunctions< RegistryTraits > &visitors, const GroupItem< RegistryTraits > *pTopItem, const GroupItem< RegistryTraits > *pRegistry={}, typename RegistryTraits::ComputedItemContextType &computedItemContext=RegistryTraits::ComputedItemContextType::Instance)