![]() |
KiCad PCB EDA Suite
|
Class that groups generic conditions for editor states. More...
#include <editor_conditions.h>
Public Member Functions | |
EDITOR_CONDITIONS (EDA_BASE_FRAME *aFrame) | |
Create an object to define conditions dependent upon a specific frame. More... | |
SELECTION_CONDITION | ContentModified () |
Create a functor that tests if the content of the frame is modified. More... | |
SELECTION_CONDITION | UndoAvailable () |
Create a functor that tests if there are any items in the undo queue. More... | |
SELECTION_CONDITION | RedoAvailable () |
Create a functor that tests if there are any items in the redo queue. More... | |
SELECTION_CONDITION | Units (EDA_UNITS aUnit) |
Create a functor that tests if the frame has the specified units. More... | |
SELECTION_CONDITION | CurrentTool (const TOOL_ACTION &aTool) |
Create a functor testing if the specified tool is the current active tool in the frame. More... | |
SELECTION_CONDITION | NoActiveTool () |
Create a functor testing if there are no tools active in the frame. More... | |
SELECTION_CONDITION | GridVisible () |
Create a functor testing if the grid is visible in a frame. More... | |
SELECTION_CONDITION | PolarCoordinates () |
Create a functor testing if polar coordinates are current being used. More... | |
SELECTION_CONDITION | FullscreenCursor () |
Create a functor testing if the cursor is full screen in a frame. More... | |
SELECTION_CONDITION | ScriptingConsoleVisible () |
Create a functor testing if the python scripting console window is visible. More... | |
Static Public Member Functions | |
static bool | ShowAlways (const SELECTION &aSelection) |
The default condition function (always returns true). More... | |
static bool | ShowNever (const SELECTION &aSelection) |
Always returns false. More... | |
static bool | NotEmpty (const SELECTION &aSelection) |
Test if there are any items selected. More... | |
static bool | Empty (const SELECTION &aSelection) |
Test if there are no items selected. More... | |
static bool | Idle (const SELECTION &aSelection) |
Test if there no items selected or being edited. More... | |
static bool | IdleSelection (const SELECTION &aSelection) |
Test if all selected items are not being edited. More... | |
static SELECTION_CONDITION | HasType (KICAD_T aType) |
Create a functor that tests if among the selected items there is at least one of a given type. More... | |
static SELECTION_CONDITION | OnlyType (KICAD_T aType) |
Create a functor that tests if the selected items are only of given type. More... | |
static SELECTION_CONDITION | OnlyTypes (const KICAD_T aTypes[]) |
Create a functor that tests if the selected items are only of given types. More... | |
static SELECTION_CONDITION | Count (int aNumber) |
Create a functor that tests if the number of selected items is equal to the value given as parameter. More... | |
static SELECTION_CONDITION | MoreThan (int aNumber) |
Create a functor that tests if the number of selected items is greater than the value given as parameter. More... | |
static SELECTION_CONDITION | LessThan (int aNumber) |
Create a functor that tests if the number of selected items is smaller than the value given as parameter. More... | |
Static Protected Member Functions | |
static bool | contentModifiedFunc (const SELECTION &aSelection, EDA_BASE_FRAME *aFrame) |
< Helper function used by ContentModified(). More... | |
static bool | undoFunc (const SELECTION &aSelection, EDA_BASE_FRAME *aFrame) |
Helper function used by RedoAvailable(). More... | |
static bool | redoFunc (const SELECTION &aSelection, EDA_BASE_FRAME *aFrame) |
Helper function used by Units(). More... | |
static bool | unitsFunc (const SELECTION &aSelection, EDA_BASE_FRAME *aFrame, EDA_UNITS aUnits) |
Helper function used by CurrentTool(). More... | |
static bool | toolFunc (const SELECTION &aSelection, EDA_BASE_FRAME *aFrame, const TOOL_ACTION &aTool) |
Helper function used by NoActiveTool(). More... | |
static bool | noToolFunc (const SELECTION &aSelection, EDA_BASE_FRAME *aFrame) |
Helper function used by GridVisible(). More... | |
static bool | gridFunc (const SELECTION &aSelection, EDA_DRAW_FRAME *aFrame) |
Helper function used by PolarCoordinates(). More... | |
static bool | polarCoordFunc (const SELECTION &aSelection, EDA_DRAW_FRAME *aFrame) |
Helper function used by FullscreenCursor(). More... | |
static bool | cursorFunc (const SELECTION &aSelection, EDA_DRAW_FRAME *aFrame) |
Helper function used by ScriptingConsoleVisible(). More... | |
static bool | consoleVisibleFunc (const SELECTION &aSelection, EDA_DRAW_FRAME *aFrame) |
The frame to apply the conditions to. More... | |
Protected Attributes | |
EDA_BASE_FRAME * | m_frame |
Class that groups generic conditions for editor states.
Definition at line 40 of file editor_conditions.h.
|
inline |
Create an object to define conditions dependent upon a specific frame.
aFrame | is the frame to query for the conditions |
Definition at line 48 of file editor_conditions.h.
|
staticprotected |
The frame to apply the conditions to.
Definition at line 173 of file editor_conditions.cpp.
References EDA_DRAW_FRAME::IsScriptingConsoleVisible().
Referenced by ScriptingConsoleVisible().
SELECTION_CONDITION EDITOR_CONDITIONS::ContentModified | ( | ) |
Create a functor that tests if the content of the frame is modified.
Definition at line 38 of file editor_conditions.cpp.
References contentModifiedFunc().
Referenced by FOOTPRINT_EDIT_FRAME::setupUIConditions(), and CVPCB_MAINFRAME::setupUIConditions().
|
staticprotected |
< Helper function used by ContentModified().
Helper function used by UndoAvailable().
Definition at line 117 of file editor_conditions.cpp.
References EDA_BASE_FRAME::IsContentModified().
Referenced by ContentModified().
|
staticinherited |
Create a functor that tests if the number of selected items is equal to the value given as parameter.
aNumber | is the number of expected items. |
Definition at line 77 of file selection_conditions.cpp.
References SELECTION_CONDITIONS::countFunc().
Referenced by SYMBOL_EDITOR_EDIT_TOOL::Init(), SYMBOL_EDITOR_PIN_TOOL::Init(), SCH_EDIT_TOOL::Init(), PAD_TOOL::Init(), CONVERT_TOOL::Init(), BOARD_INSPECTION_TOOL::Init(), EE_SELECTION_TOOL::Init(), EDIT_TOOL::Init(), and PCB_EDIT_FRAME::setupUIConditions().
SELECTION_CONDITION EDITOR_CONDITIONS::CurrentTool | ( | const TOOL_ACTION & | aTool | ) |
Create a functor testing if the specified tool is the current active tool in the frame.
Definition at line 62 of file editor_conditions.cpp.
References toolFunc().
Referenced by FOOTPRINT_VIEWER_FRAME::setupUIConditions(), DISPLAY_FOOTPRINTS_FRAME::setupUIConditions(), SCH_EDIT_FRAME::setupUIConditions(), PL_EDITOR_FRAME::setupUIConditions(), FOOTPRINT_EDIT_FRAME::setupUIConditions(), SYMBOL_EDIT_FRAME::setupUIConditions(), and GERBVIEW_FRAME::setupUIConditions().
|
staticprotected |
Helper function used by ScriptingConsoleVisible().
Definition at line 167 of file editor_conditions.cpp.
References EDA_DRAW_FRAME::GetGalDisplayOptions(), and KIGFX::GAL_DISPLAY_OPTIONS::m_fullscreenCursor.
Referenced by FullscreenCursor().
|
staticinherited |
Test if there are no items selected.
aSelection | is the selection to be tested. |
Definition at line 41 of file selection_conditions.cpp.
References SELECTION::Empty().
Referenced by PL_SELECTION_TOOL::Init(), and EE_SELECTION_TOOL::Init().
SELECTION_CONDITION EDITOR_CONDITIONS::FullscreenCursor | ( | ) |
Create a functor testing if the cursor is full screen in a frame.
Definition at line 96 of file editor_conditions.cpp.
References cursorFunc().
Referenced by FOOTPRINT_VIEWER_FRAME::setupUIConditions(), DISPLAY_FOOTPRINTS_FRAME::setupUIConditions(), SCH_EDIT_FRAME::setupUIConditions(), PL_EDITOR_FRAME::setupUIConditions(), FOOTPRINT_EDIT_FRAME::setupUIConditions(), SYMBOL_EDIT_FRAME::setupUIConditions(), GERBVIEW_FRAME::setupUIConditions(), and PCB_EDIT_FRAME::setupUIConditions().
|
staticprotected |
Helper function used by PolarCoordinates().
Definition at line 155 of file editor_conditions.cpp.
References EDA_DRAW_FRAME::IsGridVisible().
Referenced by GridVisible().
SELECTION_CONDITION EDITOR_CONDITIONS::GridVisible | ( | ) |
Create a functor testing if the grid is visible in a frame.
Definition at line 74 of file editor_conditions.cpp.
References gridFunc().
Referenced by FOOTPRINT_VIEWER_FRAME::setupUIConditions(), DISPLAY_FOOTPRINTS_FRAME::setupUIConditions(), SYMBOL_VIEWER_FRAME::setupUIConditions(), SCH_EDIT_FRAME::setupUIConditions(), PL_EDITOR_FRAME::setupUIConditions(), FOOTPRINT_EDIT_FRAME::setupUIConditions(), SYMBOL_EDIT_FRAME::setupUIConditions(), GERBVIEW_FRAME::setupUIConditions(), and PCB_EDIT_FRAME::setupUIConditions().
|
staticinherited |
Create a functor that tests if among the selected items there is at least one of a given type.
aType | is the type that is searched. |
Definition at line 59 of file selection_conditions.cpp.
References SELECTION_CONDITIONS::hasTypeFunc().
Referenced by PAD_TOOL::Init().
|
staticinherited |
Test if there no items selected or being edited.
aSelection | is the selection to be tested. |
Definition at line 47 of file selection_conditions.cpp.
References SELECTION::Front(), and EDA_ITEM::GetEditFlags().
Referenced by SYMBOL_EDITOR_EDIT_TOOL::Init(), SCH_EDIT_TOOL::Init(), EE_INSPECTION_TOOL::Init(), EE_SELECTION_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), SCH_EDIT_FRAME::setupUIConditions(), PL_EDITOR_FRAME::setupUIConditions(), FOOTPRINT_EDIT_FRAME::setupUIConditions(), SYMBOL_EDIT_FRAME::setupUIConditions(), and PCB_EDIT_FRAME::setupUIConditions().
|
staticinherited |
Test if all selected items are not being edited.
aSelection | is the selection to be tested. |
Definition at line 53 of file selection_conditions.cpp.
References SELECTION::Front(), and EDA_ITEM::GetEditFlags().
Referenced by SYMBOL_EDITOR_EDIT_TOOL::Init(), SYMBOL_EDITOR_MOVE_TOOL::Init(), and SCH_EDIT_TOOL::Init().
|
staticinherited |
Create a functor that tests if the number of selected items is smaller than the value given as parameter.
aNumber | is the number used for comparison. |
Definition at line 89 of file selection_conditions.cpp.
References SELECTION_CONDITIONS::lessThanFunc().
Referenced by EE_SELECTION_TOOL::Init().
|
staticinherited |
Create a functor that tests if the number of selected items is greater than the value given as parameter.
aNumber | is the number used for comparison. |
Definition at line 83 of file selection_conditions.cpp.
References SELECTION_CONDITIONS::moreThanFunc().
Referenced by SCH_EDIT_TOOL::Init(), CONVERT_TOOL::Init(), ALIGN_DISTRIBUTE_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), FOOTPRINT_EDIT_FRAME::setupUIConditions(), and PCB_EDIT_FRAME::setupUIConditions().
SELECTION_CONDITION EDITOR_CONDITIONS::NoActiveTool | ( | ) |
Create a functor testing if there are no tools active in the frame.
Definition at line 68 of file editor_conditions.cpp.
References noToolFunc().
Referenced by FOOTPRINT_EDIT_FRAME::setupUIConditions(), and PCB_EDIT_FRAME::setupUIConditions().
|
staticinherited |
Test if there are any items selected.
aSelection | is the selection to be tested. |
Definition at line 35 of file selection_conditions.cpp.
References SELECTION::Empty().
Referenced by SYMBOL_EDITOR_EDIT_TOOL::Init(), PL_EDIT_TOOL::Init(), SCH_EDIT_TOOL::Init(), GROUP_TOOL::Init(), BOARD_EDITOR_CONTROL::Init(), PCB_SELECTION_TOOL::Init(), EDIT_TOOL::Init(), and PL_EDITOR_FRAME::setupUIConditions().
|
staticprotected |
Helper function used by GridVisible().
Definition at line 149 of file editor_conditions.cpp.
References TOOLS_HOLDER::ToolStackIsEmpty().
Referenced by NoActiveTool().
|
staticinherited |
Create a functor that tests if the selected items are only of given type.
aType | is the type that is searched. |
Definition at line 65 of file selection_conditions.cpp.
References SELECTION_CONDITIONS::onlyTypeFunc().
Referenced by SYMBOL_EDITOR_PIN_TOOL::Init(), SCH_EDIT_TOOL::Init(), PAD_TOOL::Init(), CONVERT_TOOL::Init(), BOARD_EDITOR_CONTROL::Init(), SCH_MOVE_TOOL::Init(), EE_SELECTION_TOOL::Init(), EDIT_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), and PCB_EDIT_FRAME::setupUIConditions().
|
staticinherited |
Create a functor that tests if the selected items are only of given types.
aTypes | is an array containing types that are searched. It has to be ended with #KICAD_T::EOT as end marker. |
Definition at line 71 of file selection_conditions.cpp.
References SELECTION_CONDITIONS::onlyTypesFunc().
Referenced by SCH_EDIT_TOOL::Init(), CONVERT_TOOL::Init(), BOARD_INSPECTION_TOOL::Init(), EE_SELECTION_TOOL::Init(), EDIT_TOOL::Init(), EDIT_TOOL::Properties(), PCB_EDIT_FRAME::setupUIConditions(), BOARD_EDITOR_CONTROL::TrackWidthDec(), BOARD_EDITOR_CONTROL::TrackWidthInc(), BOARD_EDITOR_CONTROL::ViaSizeDec(), and BOARD_EDITOR_CONTROL::ViaSizeInc().
|
staticprotected |
Helper function used by FullscreenCursor().
Definition at line 161 of file editor_conditions.cpp.
References EDA_DRAW_FRAME::GetShowPolarCoords().
Referenced by PolarCoordinates().
SELECTION_CONDITION EDITOR_CONDITIONS::PolarCoordinates | ( | ) |
Create a functor testing if polar coordinates are current being used.
Definition at line 85 of file editor_conditions.cpp.
References polarCoordFunc().
Referenced by GERBVIEW_FRAME::setupUIConditions(), and PCB_EDIT_FRAME::setupUIConditions().
SELECTION_CONDITION EDITOR_CONDITIONS::RedoAvailable | ( | ) |
Create a functor that tests if there are any items in the redo queue.
Definition at line 50 of file editor_conditions.cpp.
References redoFunc().
Referenced by SCH_EDIT_FRAME::setupUIConditions(), PL_EDITOR_FRAME::setupUIConditions(), FOOTPRINT_EDIT_FRAME::setupUIConditions(), CVPCB_MAINFRAME::setupUIConditions(), SYMBOL_EDIT_FRAME::setupUIConditions(), and PCB_EDIT_FRAME::setupUIConditions().
|
staticprotected |
Helper function used by Units().
Definition at line 129 of file editor_conditions.cpp.
References EDA_BASE_FRAME::GetRedoCommandCount().
Referenced by RedoAvailable().
SELECTION_CONDITION EDITOR_CONDITIONS::ScriptingConsoleVisible | ( | ) |
Create a functor testing if the python scripting console window is visible.
Definition at line 107 of file editor_conditions.cpp.
References consoleVisibleFunc().
Referenced by SCH_EDIT_FRAME::setupUIConditions(), and PCB_EDIT_FRAME::setupUIConditions().
|
inlinestaticinherited |
The default condition function (always returns true).
aSelection | is the selection to be tested. |
Definition at line 77 of file selection_conditions.h.
Referenced by ACTION_CONDITIONS::ACTION_CONDITIONS(), CONDITIONAL_MENU::AddSeparator(), EDA_DRAW_FRAME::AddStandardSubMenus(), ROUTER_TOOL::Init(), LENGTH_TUNER_TOOL::Init(), PL_EDIT_TOOL::Init(), PAD_TOOL::Init(), PL_DRAWING_TOOLS::Init(), EDA_3D_CONTROLLER::Init(), DRAWING_TOOL::Init(), EE_TOOL_BASE< SCH_BASE_FRAME >::Init(), PCB_TOOL_BASE::Init(), PICKER_TOOL::Init(), SCH_EDIT_FRAME::setupUIConditions(), PL_EDITOR_FRAME::setupUIConditions(), FOOTPRINT_EDIT_FRAME::setupUIConditions(), SYMBOL_EDIT_FRAME::setupUIConditions(), PCB_EDIT_FRAME::setupUIConditions(), and SPECIAL_TOOLS_CONTEXT_MENU::SPECIAL_TOOLS_CONTEXT_MENU().
|
inlinestaticinherited |
Always returns false.
aSelection | is the selection to be tested. |
Definition at line 88 of file selection_conditions.h.
Referenced by ACTION_CONDITIONS::ACTION_CONDITIONS(), and PL_EDITOR_FRAME::setupUIConditions().
|
staticprotected |
Helper function used by NoActiveTool().
Definition at line 142 of file editor_conditions.cpp.
References TOOLS_HOLDER::IsCurrentTool().
Referenced by CurrentTool().
SELECTION_CONDITION EDITOR_CONDITIONS::UndoAvailable | ( | ) |
Create a functor that tests if there are any items in the undo queue.
Definition at line 44 of file editor_conditions.cpp.
References undoFunc().
Referenced by SCH_EDIT_FRAME::setupUIConditions(), PL_EDITOR_FRAME::setupUIConditions(), FOOTPRINT_EDIT_FRAME::setupUIConditions(), CVPCB_MAINFRAME::setupUIConditions(), SYMBOL_EDIT_FRAME::setupUIConditions(), and PCB_EDIT_FRAME::setupUIConditions().
|
staticprotected |
Helper function used by RedoAvailable().
Definition at line 123 of file editor_conditions.cpp.
References EDA_BASE_FRAME::GetUndoCommandCount().
Referenced by UndoAvailable().
SELECTION_CONDITION EDITOR_CONDITIONS::Units | ( | EDA_UNITS | aUnit | ) |
Create a functor that tests if the frame has the specified units.
Definition at line 56 of file editor_conditions.cpp.
References unitsFunc().
Referenced by FOOTPRINT_VIEWER_FRAME::setupUIConditions(), DISPLAY_FOOTPRINTS_FRAME::setupUIConditions(), SCH_EDIT_FRAME::setupUIConditions(), PL_EDITOR_FRAME::setupUIConditions(), FOOTPRINT_EDIT_FRAME::setupUIConditions(), SYMBOL_EDIT_FRAME::setupUIConditions(), GERBVIEW_FRAME::setupUIConditions(), and PCB_EDIT_FRAME::setupUIConditions().
|
staticprotected |
Helper function used by CurrentTool().
Definition at line 135 of file editor_conditions.cpp.
References EDA_BASE_FRAME::GetUserUnits().
Referenced by Units().
|
protected |
Definition at line 163 of file editor_conditions.h.