51 wxASSERT( aAction.
GetId() > 0 );
59 wxASSERT( aAction.
GetId() > 0 );
68 wxMenuItem item(
nullptr, aId, aText, aTooltip, wxITEM_NORMAL );
81 wxMenuItem item(
nullptr, aId, aText, aTooltip, wxITEM_CHECK );
122 if( conditionalMenu )
139 wxMenuItem* menuItem =
nullptr;
143 result = cond( aSelection );
145 catch( std::exception& )
153 switch( entry.Type() )
156 Add( *entry.Action(), entry.IsCheckmarkEntry() );
161 entry.Menu()->UpdateTitle();
162 Add( entry.Menu()->Clone() );
167 menuItem =
new wxMenuItem(
this,
168 entry.wxItem()->GetId(),
169 wxGetTranslation( entry.wxItem()->GetItemLabel() ),
170 wxGetTranslation( entry.wxItem()->GetHelp() ),
171 entry.wxItem()->GetKind() );
173 if( !!entry.GetIcon() )
203 if( conditionalMenu )
204 conditionalMenu->
Evaluate( aSelection );
211 if( aEntry.
Order() < 0 )
214 std::list<ENTRY>::iterator it =
m_entries.begin();
239 m_data.wxItem =
new wxMenuItem(
nullptr,
255 if( WXITEM == m_type )
256 delete m_data.wxItem;
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
BITMAPS
A list of all bitmap identifiers.
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
KICOMMON_API void AddBitmapToMenuItem(wxMenuItem *aMenu, const wxBitmapBundle &aImage)
Add a bitmap to a menuitem.
std::function< bool(const SELECTION &)> SELECTION_CONDITION
Functor type that checks a specific condition for selected items.
Functions to provide common constants and other functions to assist in making a consistent UI.