KiCad PCB EDA Suite
PCB_EDITOR_CONDITIONS Class Reference

Group generic conditions for PCB editor states. More...

#include <pcb_editor_conditions.h>

Inheritance diagram for PCB_EDITOR_CONDITIONS:
EDITOR_CONDITIONS SELECTION_CONDITIONS

Public Member Functions

 PCB_EDITOR_CONDITIONS (PCB_BASE_FRAME *aFrame)
 
SELECTION_CONDITION HasItems ()
 Create a functor that tests if there are items in the board. More...
 
SELECTION_CONDITION PadNumbersDisplay ()
 Create a functor that tests if the pad numbers are displayed. More...
 
SELECTION_CONDITION PadFillDisplay ()
 Create a functor that tests if the frame fills the pads. More...
 
SELECTION_CONDITION TextFillDisplay ()
 Create a functor that tests if the frame fills text items. More...
 
SELECTION_CONDITION GraphicsFillDisplay ()
 Create a functor that tests if the frame fills graphics items. More...
 
SELECTION_CONDITION ViaFillDisplay ()
 Create a functor that tests if the frame fills vias. More...
 
SELECTION_CONDITION TrackFillDisplay ()
 Create a functor that tests if the frame fills tracks. More...
 
SELECTION_CONDITION ZoneDisplayMode (ZONE_DISPLAY_MODE aMode)
 Create a functor that tests the current zone display mode in the frame. More...
 
SELECTION_CONDITION Get45degMode ()
 Create a functor that tests whether only 45 degree lines should be allowed. 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 hasItemsFunc (const SELECTION &aSelection, PCB_BASE_FRAME *aFrame)
 < Helper function used by HasItems() More...
 
static bool padNumberDisplayFunc (const SELECTION &aSelection, PCB_BASE_FRAME *aFrame)
 Helper function used by PadFillDisplay() More...
 
static bool padFillDisplayFunc (const SELECTION &aSelection, PCB_BASE_FRAME *aFrame)
 Helper function used by TextFillDisplay() More...
 
static bool textFillDisplayFunc (const SELECTION &aSelection, PCB_BASE_FRAME *aFrame)
 Helper function used by GraphicsFillDisplay() More...
 
static bool graphicsFillDisplayFunc (const SELECTION &aSelection, PCB_BASE_FRAME *aFrame)
 Helper function used by ViaFillDisplay() More...
 
static bool viaFillDisplayFunc (const SELECTION &aSelection, PCB_BASE_FRAME *aFrame)
 Helper function used by TrackFillDisplay() More...
 
static bool trackFillDisplayFunc (const SELECTION &aSelection, PCB_BASE_FRAME *aFrame)
 Helper function used by ZoneDisplayMode() More...
 
static bool zoneDisplayModeFunc (const SELECTION &aSelection, PCB_BASE_FRAME *aFrame, ZONE_DISPLAY_MODE aMode)
 Helper function used by Line45degMode() More...
 
static bool get45degModeFunc (const SELECTION &aSelection, PCB_BASE_FRAME *aFrame)
 
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_FRAMEm_frame
 

Detailed Description

Group generic conditions for PCB editor states.

Definition at line 41 of file pcb_editor_conditions.h.

Constructor & Destructor Documentation

◆ PCB_EDITOR_CONDITIONS()

PCB_EDITOR_CONDITIONS::PCB_EDITOR_CONDITIONS ( PCB_BASE_FRAME aFrame)
inline

Definition at line 44 of file pcb_editor_conditions.h.

44  :
45  EDITOR_CONDITIONS( aFrame )
46  {}
EDITOR_CONDITIONS(EDA_BASE_FRAME *aFrame)
Create an object to define conditions dependent upon a specific frame.

Member Function Documentation

◆ consoleVisibleFunc()

bool EDITOR_CONDITIONS::consoleVisibleFunc ( const SELECTION aSelection,
EDA_DRAW_FRAME aFrame 
)
staticprotectedinherited

The frame to apply the conditions to.

Definition at line 173 of file editor_conditions.cpp.

174 {
175  return aFrame->IsScriptingConsoleVisible();
176 }
bool IsScriptingConsoleVisible()
Gets the current visibility of the scripting console window.

References EDA_DRAW_FRAME::IsScriptingConsoleVisible().

Referenced by EDITOR_CONDITIONS::ScriptingConsoleVisible().

◆ ContentModified()

SELECTION_CONDITION EDITOR_CONDITIONS::ContentModified ( )
inherited

Create a functor that tests if the content of the frame is modified.

Returns
Functor testing for modified content.

Definition at line 38 of file editor_conditions.cpp.

39 {
40  return std::bind( &EDITOR_CONDITIONS::contentModifiedFunc, _1, m_frame );
41 }
static bool contentModifiedFunc(const SELECTION &aSelection, EDA_BASE_FRAME *aFrame)
< Helper function used by ContentModified().
EDA_BASE_FRAME * m_frame

References EDITOR_CONDITIONS::contentModifiedFunc().

Referenced by FOOTPRINT_EDIT_FRAME::setupUIConditions(), and CVPCB_MAINFRAME::setupUIConditions().

◆ contentModifiedFunc()

bool EDITOR_CONDITIONS::contentModifiedFunc ( const SELECTION aSelection,
EDA_BASE_FRAME aFrame 
)
staticprotectedinherited

< Helper function used by ContentModified().

Helper function used by UndoAvailable().

Definition at line 117 of file editor_conditions.cpp.

118 {
119  return aFrame->IsContentModified();
120 }
virtual bool IsContentModified() const
Get if the contents of the frame have been modified since the last save.

References EDA_BASE_FRAME::IsContentModified().

Referenced by EDITOR_CONDITIONS::ContentModified().

◆ Count()

SELECTION_CONDITION SELECTION_CONDITIONS::Count ( int  aNumber)
staticinherited

Create a functor that tests if the number of selected items is equal to the value given as parameter.

Parameters
aNumberis the number of expected items.
Returns
Functor testing if the number of selected items is equal aNumber.

Definition at line 77 of file selection_conditions.cpp.

78 {
79  return std::bind( &SELECTION_CONDITIONS::countFunc, _1, aNumber );
80 }
static bool countFunc(const SELECTION &aSelection, int aNumber)
Helper function used by MoreThan()

References SELECTION_CONDITIONS::countFunc().

Referenced by SYMBOL_EDITOR_EDIT_TOOL::Init(), SYMBOL_EDITOR_PIN_TOOL::Init(), SCH_EDIT_TOOL::Init(), EE_INSPECTION_TOOL::Init(), PAD_TOOL::Init(), CONVERT_TOOL::Init(), BOARD_INSPECTION_TOOL::Init(), EE_SELECTION_TOOL::Init(), EDIT_TOOL::Init(), and PCB_EDIT_FRAME::setupUIConditions().

◆ CurrentTool()

SELECTION_CONDITION EDITOR_CONDITIONS::CurrentTool ( const TOOL_ACTION aTool)
inherited

Create a functor testing if the specified tool is the current active tool in the frame.

Returns
Functor testing the current tool of a frame.

Definition at line 62 of file editor_conditions.cpp.

63 {
64  return std::bind( &EDITOR_CONDITIONS::toolFunc, _1, m_frame, std::cref( aTool ) );
65 }
EDA_BASE_FRAME * m_frame
static bool toolFunc(const SELECTION &aSelection, EDA_BASE_FRAME *aFrame, const TOOL_ACTION &aTool)
Helper function used by NoActiveTool().

References EDITOR_CONDITIONS::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().

◆ cursorFunc()

bool EDITOR_CONDITIONS::cursorFunc ( const SELECTION aSelection,
EDA_DRAW_FRAME aFrame 
)
staticprotectedinherited

Helper function used by ScriptingConsoleVisible().

Definition at line 167 of file editor_conditions.cpp.

168 {
169  return aFrame->GetGalDisplayOptions().m_fullscreenCursor;
170 }
KIGFX::GAL_DISPLAY_OPTIONS & GetGalDisplayOptions()
Return a reference to the gal rendering options used by GAL for rendering.
bool m_fullscreenCursor
Force cursor display.

References EDA_DRAW_FRAME::GetGalDisplayOptions(), and KIGFX::GAL_DISPLAY_OPTIONS::m_fullscreenCursor.

Referenced by EDITOR_CONDITIONS::FullscreenCursor().

◆ Empty()

bool SELECTION_CONDITIONS::Empty ( const SELECTION aSelection)
staticinherited

Test if there are no items selected.

Parameters
aSelectionis the selection to be tested.
Returns
True if there are no items selected.

Definition at line 41 of file selection_conditions.cpp.

42 {
43  return aSelection.Empty();
44 }
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:98

References SELECTION::Empty().

Referenced by PL_SELECTION_TOOL::Init(), and EE_SELECTION_TOOL::Init().

◆ FullscreenCursor()

SELECTION_CONDITION EDITOR_CONDITIONS::FullscreenCursor ( )
inherited

Create a functor testing if the cursor is full screen in a frame.

Note
This requires the frame passed into the constructor be be derived from EDA_DRAW_FRAME.
Returns
Functor testing if the cursor is full screen

Definition at line 96 of file editor_conditions.cpp.

97 {
98  // The fullscreen cursor requires a draw frame
99  EDA_DRAW_FRAME* drwFrame = dynamic_cast<EDA_DRAW_FRAME*>( m_frame );
100 
101  wxASSERT( drwFrame );
102 
103  return std::bind( &EDITOR_CONDITIONS::cursorFunc, _1, drwFrame );
104 }
The base class for create windows for drawing purpose.
static bool cursorFunc(const SELECTION &aSelection, EDA_DRAW_FRAME *aFrame)
Helper function used by ScriptingConsoleVisible().
EDA_BASE_FRAME * m_frame

References EDITOR_CONDITIONS::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().

◆ Get45degMode()

SELECTION_CONDITION PCB_EDITOR_CONDITIONS::Get45degMode ( )

Create a functor that tests whether only 45 degree lines should be allowed.

Returns
Functor returning true if only 45 degree lines should be allowed

Definition at line 126 of file pcb_editor_conditions.cpp.

127 {
128  PCB_BASE_FRAME* drwFrame = dynamic_cast<PCB_BASE_FRAME*>( m_frame );
129 
130  wxASSERT( drwFrame );
131 
132  return std::bind( &PCB_EDITOR_CONDITIONS::get45degModeFunc, _1, drwFrame );
133 }
EDA_BASE_FRAME * m_frame
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
static bool get45degModeFunc(const SELECTION &aSelection, PCB_BASE_FRAME *aFrame)

References get45degModeFunc(), and APPEARANCE_CONTROLS::m_frame.

Referenced by PCB_EDIT_FRAME::setupUIConditions().

◆ get45degModeFunc()

bool PCB_EDITOR_CONDITIONS::get45degModeFunc ( const SELECTION aSelection,
PCB_BASE_FRAME aFrame 
)
staticprotected

Definition at line 186 of file pcb_editor_conditions.cpp.

187 {
188  if( aFrame->IsType( FRAME_PCB_EDITOR ) )
189  return aFrame->Settings().m_PcbUse45DegreeLimit;
190  else
191  return aFrame->Settings().m_FpeditUse45DegreeLimit;
192 }
bool IsType(FRAME_T aType) const
PCBNEW_SETTINGS & Settings()

References FRAME_PCB_EDITOR, EDA_BASE_FRAME::IsType(), PCBNEW_SETTINGS::m_FpeditUse45DegreeLimit, PCBNEW_SETTINGS::m_PcbUse45DegreeLimit, and PCB_BASE_FRAME::Settings().

Referenced by Get45degMode().

◆ GraphicsFillDisplay()

SELECTION_CONDITION PCB_EDITOR_CONDITIONS::GraphicsFillDisplay ( )

Create a functor that tests if the frame fills graphics items.

Returns
Functor returning true if graphics items are filled

Definition at line 82 of file pcb_editor_conditions.cpp.

83 {
84  // Requires a PCB_BASE_FRAME
85  PCB_BASE_FRAME* drwFrame = dynamic_cast<PCB_BASE_FRAME*>( m_frame );
86 
87  wxASSERT( drwFrame );
88 
89  return std::bind( &PCB_EDITOR_CONDITIONS::graphicsFillDisplayFunc, _1, drwFrame );
90 }
static bool graphicsFillDisplayFunc(const SELECTION &aSelection, PCB_BASE_FRAME *aFrame)
Helper function used by ViaFillDisplay()
EDA_BASE_FRAME * m_frame
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.

References graphicsFillDisplayFunc(), and APPEARANCE_CONTROLS::m_frame.

Referenced by FOOTPRINT_VIEWER_FRAME::setupUIConditions(), DISPLAY_FOOTPRINTS_FRAME::setupUIConditions(), and FOOTPRINT_EDIT_FRAME::setupUIConditions().

◆ graphicsFillDisplayFunc()

bool PCB_EDITOR_CONDITIONS::graphicsFillDisplayFunc ( const SELECTION aSelection,
PCB_BASE_FRAME aFrame 
)
staticprotected

Helper function used by ViaFillDisplay()

Definition at line 162 of file pcb_editor_conditions.cpp.

163 {
164  return aFrame->GetDisplayOptions().m_DisplayGraphicsFill;
165 }
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...

References PCB_BASE_FRAME::GetDisplayOptions(), and PCB_DISPLAY_OPTIONS::m_DisplayGraphicsFill.

Referenced by GraphicsFillDisplay().

◆ gridFunc()

bool EDITOR_CONDITIONS::gridFunc ( const SELECTION aSelection,
EDA_DRAW_FRAME aFrame 
)
staticprotectedinherited

Helper function used by PolarCoordinates().

Definition at line 155 of file editor_conditions.cpp.

156 {
157  return aFrame->IsGridVisible();
158 }
bool IsGridVisible() const

References EDA_DRAW_FRAME::IsGridVisible().

Referenced by EDITOR_CONDITIONS::GridVisible().

◆ GridVisible()

SELECTION_CONDITION EDITOR_CONDITIONS::GridVisible ( )
inherited

Create a functor testing if the grid is visible in a frame.

Note
This requires the frame passed into the constructor be be derived from EDA_DRAW_FRAME.
Returns
Functor testing if the grid is visible

Definition at line 74 of file editor_conditions.cpp.

75 {
76  // The grid visibility check requires a draw frame
77  EDA_DRAW_FRAME* drwFrame = dynamic_cast<EDA_DRAW_FRAME*>( m_frame );
78 
79  wxASSERT( drwFrame );
80 
81  return std::bind( &EDITOR_CONDITIONS::gridFunc, _1, drwFrame );
82 }
The base class for create windows for drawing purpose.
EDA_BASE_FRAME * m_frame
static bool gridFunc(const SELECTION &aSelection, EDA_DRAW_FRAME *aFrame)
Helper function used by PolarCoordinates().

References EDITOR_CONDITIONS::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().

◆ HasItems()

SELECTION_CONDITION PCB_EDITOR_CONDITIONS::HasItems ( )

Create a functor that tests if there are items in the board.

Returns
Functor returning true if the current board has items

Definition at line 38 of file pcb_editor_conditions.cpp.

39 {
40  // Requires a PCB_BASE_FRAME
41  PCB_BASE_FRAME* drwFrame = dynamic_cast<PCB_BASE_FRAME*>( m_frame );
42 
43  wxASSERT( drwFrame );
44 
45  return std::bind( &PCB_EDITOR_CONDITIONS::hasItemsFunc, _1, drwFrame );
46 }
EDA_BASE_FRAME * m_frame
static bool hasItemsFunc(const SELECTION &aSelection, PCB_BASE_FRAME *aFrame)
< Helper function used by HasItems()
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.

References hasItemsFunc(), and APPEARANCE_CONTROLS::m_frame.

Referenced by FOOTPRINT_EDIT_FRAME::setupUIConditions(), and PCB_EDIT_FRAME::setupUIConditions().

◆ hasItemsFunc()

bool PCB_EDITOR_CONDITIONS::hasItemsFunc ( const SELECTION aSelection,
PCB_BASE_FRAME aFrame 
)
staticprotected

< Helper function used by HasItems()

Helper function used by PadNumbersDisplay()

Definition at line 136 of file pcb_editor_conditions.cpp.

137 {
138  BOARD* board = aFrame->GetBoard();
139 
140  return board && !board->IsEmpty();
141 }
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:191
BOARD * GetBoard() const
bool IsEmpty() const
Definition: board.h:282

References PCB_BASE_FRAME::GetBoard(), and BOARD::IsEmpty().

Referenced by HasItems().

◆ HasType()

SELECTION_CONDITION SELECTION_CONDITIONS::HasType ( KICAD_T  aType)
staticinherited

Create a functor that tests if among the selected items there is at least one of a given type.

Parameters
aTypeis the type that is searched.
Returns
Functor testing for presence of items of a given type.

Definition at line 59 of file selection_conditions.cpp.

60 {
61  return std::bind( &SELECTION_CONDITIONS::hasTypeFunc, _1, aType );
62 }
static bool hasTypeFunc(const SELECTION &aSelection, KICAD_T aType)
< Helper function used by HasType()

References SELECTION_CONDITIONS::hasTypeFunc().

Referenced by PAD_TOOL::Init().

◆ Idle()

bool SELECTION_CONDITIONS::Idle ( const SELECTION aSelection)
staticinherited

Test if there no items selected or being edited.

Parameters
aSelectionis the selection to be tested.
Returns
True if there are no items being edited or no items selected.

Definition at line 47 of file selection_conditions.cpp.

48 {
49  return ( !aSelection.Front() || aSelection.Front()->GetEditFlags() == 0 );
50 }
EDA_ITEM_FLAGS GetEditFlags() const
Definition: eda_item.h:157
EDA_ITEM * Front() const
Definition: selection.h:145

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().

◆ IdleSelection()

bool SELECTION_CONDITIONS::IdleSelection ( const SELECTION aSelection)
staticinherited

Test if all selected items are not being edited.

Parameters
aSelectionis the selection to be tested.
Returns
True if no selected items are being edited.

Definition at line 53 of file selection_conditions.cpp.

54 {
55  return ( aSelection.Front() && aSelection.Front()->GetEditFlags() == 0 );
56 }
EDA_ITEM_FLAGS GetEditFlags() const
Definition: eda_item.h:157
EDA_ITEM * Front() const
Definition: selection.h:145

References SELECTION::Front(), and EDA_ITEM::GetEditFlags().

Referenced by SYMBOL_EDITOR_EDIT_TOOL::Init(), SYMBOL_EDITOR_MOVE_TOOL::Init(), and SCH_EDIT_TOOL::Init().

◆ LessThan()

SELECTION_CONDITION SELECTION_CONDITIONS::LessThan ( int  aNumber)
staticinherited

Create a functor that tests if the number of selected items is smaller than the value given as parameter.

Parameters
aNumberis the number used for comparison.
Returns
Functor testing if the number of selected items is smaller than aNumber.

Definition at line 89 of file selection_conditions.cpp.

90 {
91  return std::bind( &SELECTION_CONDITIONS::lessThanFunc, _1, aNumber );
92 }
static bool lessThanFunc(const SELECTION &aSelection, int aNumber)
Helper function used by operator||.

References SELECTION_CONDITIONS::lessThanFunc().

Referenced by EE_SELECTION_TOOL::Init().

◆ MoreThan()

SELECTION_CONDITION SELECTION_CONDITIONS::MoreThan ( int  aNumber)
staticinherited

Create a functor that tests if the number of selected items is greater than the value given as parameter.

Parameters
aNumberis the number used for comparison.
Returns
Functor testing if the number of selected items is greater than aNumber.

Definition at line 83 of file selection_conditions.cpp.

84 {
85  return std::bind( &SELECTION_CONDITIONS::moreThanFunc, _1, aNumber );
86 }
static bool moreThanFunc(const SELECTION &aSelection, int aNumber)
Helper function used by LessThan()

References SELECTION_CONDITIONS::moreThanFunc().

Referenced by SCH_EDIT_TOOL::Init(), CONVERT_TOOL::Init(), ALIGN_DISTRIBUTE_TOOL::Init(), EE_SELECTION_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), FOOTPRINT_EDIT_FRAME::setupUIConditions(), and PCB_EDIT_FRAME::setupUIConditions().

◆ NoActiveTool()

SELECTION_CONDITION EDITOR_CONDITIONS::NoActiveTool ( )
inherited

Create a functor testing if there are no tools active in the frame.

Returns
Functor testing the frame has no tools running.

Definition at line 68 of file editor_conditions.cpp.

69 {
70  return std::bind( &EDITOR_CONDITIONS::noToolFunc, _1, m_frame );
71 }
EDA_BASE_FRAME * m_frame
static bool noToolFunc(const SELECTION &aSelection, EDA_BASE_FRAME *aFrame)
Helper function used by GridVisible().

References EDITOR_CONDITIONS::noToolFunc().

Referenced by FOOTPRINT_EDIT_FRAME::setupUIConditions(), and PCB_EDIT_FRAME::setupUIConditions().

◆ NotEmpty()

bool SELECTION_CONDITIONS::NotEmpty ( const SELECTION aSelection)
staticinherited

Test if there are any items selected.

Parameters
aSelectionis the selection to be tested.
Returns
True if there is at least one item selected.

Definition at line 35 of file selection_conditions.cpp.

36 {
37  return !aSelection.Empty();
38 }
bool Empty() const
Checks if there is anything selected.
Definition: selection.h:98

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().

◆ noToolFunc()

bool EDITOR_CONDITIONS::noToolFunc ( const SELECTION aSelection,
EDA_BASE_FRAME aFrame 
)
staticprotectedinherited

Helper function used by GridVisible().

Definition at line 149 of file editor_conditions.cpp.

150 {
151  return aFrame->ToolStackIsEmpty();
152 }
bool ToolStackIsEmpty()
Definition: tools_holder.h:116

References TOOLS_HOLDER::ToolStackIsEmpty().

Referenced by EDITOR_CONDITIONS::NoActiveTool().

◆ OnlyType()

SELECTION_CONDITION SELECTION_CONDITIONS::OnlyType ( KICAD_T  aType)
staticinherited

Create a functor that tests if the selected items are only of given type.

Parameters
aTypeis the type that is searched.
Returns
Functor testing if selected items are exclusively of one type.

Definition at line 65 of file selection_conditions.cpp.

66 {
67  return std::bind( &SELECTION_CONDITIONS::onlyTypeFunc, _1, aType );
68 }
static bool onlyTypeFunc(const SELECTION &aSelection, KICAD_T aType)
Helper function used by OnlyTypes()

References SELECTION_CONDITIONS::onlyTypeFunc().

Referenced by SYMBOL_EDITOR_PIN_TOOL::Init(), SCH_EDIT_TOOL::Init(), EE_INSPECTION_TOOL::Init(), PAD_TOOL::Init(), CONVERT_TOOL::Init(), SCH_MOVE_TOOL::Init(), BOARD_EDITOR_CONTROL::Init(), EE_SELECTION_TOOL::Init(), EDIT_TOOL::Init(), SCH_LINE_WIRE_BUS_TOOL::Init(), and PCB_EDIT_FRAME::setupUIConditions().

◆ OnlyTypes()

SELECTION_CONDITION SELECTION_CONDITIONS::OnlyTypes ( const KICAD_T  aTypes[])
staticinherited

Create a functor that tests if the selected items are only of given types.

Parameters
aTypesis an array containing types that are searched. It has to be ended with #KICAD_T::EOT as end marker.
Returns
Functor testing if selected items are exclusively of the requested types.

Definition at line 71 of file selection_conditions.cpp.

72 {
73  return std::bind( &SELECTION_CONDITIONS::onlyTypesFunc, _1, aTypes );
74 }
static bool onlyTypesFunc(const SELECTION &aSelection, const KICAD_T aTypes[])
Helper function used by Count()

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().

◆ PadFillDisplay()

SELECTION_CONDITION PCB_EDITOR_CONDITIONS::PadFillDisplay ( )

Create a functor that tests if the frame fills the pads.

Returns
Functor returning true if the pads are filled

Definition at line 60 of file pcb_editor_conditions.cpp.

61 {
62  // Requires a PCB_BASE_FRAME
63  PCB_BASE_FRAME* drwFrame = dynamic_cast<PCB_BASE_FRAME*>( m_frame );
64 
65  wxASSERT( drwFrame );
66 
67  return std::bind( &PCB_EDITOR_CONDITIONS::padFillDisplayFunc, _1, drwFrame );
68 }
static bool padFillDisplayFunc(const SELECTION &aSelection, PCB_BASE_FRAME *aFrame)
Helper function used by TextFillDisplay()
EDA_BASE_FRAME * m_frame
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.

References APPEARANCE_CONTROLS::m_frame, and padFillDisplayFunc().

Referenced by FOOTPRINT_VIEWER_FRAME::setupUIConditions(), DISPLAY_FOOTPRINTS_FRAME::setupUIConditions(), FOOTPRINT_EDIT_FRAME::setupUIConditions(), and PCB_EDIT_FRAME::setupUIConditions().

◆ padFillDisplayFunc()

bool PCB_EDITOR_CONDITIONS::padFillDisplayFunc ( const SELECTION aSelection,
PCB_BASE_FRAME aFrame 
)
staticprotected

Helper function used by TextFillDisplay()

Definition at line 150 of file pcb_editor_conditions.cpp.

151 {
152  return aFrame->GetDisplayOptions().m_DisplayPadFill;
153 }
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...

References PCB_BASE_FRAME::GetDisplayOptions(), and PCB_DISPLAY_OPTIONS::m_DisplayPadFill.

Referenced by PadFillDisplay().

◆ padNumberDisplayFunc()

bool PCB_EDITOR_CONDITIONS::padNumberDisplayFunc ( const SELECTION aSelection,
PCB_BASE_FRAME aFrame 
)
staticprotected

Helper function used by PadFillDisplay()

Definition at line 144 of file pcb_editor_conditions.cpp.

145 {
146  return aFrame->GetDisplayOptions().m_DisplayPadNum;
147 }
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...

References PCB_BASE_FRAME::GetDisplayOptions(), and PCB_DISPLAY_OPTIONS::m_DisplayPadNum.

Referenced by PadNumbersDisplay().

◆ PadNumbersDisplay()

SELECTION_CONDITION PCB_EDITOR_CONDITIONS::PadNumbersDisplay ( )

Create a functor that tests if the pad numbers are displayed.

Returns
Functor returning true if the pad numbers are displayed

Definition at line 49 of file pcb_editor_conditions.cpp.

50 {
51  // Requires a PCB_BASE_FRAME
52  PCB_BASE_FRAME* drwFrame = dynamic_cast<PCB_BASE_FRAME*>( m_frame );
53 
54  wxASSERT( drwFrame );
55 
56  return std::bind( &PCB_EDITOR_CONDITIONS::padNumberDisplayFunc, _1, drwFrame );
57 }
EDA_BASE_FRAME * m_frame
static bool padNumberDisplayFunc(const SELECTION &aSelection, PCB_BASE_FRAME *aFrame)
Helper function used by PadFillDisplay()
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.

References APPEARANCE_CONTROLS::m_frame, and padNumberDisplayFunc().

Referenced by FOOTPRINT_VIEWER_FRAME::setupUIConditions(), and DISPLAY_FOOTPRINTS_FRAME::setupUIConditions().

◆ polarCoordFunc()

bool EDITOR_CONDITIONS::polarCoordFunc ( const SELECTION aSelection,
EDA_DRAW_FRAME aFrame 
)
staticprotectedinherited

Helper function used by FullscreenCursor().

Definition at line 161 of file editor_conditions.cpp.

162 {
163  return aFrame->GetShowPolarCoords();
164 }
bool GetShowPolarCoords() const
For those frames that support polar coordinates.

References EDA_DRAW_FRAME::GetShowPolarCoords().

Referenced by EDITOR_CONDITIONS::PolarCoordinates().

◆ PolarCoordinates()

SELECTION_CONDITION EDITOR_CONDITIONS::PolarCoordinates ( )
inherited

Create a functor testing if polar coordinates are current being used.

Note
This requires the frame passed into the constructor be be derived from EDA_DRAW_FRAME.
Returns
Functor testing if the grid is visible

Definition at line 85 of file editor_conditions.cpp.

86 {
87  // The polar coordinates require a draw frame
88  EDA_DRAW_FRAME* drwFrame = dynamic_cast<EDA_DRAW_FRAME*>( m_frame );
89 
90  wxASSERT( drwFrame );
91 
92  return std::bind( &EDITOR_CONDITIONS::polarCoordFunc, _1, drwFrame );
93 }
The base class for create windows for drawing purpose.
static bool polarCoordFunc(const SELECTION &aSelection, EDA_DRAW_FRAME *aFrame)
Helper function used by FullscreenCursor().
EDA_BASE_FRAME * m_frame

References EDITOR_CONDITIONS::polarCoordFunc().

Referenced by GERBVIEW_FRAME::setupUIConditions(), and PCB_EDIT_FRAME::setupUIConditions().

◆ RedoAvailable()

SELECTION_CONDITION EDITOR_CONDITIONS::RedoAvailable ( )
inherited

Create a functor that tests if there are any items in the redo queue.

Returns
Functor testing if the redo queue has items.

Definition at line 50 of file editor_conditions.cpp.

51 {
52  return std::bind( &EDITOR_CONDITIONS::redoFunc, _1, m_frame );
53 }
EDA_BASE_FRAME * m_frame
static bool redoFunc(const SELECTION &aSelection, EDA_BASE_FRAME *aFrame)
Helper function used by Units().

References EDITOR_CONDITIONS::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().

◆ redoFunc()

bool EDITOR_CONDITIONS::redoFunc ( const SELECTION aSelection,
EDA_BASE_FRAME aFrame 
)
staticprotectedinherited

Helper function used by Units().

Definition at line 129 of file editor_conditions.cpp.

130 {
131  return aFrame->GetRedoCommandCount() > 0;
132 }
virtual int GetRedoCommandCount() const

References EDA_BASE_FRAME::GetRedoCommandCount().

Referenced by EDITOR_CONDITIONS::RedoAvailable().

◆ ScriptingConsoleVisible()

SELECTION_CONDITION EDITOR_CONDITIONS::ScriptingConsoleVisible ( )
inherited

Create a functor testing if the python scripting console window is visible.

Note
This requires the frame passed into the constructor be be derived from EDA_DRAW_FRAME.
Returns
Functor testing if the python scripting console window is visible

Definition at line 107 of file editor_conditions.cpp.

108 {
109  EDA_DRAW_FRAME* drwFrame = dynamic_cast<EDA_DRAW_FRAME*>( m_frame );
110 
111  wxASSERT( drwFrame );
112 
113  return std::bind( &EDITOR_CONDITIONS::consoleVisibleFunc, _1, drwFrame );
114 }
The base class for create windows for drawing purpose.
static bool consoleVisibleFunc(const SELECTION &aSelection, EDA_DRAW_FRAME *aFrame)
The frame to apply the conditions to.
EDA_BASE_FRAME * m_frame

References EDITOR_CONDITIONS::consoleVisibleFunc().

Referenced by SCH_EDIT_FRAME::setupUIConditions(), and PCB_EDIT_FRAME::setupUIConditions().

◆ ShowAlways()

◆ ShowNever()

static bool SELECTION_CONDITIONS::ShowNever ( const SELECTION aSelection)
inlinestaticinherited

Always returns false.

Parameters
aSelectionis the selection to be tested.
Returns
Always false.

Definition at line 88 of file selection_conditions.h.

89  {
90  return false;
91  }

Referenced by ACTION_CONDITIONS::ACTION_CONDITIONS(), and PL_EDITOR_FRAME::setupUIConditions().

◆ TextFillDisplay()

SELECTION_CONDITION PCB_EDITOR_CONDITIONS::TextFillDisplay ( )

Create a functor that tests if the frame fills text items.

Returns
Functor returning true if the text items are filled

Definition at line 71 of file pcb_editor_conditions.cpp.

72 {
73  // Requires a PCB_BASE_FRAME
74  PCB_BASE_FRAME* drwFrame = dynamic_cast<PCB_BASE_FRAME*>( m_frame );
75 
76  wxASSERT( drwFrame );
77 
78  return std::bind( &PCB_EDITOR_CONDITIONS::textFillDisplayFunc, _1, drwFrame );
79 }
EDA_BASE_FRAME * m_frame
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.
static bool textFillDisplayFunc(const SELECTION &aSelection, PCB_BASE_FRAME *aFrame)
Helper function used by GraphicsFillDisplay()

References APPEARANCE_CONTROLS::m_frame, and textFillDisplayFunc().

Referenced by FOOTPRINT_VIEWER_FRAME::setupUIConditions(), DISPLAY_FOOTPRINTS_FRAME::setupUIConditions(), and FOOTPRINT_EDIT_FRAME::setupUIConditions().

◆ textFillDisplayFunc()

bool PCB_EDITOR_CONDITIONS::textFillDisplayFunc ( const SELECTION aSelection,
PCB_BASE_FRAME aFrame 
)
staticprotected

Helper function used by GraphicsFillDisplay()

Definition at line 156 of file pcb_editor_conditions.cpp.

157 {
158  return aFrame->GetDisplayOptions().m_DisplayTextFill;
159 }
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...

References PCB_BASE_FRAME::GetDisplayOptions(), and PCB_DISPLAY_OPTIONS::m_DisplayTextFill.

Referenced by TextFillDisplay().

◆ toolFunc()

bool EDITOR_CONDITIONS::toolFunc ( const SELECTION aSelection,
EDA_BASE_FRAME aFrame,
const TOOL_ACTION aTool 
)
staticprotectedinherited

Helper function used by NoActiveTool().

Definition at line 142 of file editor_conditions.cpp.

144 {
145  return aFrame->IsCurrentTool( aTool );
146 }
bool IsCurrentTool(const TOOL_ACTION &aAction) const

References TOOLS_HOLDER::IsCurrentTool().

Referenced by EDITOR_CONDITIONS::CurrentTool().

◆ TrackFillDisplay()

SELECTION_CONDITION PCB_EDITOR_CONDITIONS::TrackFillDisplay ( )

Create a functor that tests if the frame fills tracks.

Returns
Functor returning true if tracks are filled

Definition at line 104 of file pcb_editor_conditions.cpp.

105 {
106  // Requires a PCB_BASE_FRAME
107  PCB_BASE_FRAME* drwFrame = dynamic_cast<PCB_BASE_FRAME*>( m_frame );
108 
109  wxASSERT( drwFrame );
110 
111  return std::bind( &PCB_EDITOR_CONDITIONS::trackFillDisplayFunc, _1, drwFrame );
112 }
static bool trackFillDisplayFunc(const SELECTION &aSelection, PCB_BASE_FRAME *aFrame)
Helper function used by ZoneDisplayMode()
EDA_BASE_FRAME * m_frame
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.

References APPEARANCE_CONTROLS::m_frame, and trackFillDisplayFunc().

Referenced by PCB_EDIT_FRAME::setupUIConditions().

◆ trackFillDisplayFunc()

bool PCB_EDITOR_CONDITIONS::trackFillDisplayFunc ( const SELECTION aSelection,
PCB_BASE_FRAME aFrame 
)
staticprotected

Helper function used by ZoneDisplayMode()

Definition at line 174 of file pcb_editor_conditions.cpp.

175 {
176  return aFrame->GetDisplayOptions().m_DisplayPcbTrackFill;
177 }
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...

References PCB_BASE_FRAME::GetDisplayOptions(), and PCB_DISPLAY_OPTIONS::m_DisplayPcbTrackFill.

Referenced by TrackFillDisplay().

◆ UndoAvailable()

SELECTION_CONDITION EDITOR_CONDITIONS::UndoAvailable ( )
inherited

Create a functor that tests if there are any items in the undo queue.

Returns
Functor testing if the undo queue has items.

Definition at line 44 of file editor_conditions.cpp.

45 {
46  return std::bind( &EDITOR_CONDITIONS::undoFunc, _1, m_frame );
47 }
EDA_BASE_FRAME * m_frame
static bool undoFunc(const SELECTION &aSelection, EDA_BASE_FRAME *aFrame)
Helper function used by RedoAvailable().

References EDITOR_CONDITIONS::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().

◆ undoFunc()

bool EDITOR_CONDITIONS::undoFunc ( const SELECTION aSelection,
EDA_BASE_FRAME aFrame 
)
staticprotectedinherited

Helper function used by RedoAvailable().

Definition at line 123 of file editor_conditions.cpp.

124 {
125  return aFrame->GetUndoCommandCount() > 0;
126 }
virtual int GetUndoCommandCount() const

References EDA_BASE_FRAME::GetUndoCommandCount().

Referenced by EDITOR_CONDITIONS::UndoAvailable().

◆ Units()

SELECTION_CONDITION EDITOR_CONDITIONS::Units ( EDA_UNITS  aUnit)
inherited

Create a functor that tests if the frame has the specified units.

Returns
Functor testing the units of a frame.

Definition at line 56 of file editor_conditions.cpp.

57 {
58  return std::bind( &EDITOR_CONDITIONS::unitsFunc, _1, m_frame, aUnit );
59 }
static bool unitsFunc(const SELECTION &aSelection, EDA_BASE_FRAME *aFrame, EDA_UNITS aUnits)
Helper function used by CurrentTool().
EDA_BASE_FRAME * m_frame

References EDITOR_CONDITIONS::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().

◆ unitsFunc()

bool EDITOR_CONDITIONS::unitsFunc ( const SELECTION aSelection,
EDA_BASE_FRAME aFrame,
EDA_UNITS  aUnits 
)
staticprotectedinherited

Helper function used by CurrentTool().

Definition at line 135 of file editor_conditions.cpp.

137 {
138  return aFrame->GetUserUnits() == aUnits;
139 }
EDA_UNITS GetUserUnits() const
Return the user units currently in use.

References EDA_BASE_FRAME::GetUserUnits().

Referenced by EDITOR_CONDITIONS::Units().

◆ ViaFillDisplay()

SELECTION_CONDITION PCB_EDITOR_CONDITIONS::ViaFillDisplay ( )

Create a functor that tests if the frame fills vias.

Returns
Functor returning true if vias are filled

Definition at line 93 of file pcb_editor_conditions.cpp.

94 {
95  // Requires a PCB_BASE_FRAME
96  PCB_BASE_FRAME* drwFrame = dynamic_cast<PCB_BASE_FRAME*>( m_frame );
97 
98  wxASSERT( drwFrame );
99 
100  return std::bind( &PCB_EDITOR_CONDITIONS::viaFillDisplayFunc, _1, drwFrame );
101 }
static bool viaFillDisplayFunc(const SELECTION &aSelection, PCB_BASE_FRAME *aFrame)
Helper function used by TrackFillDisplay()
EDA_BASE_FRAME * m_frame
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.

References APPEARANCE_CONTROLS::m_frame, and viaFillDisplayFunc().

Referenced by PCB_EDIT_FRAME::setupUIConditions().

◆ viaFillDisplayFunc()

bool PCB_EDITOR_CONDITIONS::viaFillDisplayFunc ( const SELECTION aSelection,
PCB_BASE_FRAME aFrame 
)
staticprotected

Helper function used by TrackFillDisplay()

Definition at line 168 of file pcb_editor_conditions.cpp.

169 {
170  return aFrame->GetDisplayOptions().m_DisplayViaFill;
171 }
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...

References PCB_BASE_FRAME::GetDisplayOptions(), and PCB_DISPLAY_OPTIONS::m_DisplayViaFill.

Referenced by ViaFillDisplay().

◆ ZoneDisplayMode()

SELECTION_CONDITION PCB_EDITOR_CONDITIONS::ZoneDisplayMode ( ZONE_DISPLAY_MODE  aMode)

Create a functor that tests the current zone display mode in the frame.

Parameters
aModeis the mode to test for
Returns
Functor returning true if the frame is using the specified mode

Definition at line 115 of file pcb_editor_conditions.cpp.

116 {
117  // Requires a PCB_BASE_FRAME
118  PCB_BASE_FRAME* drwFrame = dynamic_cast<PCB_BASE_FRAME*>( m_frame );
119 
120  wxASSERT( drwFrame );
121 
122  return std::bind( &PCB_EDITOR_CONDITIONS::zoneDisplayModeFunc, _1, drwFrame, aMode );
123 }
EDA_BASE_FRAME * m_frame
static bool zoneDisplayModeFunc(const SELECTION &aSelection, PCB_BASE_FRAME *aFrame, ZONE_DISPLAY_MODE aMode)
Helper function used by Line45degMode()
Base PCB main window class for Pcbnew, Gerbview, and CvPcb footprint viewer.

References APPEARANCE_CONTROLS::m_frame, and zoneDisplayModeFunc().

Referenced by PCB_EDIT_FRAME::setupUIConditions().

◆ zoneDisplayModeFunc()

bool PCB_EDITOR_CONDITIONS::zoneDisplayModeFunc ( const SELECTION aSelection,
PCB_BASE_FRAME aFrame,
ZONE_DISPLAY_MODE  aMode 
)
staticprotected

Helper function used by Line45degMode()

Definition at line 180 of file pcb_editor_conditions.cpp.

182 {
183  return aFrame->GetDisplayOptions().m_ZoneDisplayMode == aMode;
184 }
const PCB_DISPLAY_OPTIONS & GetDisplayOptions() const
Display options control the way tracks, vias, outlines and other things are shown (for instance solid...
ZONE_DISPLAY_MODE m_ZoneDisplayMode

References PCB_BASE_FRAME::GetDisplayOptions(), and PCB_DISPLAY_OPTIONS::m_ZoneDisplayMode.

Referenced by ZoneDisplayMode().

Member Data Documentation

◆ m_frame

EDA_BASE_FRAME* EDITOR_CONDITIONS::m_frame
protectedinherited

Definition at line 163 of file editor_conditions.h.


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