KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ACTION_CONDITIONS Struct Reference

Functors that can be used to figure out how the action controls should be displayed in the UI and if an action should be enabled given the current selection. More...

#include <action_manager.h>

Public Member Functions

 ACTION_CONDITIONS ()
 
ACTION_CONDITIONSCheck (const SELECTION_CONDITION &aCondition)
 
ACTION_CONDITIONSEnable (const SELECTION_CONDITION &aCondition)
 
ACTION_CONDITIONSHotkeyEnable (const SELECTION_CONDITION &aCondition)
 Set a separate condition for direct command dispatch (hotkeys and navlib buttons).
 
ACTION_CONDITIONSShow (const SELECTION_CONDITION &aCondition)
 
const SELECTION_CONDITIONGetHotkeyCondition () const
 Return the condition that direct command dispatch should use, falling back to enableCondition when no separate dispatch condition has been set.
 

Public Attributes

SELECTION_CONDITION checkCondition
 Returns true if the UI control should be checked.
 
SELECTION_CONDITION enableCondition
 Returns true if the UI control should be enabled.
 
SELECTION_CONDITION showCondition
 Returns true if the UI control should be shown.
 
std::optional< SELECTION_CONDITIONhotkeyCondition
 Optional separate condition for hotkey dispatch (when empty, enableCondition is used)
 

Detailed Description

Functors that can be used to figure out how the action controls should be displayed in the UI and if an action should be enabled given the current selection.

Note
checkCondition is also used for determining the state of a toggled toolbar item (the item is toggled when the condition is true).

Definition at line 47 of file action_manager.h.

Constructor & Destructor Documentation

◆ ACTION_CONDITIONS()

ACTION_CONDITIONS::ACTION_CONDITIONS ( )
inline

Member Function Documentation

◆ Check()

ACTION_CONDITIONS & ACTION_CONDITIONS::Check ( const SELECTION_CONDITION & aCondition)
inline

Definition at line 56 of file action_manager.h.

References ACTION_CONDITIONS(), and checkCondition.

Referenced by EDA_BASE_FRAME::setupUIConditions().

◆ Enable()

◆ GetHotkeyCondition()

const SELECTION_CONDITION & ACTION_CONDITIONS::GetHotkeyCondition ( ) const
inline

Return the condition that direct command dispatch should use, falling back to enableCondition when no separate dispatch condition has been set.

Definition at line 89 of file action_manager.h.

References enableCondition, and hotkeyCondition.

Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ HotkeyEnable()

ACTION_CONDITIONS & ACTION_CONDITIONS::HotkeyEnable ( const SELECTION_CONDITION & aCondition)
inline

Set a separate condition for direct command dispatch (hotkeys and navlib buttons).

When set, it is used instead of enableCondition, allowing menu items to appear disabled while the action still fires for immediate-mode operations like rotate and mirror.

Definition at line 73 of file action_manager.h.

References ACTION_CONDITIONS(), and hotkeyCondition.

Referenced by BOOST_AUTO_TEST_CASE().

◆ Show()

ACTION_CONDITIONS & ACTION_CONDITIONS::Show ( const SELECTION_CONDITION & aCondition)
inline

Definition at line 79 of file action_manager.h.

References ACTION_CONDITIONS(), and showCondition.

Member Data Documentation

◆ checkCondition

SELECTION_CONDITION ACTION_CONDITIONS::checkCondition

Returns true if the UI control should be checked.

Definition at line 97 of file action_manager.h.

Referenced by ACTION_CONDITIONS(), Check(), and EDA_BASE_FRAME::HandleUpdateUIEvent().

◆ enableCondition

◆ hotkeyCondition

std::optional<SELECTION_CONDITION> ACTION_CONDITIONS::hotkeyCondition

Optional separate condition for hotkey dispatch (when empty, enableCondition is used)

Definition at line 102 of file action_manager.h.

Referenced by GetHotkeyCondition(), and HotkeyEnable().

◆ showCondition

SELECTION_CONDITION ACTION_CONDITIONS::showCondition

Returns true if the UI control should be shown.

Definition at line 99 of file action_manager.h.

Referenced by ACTION_CONDITIONS(), EDA_BASE_FRAME::HandleUpdateUIEvent(), and Show().


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