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

Member Enumeration Documentation

Possible entry types.

Enumerator
ACTION 
MENU 
WXITEM 
SEPARATOR 

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

References m_data.

103  :
104  m_type( ACTION ), m_condition( aCondition ), m_order( aOrder ), m_expand( false )
105  {
106  m_data.action = aAction;
107  }
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::@61 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 109 of file conditional_menu.h.

References m_data.

111  :
112  m_type( MENU ), m_condition( aCondition ), m_order( aOrder ), m_expand( aExpand )
113  {
114  m_data.menu = aMenu;
115  }
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::@61 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 117 of file conditional_menu.h.

References m_data.

118  :
119  m_type( WXITEM ), m_condition( aCondition ), m_order( aOrder ), m_expand( false )
120  {
121  m_data.wxItem = aItem;
122  }
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::@61 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 125 of file conditional_menu.h.

References m_data.

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

Member Function Documentation

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

Definition at line 145 of file conditional_menu.h.

References ACTION, m_data, and m_type.

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

Definition at line 169 of file conditional_menu.h.

References m_condition.

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

Definition at line 163 of file conditional_menu.h.

References m_expand, m_type, and MENU.

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

Definition at line 151 of file conditional_menu.h.

References m_data, m_type, and MENU.

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

Definition at line 174 of file conditional_menu.h.

References m_order.

Referenced by CONDITIONAL_MENU::addEntry().

175  {
176  return m_order;
177  }
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 179 of file conditional_menu.h.

References m_order.

Referenced by CONDITIONAL_MENU::addEntry().

180  {
181  m_order = aOrder;
182  }
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 140 of file conditional_menu.h.

References m_type.

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

Definition at line 157 of file conditional_menu.h.

References m_data, m_type, and WXITEM.

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

Member Data Documentation

const TOOL_ACTION* CONDITIONAL_MENU::ENTRY::action

Definition at line 188 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 194 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 200 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 197 of file conditional_menu.h.

Referenced by Order(), and SetOrder().

ENTRY_TYPE CONDITIONAL_MENU::ENTRY::m_type
private

Definition at line 185 of file conditional_menu.h.

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

CONTEXT_MENU* CONDITIONAL_MENU::ENTRY::menu

Definition at line 189 of file conditional_menu.h.

wxMenuItem* CONDITIONAL_MENU::ENTRY::wxItem

Definition at line 190 of file conditional_menu.h.


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