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, SELECTION_CONDITION aCondition, int aOrder, bool aCheckmark)
 
 ENTRY (SELECTION_CONDITION aCondition, int aOrder)
 
ENTRY_TYPE Type () 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
 
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 120 of file conditional_menu.h.

Member Enumeration Documentation

◆ ENTRY_TYPE

Possible entry types.

Enumerator
ACTION 
MENU 
WXITEM 
SEPARATOR 

Definition at line 161 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 123 of file conditional_menu.h.

124  :
125  m_type( ACTION ),
126  m_condition( aCondition ),
127  m_order( aOrder ),
128  m_isCheckmarkEntry( aCheckmark )
129  {
130  m_data.action = aAction;
131  }
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.
union CONDITIONAL_MENU::ENTRY::@66 m_data

References m_data.

◆ ENTRY() [2/4]

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

Definition at line 133 of file conditional_menu.h.

133  :
134  m_type( MENU ),
135  m_condition( aCondition ),
136  m_order( aOrder ),
137  m_isCheckmarkEntry( false )
138  {
139  m_data.menu = aMenu;
140  }
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.
union CONDITIONAL_MENU::ENTRY::@66 m_data

References m_data.

◆ ENTRY() [3/4]

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

Definition at line 142 of file conditional_menu.h.

142  :
143  m_type( WXITEM ),
144  m_condition( aCondition ),
145  m_order( aOrder ),
146  m_isCheckmarkEntry( aCheckmark )
147  {
148  m_data.wxItem = aItem;
149  }
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.
union CONDITIONAL_MENU::ENTRY::@66 m_data

References m_data.

◆ ENTRY() [4/4]

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

Definition at line 152 of file conditional_menu.h.

152  :
153  m_type( SEPARATOR ),
154  m_condition( aCondition ),
155  m_order( aOrder ),
156  m_isCheckmarkEntry( false )
157  {
158  }
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.

Member Function Documentation

◆ Action()

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

Definition at line 173 of file conditional_menu.h.

174  {
175  assert( m_type == ACTION );
176  return m_data.action;
177  }
union CONDITIONAL_MENU::ENTRY::@66 m_data

References ACTION, m_data, and m_type.

◆ Condition()

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

Definition at line 196 of file conditional_menu.h.

197  {
198  return m_condition;
199  }
SELECTION_CONDITION m_condition
Condition to be fulfilled to show the entry in menu.

References m_condition.

◆ IsCheckmarkEntry()

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

Definition at line 191 of file conditional_menu.h.

192  {
193  return m_isCheckmarkEntry;
194  }

References m_isCheckmarkEntry.

◆ Menu()

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

Definition at line 179 of file conditional_menu.h.

180  {
181  assert( m_type == MENU );
182  return m_data.menu;
183  }
union CONDITIONAL_MENU::ENTRY::@66 m_data

References m_data, m_type, and MENU.

◆ Order()

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

Definition at line 201 of file conditional_menu.h.

202  {
203  return m_order;
204  }
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 206 of file conditional_menu.h.

207  {
208  m_order = aOrder;
209  }
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 168 of file conditional_menu.h.

169  {
170  return m_type;
171  }

References m_type.

◆ wxItem()

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

Definition at line 185 of file conditional_menu.h.

186  {
187  assert( m_type == WXITEM );
188  return m_data.wxItem;
189  }
union CONDITIONAL_MENU::ENTRY::@66 m_data

References m_data, m_type, and WXITEM.

Member Data Documentation

◆ action

const TOOL_ACTION* CONDITIONAL_MENU::ENTRY::action

Definition at line 215 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 221 of file conditional_menu.h.

Referenced by Condition().

◆ m_data

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

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

◆ m_isCheckmarkEntry

bool CONDITIONAL_MENU::ENTRY::m_isCheckmarkEntry
private

Definition at line 226 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 224 of file conditional_menu.h.

Referenced by Order(), and SetOrder().

◆ m_type

ENTRY_TYPE CONDITIONAL_MENU::ENTRY::m_type
private

Definition at line 212 of file conditional_menu.h.

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

◆ menu

ACTION_MENU* CONDITIONAL_MENU::ENTRY::menu

Definition at line 216 of file conditional_menu.h.

◆ wxItem

wxMenuItem* CONDITIONAL_MENU::ENTRY::wxItem

Definition at line 217 of file conditional_menu.h.


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