KiCad PCB EDA Suite
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_CONDITIONSShow (const SELECTION_CONDITION &aCondition)
 

Public Attributes

SELECTION_CONDITION checkCondition
 Returns true if the UI control should be checked. More...
 
SELECTION_CONDITION enableCondition
 Returns true if the UI control should be enabled. More...
 
SELECTION_CONDITION showCondition
 Returns true if the UI control should be shown. More...
 

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 determing the state of a toggled toolbar item (the item is toggled when the condition is true).

Definition at line 46 of file action_manager.h.

Constructor & Destructor Documentation

◆ ACTION_CONDITIONS()

ACTION_CONDITIONS::ACTION_CONDITIONS ( )
inline

Definition at line 52 of file action_manager.h.

53  {
54  checkCondition = SELECTION_CONDITIONS::ShowNever; // Never check by default
55  enableCondition = SELECTION_CONDITIONS::ShowAlways; // Always enable by default
56  showCondition = SELECTION_CONDITIONS::ShowAlways; // Always show by default
57  }
SELECTION_CONDITION showCondition
Returns true if the UI control should be shown.
static bool ShowAlways(const SELECTION &aSelection)
The default condition function (always returns true).
SELECTION_CONDITION enableCondition
Returns true if the UI control should be enabled.
SELECTION_CONDITION checkCondition
Returns true if the UI control should be checked.
static bool ShowNever(const SELECTION &aSelection)
Always returns false.

References checkCondition, enableCondition, SELECTION_CONDITIONS::ShowAlways(), showCondition, and SELECTION_CONDITIONS::ShowNever().

Member Function Documentation

◆ Check()

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

Definition at line 59 of file action_manager.h.

60  {
61  checkCondition = aCondition;
62  return *this;
63  }
SELECTION_CONDITION checkCondition
Returns true if the UI control should be checked.

References checkCondition.

Referenced by EDA_BASE_FRAME::setupUIConditions().

◆ Enable()

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

Definition at line 65 of file action_manager.h.

66  {
67  enableCondition = aCondition;
68  return *this;
69  }
SELECTION_CONDITION enableCondition
Returns true if the UI control should be enabled.

References enableCondition.

Referenced by KICAD_MANAGER_FRAME::ReCreateMenuBar(), PL_EDITOR_FRAME::ReCreateMenuBar(), SCH_EDIT_FRAME::ReCreateMenuBar(), PCB_EDIT_FRAME::ReCreateMenuBar(), and KICAD_MANAGER_FRAME::setupUIConditions().

◆ Show()

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

Definition at line 71 of file action_manager.h.

72  {
73  showCondition = aCondition;
74  return *this;
75  }
SELECTION_CONDITION showCondition
Returns true if the UI control should be shown.

References showCondition.

Member Data Documentation

◆ checkCondition

SELECTION_CONDITION ACTION_CONDITIONS::checkCondition

Returns true if the UI control should be checked.

Definition at line 48 of file action_manager.h.

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

◆ enableCondition

SELECTION_CONDITION ACTION_CONDITIONS::enableCondition

Returns true if the UI control should be enabled.

Definition at line 49 of file action_manager.h.

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

◆ showCondition

SELECTION_CONDITION ACTION_CONDITIONS::showCondition

Returns true if the UI control should be shown.

Definition at line 50 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: