KiCad PCB EDA Suite
Loading...
Searching...
No Matches
TOOLBAR_ITEM_REF Class Reference

Helper class returned by TOOLBAR_CONFIGURATION::AppendAction() to allow chaining of context menu registration. More...

#include <toolbar_configuration.h>

Public Member Functions

 TOOLBAR_ITEM_REF (class TOOLBAR_CONFIGURATION &aParent, TOOLBAR_ITEM &aItem)
 
TOOLBAR_CONFIGURATIONWithContextMenu (TOOLBAR_CONTEXT_MENU_REGISTRY::MENU_FACTORY aFactory)
 Associate a context menu factory with this action.
 
 operator TOOLBAR_CONFIGURATION & ()
 Allow implicit conversion back to TOOLBAR_CONFIGURATION for chaining.
 
TOOLBAR_ITEM_REF AppendAction (const std::string &aActionName)
 
TOOLBAR_ITEM_REF AppendAction (const TOOL_ACTION &aAction)
 
TOOLBAR_CONFIGURATIONAppendSeparator ()
 
TOOLBAR_CONFIGURATIONAppendSpacer (int aSize)
 
TOOLBAR_CONFIGURATIONAppendGroup (const TOOLBAR_GROUP_CONFIG &aGroup)
 
TOOLBAR_CONFIGURATIONAppendControl (const std::string &aControlName)
 
TOOLBAR_CONFIGURATIONAppendControl (const ACTION_TOOLBAR_CONTROL &aControl)
 

Private Attributes

TOOLBAR_CONFIGURATIONm_parent
 
TOOLBAR_ITEMm_item
 

Detailed Description

Helper class returned by TOOLBAR_CONFIGURATION::AppendAction() to allow chaining of context menu registration.

Definition at line 100 of file toolbar_configuration.h.

Constructor & Destructor Documentation

◆ TOOLBAR_ITEM_REF()

TOOLBAR_ITEM_REF::TOOLBAR_ITEM_REF ( class TOOLBAR_CONFIGURATION & aParent,
TOOLBAR_ITEM & aItem )
inline

Definition at line 103 of file toolbar_configuration.h.

References m_item, and m_parent.

Referenced by AppendAction(), and AppendAction().

Member Function Documentation

◆ AppendAction() [1/2]

TOOLBAR_ITEM_REF TOOLBAR_ITEM_REF::AppendAction ( const std::string & aActionName)

Definition at line 231 of file toolbar_configuration.cpp.

References m_parent, and TOOLBAR_ITEM_REF().

◆ AppendAction() [2/2]

TOOLBAR_ITEM_REF TOOLBAR_ITEM_REF::AppendAction ( const TOOL_ACTION & aAction)

Definition at line 237 of file toolbar_configuration.cpp.

References m_parent, and TOOLBAR_ITEM_REF().

◆ AppendControl() [1/2]

TOOLBAR_CONFIGURATION & TOOLBAR_ITEM_REF::AppendControl ( const ACTION_TOOLBAR_CONTROL & aControl)

Definition at line 267 of file toolbar_configuration.cpp.

References m_parent.

◆ AppendControl() [2/2]

TOOLBAR_CONFIGURATION & TOOLBAR_ITEM_REF::AppendControl ( const std::string & aControlName)

Definition at line 261 of file toolbar_configuration.cpp.

References m_parent.

◆ AppendGroup()

TOOLBAR_CONFIGURATION & TOOLBAR_ITEM_REF::AppendGroup ( const TOOLBAR_GROUP_CONFIG & aGroup)

Definition at line 255 of file toolbar_configuration.cpp.

References m_parent.

◆ AppendSeparator()

TOOLBAR_CONFIGURATION & TOOLBAR_ITEM_REF::AppendSeparator ( )

Definition at line 243 of file toolbar_configuration.cpp.

References m_parent.

◆ AppendSpacer()

TOOLBAR_CONFIGURATION & TOOLBAR_ITEM_REF::AppendSpacer ( int aSize)

Definition at line 249 of file toolbar_configuration.cpp.

References m_parent.

◆ operator TOOLBAR_CONFIGURATION &()

TOOLBAR_ITEM_REF::operator TOOLBAR_CONFIGURATION & ( )
inline

Allow implicit conversion back to TOOLBAR_CONFIGURATION for chaining.

Definition at line 122 of file toolbar_configuration.h.

References m_parent.

◆ WithContextMenu()

TOOLBAR_CONFIGURATION & TOOLBAR_ITEM_REF::WithContextMenu ( TOOLBAR_CONTEXT_MENU_REGISTRY::MENU_FACTORY aFactory)

Associate a context menu factory with this action.

The factory is registered globally so JSON-loaded configurations will also get this menu.

Parameters
aFactoryFactory function that creates the context menu
Returns
Reference to parent configuration for continued chaining

Definition at line 220 of file toolbar_configuration.cpp.

References m_item, m_parent, and TOOLBAR_CONTEXT_MENU_REGISTRY::RegisterMenuFactory().

Member Data Documentation

◆ m_item

TOOLBAR_ITEM& TOOLBAR_ITEM_REF::m_item
private

Definition at line 135 of file toolbar_configuration.h.

Referenced by TOOLBAR_ITEM_REF(), and WithContextMenu().

◆ m_parent


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