KiCad PCB EDA Suite
CONDITIONAL_MENU::ENTRY Class Reference

Helper class to organize menu entries.

More...

Public Types

enum  ENTRY_TYPE { ACTION, MENU, WXITEM, SEPARATOR }
 

Possible entry types.

More...
 

Public Member Functions

 ENTRY (const TOOL_ACTION *aAction, SELECTION_CONDITION aCondition, int aOrder, bool aCheckmark)
 
 ENTRY (ACTION_MENU *aMenu, SELECTION_CONDITION aCondition, int aOrder)
 
 ENTRY (wxMenuItem *aItem, const BITMAP_OPAQUE *aWxMenuBitmap, SELECTION_CONDITION aCondition, int aOrder, bool aCheckmark)
 
 ENTRY (SELECTION_CONDITION aCondition, int aOrder)
 
ENTRY_TYPE Type () const
 
const BITMAP_OPAQUE * GetIcon () const
 
const TOOL_ACTIONAction () const
 
ACTION_MENUMenu () const
 
wxMenuItem * wxItem () const
 
bool IsCheckmarkEntry () const
 
const SELECTION_CONDITIONCondition () const
 
int Order () const
 
void SetOrder (int aOrder)
 

Private Attributes

ENTRY_TYPE m_type
 
const BITMAP_OPAQUE * m_icon
 
union {
   const TOOL_ACTION *   action
 
   ACTION_MENU *   menu
 
   wxMenuItem *   wxItem
 
m_data
 
SELECTION_CONDITION m_condition
 

Condition to be fulfilled to show the entry in menu.

More...
 
int m_order
 

Order number, the higher the number the lower position it takes it is in the menu.

More...
 
bool m_isCheckmarkEntry
 

Detailed Description

Helper class to organize menu entries.

Definition at line 141 of file conditional_menu.h.

Member Enumeration Documentation

◆ ENTRY_TYPE

Possible entry types.

Enumerator
ACTION 
MENU 
WXITEM 
SEPARATOR 

Definition at line 183 of file conditional_menu.h.

Constructor & Destructor Documentation

◆ ENTRY() [1/4]

CONDITIONAL_MENU::ENTRY::ENTRY ( const TOOL_ACTION aAction,
SELECTION_CONDITION  aCondition,
int  aOrder,
bool  aCheckmark 
)
inline

Definition at line 144 of file conditional_menu.h.

145  :
146  m_type( ACTION ), m_icon(nullptr),
147  m_condition( aCondition ),
148  m_order( aOrder ),
149  m_isCheckmarkEntry( aCheckmark )
150  {
151  m_data.action = aAction;
152  }
union CONDITIONAL_MENU::ENTRY::@65 m_data
SELECTION_CONDITION m_condition
Condition to be fulfilled to show the entry in menu.
int m_order
Order number, the higher the number the lower position it takes it is in the menu.
const BITMAP_OPAQUE * m_icon

References m_data.

◆ ENTRY() [2/4]

CONDITIONAL_MENU::ENTRY::ENTRY ( ACTION_MENU aMenu,
SELECTION_CONDITION  aCondition,
int  aOrder 
)
inline

Definition at line 154 of file conditional_menu.h.

154  :
155  m_type( MENU ), m_icon(nullptr),
156  m_condition( aCondition ),
157  m_order( aOrder ),
158  m_isCheckmarkEntry( false )
159  {
160  m_data.menu = aMenu;
161  }
union CONDITIONAL_MENU::ENTRY::@65 m_data
SELECTION_CONDITION m_condition
Condition to be fulfilled to show the entry in menu.
int m_order
Order number, the higher the number the lower position it takes it is in the menu.
const BITMAP_OPAQUE * m_icon

References m_data.

◆ ENTRY() [3/4]

CONDITIONAL_MENU::ENTRY::ENTRY ( wxMenuItem *  aItem,
const BITMAP_OPAQUE *  aWxMenuBitmap,
SELECTION_CONDITION  aCondition,
int  aOrder,
bool  aCheckmark 
)
inline

Definition at line 163 of file conditional_menu.h.

164  :
165  m_type( WXITEM ), m_icon( aWxMenuBitmap ),
166  m_condition( aCondition ),
167  m_order( aOrder ),
168  m_isCheckmarkEntry( aCheckmark )
169  {
170  m_data.wxItem = aItem;
171  }
union CONDITIONAL_MENU::ENTRY::@65 m_data
SELECTION_CONDITION m_condition
Condition to be fulfilled to show the entry in menu.
int m_order
Order number, the higher the number the lower position it takes it is in the menu.
const BITMAP_OPAQUE * m_icon

References m_data.

◆ ENTRY() [4/4]

CONDITIONAL_MENU::ENTRY::ENTRY ( SELECTION_CONDITION  aCondition,
int  aOrder 
)
inline

Definition at line 174 of file conditional_menu.h.

174  :
175  m_type( SEPARATOR ), m_icon(nullptr),
176  m_condition( aCondition ),
177  m_order( aOrder ),
178  m_isCheckmarkEntry( false )
179  {
180  }
SELECTION_CONDITION m_condition
Condition to be fulfilled to show the entry in menu.
int m_order
Order number, the higher the number the lower position it takes it is in the menu.
const BITMAP_OPAQUE * m_icon

Member Function Documentation

◆ Action()

const TOOL_ACTION* CONDITIONAL_MENU::ENTRY::Action ( ) const
inline

Definition at line 200 of file conditional_menu.h.

201  {
202  assert( m_type == ACTION );
203  return m_data.action;
204  }
union CONDITIONAL_MENU::ENTRY::@65 m_data

References ACTION, m_data, and m_type.

◆ Condition()

const SELECTION_CONDITION& CONDITIONAL_MENU::ENTRY::Condition ( ) const
inline

Definition at line 223 of file conditional_menu.h.

224  {
225  return m_condition;
226  }
SELECTION_CONDITION m_condition
Condition to be fulfilled to show the entry in menu.

References m_condition.

◆ GetIcon()

const BITMAP_OPAQUE* CONDITIONAL_MENU::ENTRY::GetIcon ( ) const
inline

Definition at line 195 of file conditional_menu.h.

196  {
197  return m_icon;
198  }
const BITMAP_OPAQUE * m_icon

References m_icon.

◆ IsCheckmarkEntry()

bool CONDITIONAL_MENU::ENTRY::IsCheckmarkEntry ( ) const
inline

Definition at line 218 of file conditional_menu.h.

219  {
220  return m_isCheckmarkEntry;
221  }

References m_isCheckmarkEntry.

◆ Menu()

ACTION_MENU* CONDITIONAL_MENU::ENTRY::Menu ( ) const
inline

Definition at line 206 of file conditional_menu.h.

207  {
208  assert( m_type == MENU );
209  return m_data.menu;
210  }
union CONDITIONAL_MENU::ENTRY::@65 m_data

References m_data, m_type, and MENU.

◆ Order()

int CONDITIONAL_MENU::ENTRY::Order ( ) const
inline

Definition at line 228 of file conditional_menu.h.

229  {
230  return m_order;
231  }
int m_order
Order number, the higher the number the lower position it takes it is in the menu.

References m_order.

Referenced by CONDITIONAL_MENU::addEntry().

◆ SetOrder()

void CONDITIONAL_MENU::ENTRY::SetOrder ( int  aOrder)
inline

Definition at line 233 of file conditional_menu.h.

234  {
235  m_order = aOrder;
236  }
int m_order
Order number, the higher the number the lower position it takes it is in the menu.

References m_order.

Referenced by CONDITIONAL_MENU::addEntry().

◆ Type()

ENTRY_TYPE CONDITIONAL_MENU::ENTRY::Type ( ) const
inline

Definition at line 190 of file conditional_menu.h.

191  {
192  return m_type;
193  }

References m_type.

◆ wxItem()

wxMenuItem* CONDITIONAL_MENU::ENTRY::wxItem ( ) const
inline

Definition at line 212 of file conditional_menu.h.

213  {
214  assert( m_type == WXITEM );
215  return m_data.wxItem;
216  }
union CONDITIONAL_MENU::ENTRY::@65 m_data

References m_data, m_type, and WXITEM.

Member Data Documentation

◆ action

const TOOL_ACTION* CONDITIONAL_MENU::ENTRY::action

Definition at line 243 of file conditional_menu.h.

◆ m_condition

SELECTION_CONDITION CONDITIONAL_MENU::ENTRY::m_condition
private

Condition to be fulfilled to show the entry in menu.

Definition at line 249 of file conditional_menu.h.

Referenced by Condition().

◆ m_data

union { ... } CONDITIONAL_MENU::ENTRY::m_data

Referenced by Action(), ENTRY(), Menu(), and wxItem().

◆ m_icon

const BITMAP_OPAQUE* CONDITIONAL_MENU::ENTRY::m_icon
private

Definition at line 240 of file conditional_menu.h.

Referenced by GetIcon().

◆ m_isCheckmarkEntry

bool CONDITIONAL_MENU::ENTRY::m_isCheckmarkEntry
private

Definition at line 254 of file conditional_menu.h.

Referenced by IsCheckmarkEntry().

◆ m_order

int CONDITIONAL_MENU::ENTRY::m_order
private

Order number, the higher the number the lower position it takes it is in the menu.

Definition at line 252 of file conditional_menu.h.

Referenced by Order(), and SetOrder().

◆ m_type

ENTRY_TYPE CONDITIONAL_MENU::ENTRY::m_type
private

Definition at line 239 of file conditional_menu.h.

Referenced by Action(), Menu(), Type(), and wxItem().

◆ menu

ACTION_MENU* CONDITIONAL_MENU::ENTRY::menu

Definition at line 244 of file conditional_menu.h.

◆ wxItem

wxMenuItem* CONDITIONAL_MENU::ENTRY::wxItem

Definition at line 245 of file conditional_menu.h.


The documentation for this class was generated from the following file: