27 #ifndef CONDITIONAL_MENU_H 28 #define CONDITIONAL_MENU_H 38 enum class BITMAPS : unsigned int;
45 static const int ANY_ORDER = -1;
60 int aOrder = ANY_ORDER );
62 void AddItem(
int aId,
const wxString& aText,
const wxString& aTooltip,
BITMAPS aIcon,
77 int aOrder = ANY_ORDER );
97 int aOrder = ANY_ORDER );
125 m_type( ACTION ), m_icon( static_cast<
BITMAPS>( 0 ) ),
126 m_condition( aCondition ),
128 m_isCheckmarkEntry( aCheckmark )
130 m_data.action = aAction;
134 m_type( MENU ), m_icon( static_cast<
BITMAPS>( 0 ) ),
135 m_condition( aCondition ),
137 m_isCheckmarkEntry( false )
144 m_type( WXITEM ), m_icon( aBitmap ),
145 m_condition( aCondition ),
147 m_isCheckmarkEntry( aCheckmark )
149 m_data.wxItem =
new wxMenuItem(
nullptr, aItem.GetId(), aItem.GetItemLabel(),
150 aItem.GetHelp(), aItem.GetKind() );
155 m_type( SEPARATOR ), m_icon( static_cast<
BITMAPS>( 0 ) ),
157 m_condition( aCondition ),
159 m_isCheckmarkEntry( false )
187 assert( m_type == ACTION );
188 return m_data.action;
193 assert( m_type == MENU );
199 assert( m_type == WXITEM );
200 return m_data.wxItem;
205 return m_isCheckmarkEntry;
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
double Evaluate(AM_PARAM_EVAL_STACK &aExp)
Evaluate an basic arithmetic expression (infix notation) with precedence The expression is a sequence...
std::function< bool(const SELECTION &)> SELECTION_CONDITION
< Functor type that checks a specific condition for selected items.
BITMAPS
A list of all bitmap identifiers.