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, const SELECTION_CONDITION &aCondition=SELECTION_CONDITIONS::ShowAlways, int aOrder=ANY_ORDER)
 
 ENTRY (CONTEXT_MENU *aMenu, bool aExpand=false, const SELECTION_CONDITION &aCondition=SELECTION_CONDITIONS::ShowAlways, int aOrder=ANY_ORDER)
 
 ENTRY (wxMenuItem *aItem, const SELECTION_CONDITION &aCondition=SELECTION_CONDITIONS::ShowAlways, int aOrder=ANY_ORDER)
 
 ENTRY (const SELECTION_CONDITION &aCondition=SELECTION_CONDITIONS::ShowAlways, int aOrder=ANY_ORDER)
 
ENTRY_TYPE Type () const
 
const TOOL_ACTIONAction () const
 
CONTEXT_MENUMenu () const
 
wxMenuItem * wxItem () const
 
bool Expand () const
 
const SELECTION_CONDITIONCondition () const
 
int Order () const
 
void SetOrder (int aOrder)
 

Private Attributes

ENTRY_TYPE m_type
 
union {
   const TOOL_ACTION *   action
 
   CONTEXT_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_expand
 

CONTEXT_MENU expand flag

More...
 

Detailed Description

Helper class to organize menu entries.

Definition at line 99 of file conditional_menu.h.

Member Enumeration Documentation

Possible entry types.

Enumerator
ACTION 
MENU 
WXITEM 
SEPARATOR 

Definition at line 134 of file conditional_menu.h.

Constructor & Destructor Documentation

CONDITIONAL_MENU::ENTRY::ENTRY ( const TOOL_ACTION aAction,
const SELECTION_CONDITION aCondition = SELECTION_CONDITIONS::ShowAlways,
int  aOrder = ANY_ORDER 
)
inline

Definition at line 102 of file conditional_menu.h.

References m_data.

104  :
105  m_type( ACTION ), m_condition( aCondition ), m_order( aOrder ), m_expand( false )
106  {
107  m_data.action = aAction;
108  }
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::@56 m_data
bool m_expand
CONTEXT_MENU expand flag
CONDITIONAL_MENU::ENTRY::ENTRY ( CONTEXT_MENU aMenu,
bool  aExpand = false,
const SELECTION_CONDITION aCondition = SELECTION_CONDITIONS::ShowAlways,
int  aOrder = ANY_ORDER 
)
inline

Definition at line 110 of file conditional_menu.h.

References m_data.

112  :
113  m_type( MENU ), m_condition( aCondition ), m_order( aOrder ), m_expand( aExpand )
114  {
115  m_data.menu = aMenu;
116  }
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::@56 m_data
bool m_expand
CONTEXT_MENU expand flag
CONDITIONAL_MENU::ENTRY::ENTRY ( wxMenuItem *  aItem,
const SELECTION_CONDITION aCondition = SELECTION_CONDITIONS::ShowAlways,
int  aOrder = ANY_ORDER 
)
inline

Definition at line 118 of file conditional_menu.h.

References m_data.

119  :
120  m_type( WXITEM ), m_condition( aCondition ), m_order( aOrder ), m_expand( false )
121  {
122  m_data.wxItem = aItem;
123  }
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::@56 m_data
bool m_expand
CONTEXT_MENU expand flag
CONDITIONAL_MENU::ENTRY::ENTRY ( const SELECTION_CONDITION aCondition = SELECTION_CONDITIONS::ShowAlways,
int  aOrder = ANY_ORDER 
)
inline

Definition at line 126 of file conditional_menu.h.

References m_data.

127  :
128  m_type( SEPARATOR ), m_condition( aCondition ), m_order( aOrder ), m_expand( false )
129  {
130  m_data.wxItem = NULL;
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::@56 m_data
bool m_expand
CONTEXT_MENU expand flag

Member Function Documentation

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

Definition at line 146 of file conditional_menu.h.

References ACTION, m_data, and m_type.

147  {
148  assert( m_type == ACTION );
149  return m_data.action;
150  }
union CONDITIONAL_MENU::ENTRY::@56 m_data
const SELECTION_CONDITION& CONDITIONAL_MENU::ENTRY::Condition ( ) const
inline

Definition at line 170 of file conditional_menu.h.

References m_condition.

171  {
172  return m_condition;
173  }
SELECTION_CONDITION m_condition
Condition to be fulfilled to show the entry in menu.
bool CONDITIONAL_MENU::ENTRY::Expand ( ) const
inline

Definition at line 164 of file conditional_menu.h.

References m_expand, m_type, and MENU.

165  {
166  assert( m_type == MENU );
167  return m_expand;
168  }
bool m_expand
CONTEXT_MENU expand flag
CONTEXT_MENU* CONDITIONAL_MENU::ENTRY::Menu ( ) const
inline

Definition at line 152 of file conditional_menu.h.

References m_data, m_type, and MENU.

153  {
154  assert( m_type == MENU );
155  return m_data.menu;
156  }
union CONDITIONAL_MENU::ENTRY::@56 m_data
int CONDITIONAL_MENU::ENTRY::Order ( ) const
inline

Definition at line 175 of file conditional_menu.h.

References m_order.

Referenced by CONDITIONAL_MENU::addEntry().

176  {
177  return m_order;
178  }
int m_order
Order number, the higher the number the lower position it takes it is in the menu.
void CONDITIONAL_MENU::ENTRY::SetOrder ( int  aOrder)
inline

Definition at line 180 of file conditional_menu.h.

References m_order.

Referenced by CONDITIONAL_MENU::addEntry().

181  {
182  m_order = aOrder;
183  }
int m_order
Order number, the higher the number the lower position it takes it is in the menu.
ENTRY_TYPE CONDITIONAL_MENU::ENTRY::Type ( ) const
inline

Definition at line 141 of file conditional_menu.h.

References m_type.

142  {
143  return m_type;
144  }
wxMenuItem* CONDITIONAL_MENU::ENTRY::wxItem ( ) const
inline

Definition at line 158 of file conditional_menu.h.

References m_data, m_type, and WXITEM.

159  {
160  assert( m_type == WXITEM );
161  return m_data.wxItem;
162  }
union CONDITIONAL_MENU::ENTRY::@56 m_data

Member Data Documentation

const TOOL_ACTION* CONDITIONAL_MENU::ENTRY::action

Definition at line 189 of file conditional_menu.h.

SELECTION_CONDITION CONDITIONAL_MENU::ENTRY::m_condition
private

Condition to be fulfilled to show the entry in menu.

Definition at line 195 of file conditional_menu.h.

Referenced by Condition().

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

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

bool CONDITIONAL_MENU::ENTRY::m_expand
private

CONTEXT_MENU expand flag

Definition at line 201 of file conditional_menu.h.

Referenced by Expand().

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 198 of file conditional_menu.h.

Referenced by Order(), and SetOrder().

ENTRY_TYPE CONDITIONAL_MENU::ENTRY::m_type
private

Definition at line 186 of file conditional_menu.h.

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

CONTEXT_MENU* CONDITIONAL_MENU::ENTRY::menu

Definition at line 190 of file conditional_menu.h.

wxMenuItem* CONDITIONAL_MENU::ENTRY::wxItem

Definition at line 191 of file conditional_menu.h.


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