40 std::vector<long> item = { aItemRow };
49 std::vector<BOARD_ITEM*> selection;
51 for(
long i = 0; i < (long)
m_hitlist.size(); ++i )
57 int col = std::max( 0, aCol );
66 return StrNumCmp( getResultCell( a, col ), getResultCell( b, col ), true ) < 0;
68 return StrNumCmp( getResultCell( b, col ), getResultCell( a, col ), true ) < 0;
74 for(
long i = 0; i < (long)
m_hitlist.size(); ++i )
77 aSelection->push_back( i );
85 std::vector<EDA_ITEM*> selectedItems;
87 for(
long row : aItemRows )
89 if( row >= 0 && row < (
long)
m_hitlist.size() )
90 selectedItems.push_back(
m_hitlist[row] );
95 if( selectedItems.size() )
119 m_columns.emplace_back(
_HKI(
"Reference" ), 2, wxLIST_FORMAT_LEFT );
120 m_columns.emplace_back(
_HKI(
"Value" ), 6, wxLIST_FORMAT_LEFT );
121 m_columns.emplace_back(
_HKI(
"Layer" ), 2, wxLIST_FORMAT_CENTER );
122 m_columns.emplace_back( wxT(
"X" ), 3, wxLIST_FORMAT_CENTER );
123 m_columns.emplace_back( wxT(
"Y" ), 3, wxLIST_FORMAT_CENTER );
124 m_columns.emplace_back(
_HKI(
"Library Link" ), 8, wxLIST_FORMAT_LEFT );
125 m_columns.emplace_back(
_HKI(
"Library Description" ), 10, wxLIST_FORMAT_LEFT );
134 if( board ==
nullptr )
145 frp.
matchMode = EDA_SEARCH_MATCH_MODE::PERMISSIVE;
154 if( !found && fp->Matches( frp,
nullptr ) )
159 for(
PCB_FIELD* field : fp->GetFields() )
161 if( field->Matches( frp,
nullptr ) )
196 return wxEmptyString;
203 m_columns.emplace_back(
_HKI(
"Name" ), 6, wxLIST_FORMAT_LEFT );
204 m_columns.emplace_back(
_HKI(
"Net" ), 6, wxLIST_FORMAT_LEFT);
205 m_columns.emplace_back(
_HKI(
"Layer" ), 3, wxLIST_FORMAT_CENTER );
206 m_columns.emplace_back(
_HKI(
"Priority" ), 2, wxLIST_FORMAT_CENTER );
207 m_columns.emplace_back( wxT(
"X" ), 3, wxLIST_FORMAT_CENTER );
208 m_columns.emplace_back( wxT(
"Y" ), 3, wxLIST_FORMAT_CENTER );
209 m_columns.emplace_back(
_HKI(
"Area" ), 3, wxLIST_FORMAT_RIGHT );
226 frp.
matchMode = EDA_SEARCH_MATCH_MODE::PERMISSIVE;
230 if( frp.
findString.IsEmpty() || item->Matches( frp,
nullptr ) )
240 ZONE* zone =
static_cast<ZONE*
>( aItem );
248 wxArrayString layers;
254 return wxJoin( layers,
',' );
265 true, EDA_DATA_TYPE::AREA );
269 return wxEmptyString;
276 m_columns.emplace_back(
_HKI(
"Type" ), 2, wxLIST_FORMAT_LEFT );
277 m_columns.emplace_back(
_HKI(
"Text" ), 12, wxLIST_FORMAT_LEFT );
278 m_columns.emplace_back(
_HKI(
"Layer" ), 3, wxLIST_FORMAT_CENTER );
279 m_columns.emplace_back( wxT(
"X" ), 3, wxLIST_FORMAT_CENTER );
280 m_columns.emplace_back( wxT(
"Y" ), 3, wxLIST_FORMAT_CENTER );
297 frp.
matchMode = EDA_SEARCH_MATCH_MODE::PERMISSIVE;
306 if( frp.
findString.IsEmpty() || item->Matches( frp,
nullptr ) )
322 return _(
"Textbox" );
324 return _(
"Dimension" );
342 return wxEmptyString;
349 m_columns.emplace_back(
_HKI(
"Type" ), 2, wxLIST_FORMAT_LEFT );
350 m_columns.emplace_back(
_HKI(
"Name" ), 6, wxLIST_FORMAT_LEFT );
351 m_columns.emplace_back( wxT(
"X" ), 3, wxLIST_FORMAT_CENTER );
352 m_columns.emplace_back( wxT(
"Y" ), 3, wxLIST_FORMAT_CENTER );
369 frp.
matchMode = EDA_SEARCH_MATCH_MODE::PERMISSIVE;
377 if( frp.
findString.IsEmpty() || item->Matches( frp,
nullptr ) )
392 return _(
"Generator" );
401 return wxEmptyString;
408 m_columns.emplace_back(
_HKI(
"Name" ), 6, wxLIST_FORMAT_LEFT );
409 m_columns.emplace_back(
_HKI(
"Class" ), 6, wxLIST_FORMAT_LEFT );
425 frp.
matchMode = EDA_SEARCH_MATCH_MODE::PERMISSIVE;
431 if( net && ( aQuery.IsEmpty() || net->Matches( frp,
nullptr ) ) )
446 return _(
"No Net" );
456 return wxEmptyString;
465 std::vector<NETINFO_ITEM*> selectedItems;
467 for(
long row : aItemRows )
469 if( row >= 0 && row < (
long)
m_hitlist.size() )
491 m_columns.emplace_back(
_HKI(
"Name" ), 6, wxLIST_FORMAT_LEFT );
492 m_columns.emplace_back(
_HKI(
"Class" ), 6, wxLIST_FORMAT_LEFT );
508 frp.
matchMode = EDA_SEARCH_MATCH_MODE::PERMISSIVE;
514 if( net ==
nullptr || !net->Matches( frp,
nullptr ) )
534 return _(
"No Net" );
544 return wxEmptyString;
553 std::vector<NETINFO_ITEM*> selectedItems;
555 for(
long row : aItemRows )
557 if( row >= 0 && row < (
long)
m_hitlist.size() )
static TOOL_ACTION zoomFitSelection
static TOOL_ACTION centerSelection
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION selectItems
Select a list of items (specified as the event parameter)
wxString GetNetname() const
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
wxString GetLayerName() const
Return the name of the PCB layer on which the item resides.
Information pertinent to a Pcbnew printed circuit board.
const NETINFO_LIST & GetNetInfo() const
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
const ZONES & Zones() const
const GROUPS & Groups() const
The groups must maintain the following invariants.
const FOOTPRINTS & Footprints() const
const wxString GetLayerName(PCB_LAYER_ID aLayer) const
Return the name of a aLayer.
std::shared_ptr< CONNECTIVITY_DATA > GetConnectivity() const
Return a list of missing connections between components/tracks.
const DRAWINGS & Drawings() const
virtual APP_SETTINGS_BASE * config() const
Return the settings object used in SaveSettings(), and is overloaded in KICAD_MANAGER_FRAME.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
KICAD_T Type() const
Returns the type of object.
wxString getResultCell(const SCH_SEARCH_HIT &hit, int aCol) override
int Search(const wxString &aQuery) override
GROUP_SEARCH_HANDLER(SCH_EDIT_FRAME *aFrame)
virtual RENDER_SETTINGS * GetSettings()=0
Return a pointer to current settings that are going to be used when drawing items.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
void SetHighlight(bool aEnabled, int aNetcode=-1, bool aMulti=false)
Turns on/off highlighting.
void UpdateAllLayersColor()
Apply the new coloring scheme to all layers.
PAINTER * GetPainter() const
Return the painter object used by the view for drawing #VIEW_ITEMS.
LSEQ Seq(const LSEQ &aSequence) const
Return an LSEQ from the union of this LSET and a desired sequence.
const wxString GetName() const
Gets the name of this (maybe aggregate) netclass in a format for internal usage or for export to exte...
Handle the data for a net.
const wxString & GetNetname() const
void ActivateItem(long aItemRow) override
int Search(const wxString &aQuery) override
NETS_SEARCH_HANDLER(PCB_EDIT_FRAME *aFrame)
wxString getResultCell(BOARD_ITEM *aItem, int aCol) override
void SelectItems(std::vector< long > &aItemRows) override
static TOOL_ACTION properties
Activation of the edit tool.
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
wxString MessageTextFromCoord(int aValue, ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType) const
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
The main frame for Pcbnew.
void ShowBoardSetupDialog(const wxString &aInitialPage=wxEmptyString)
A set of BOARD_ITEMs (i.e., without duplicates).
void ActivateItem(long aItemRow) override
void Sort(int aCol, bool aAscending, std::vector< long > *aSelection) override
void SelectItems(std::vector< long > &aItemRows) override
std::vector< BOARD_ITEM * > m_hitlist
static bool ClassOf(const EDA_ITEM *aItem)
static bool ClassOf(const EDA_ITEM *aItem)
wxString getResultCell(BOARD_ITEM *aItem, int aCol) override
RATSNEST_SEARCH_HANDLER(PCB_EDIT_FRAME *aFrame)
int Search(const wxString &aQuery) override
void SelectItems(std::vector< long > &aItemRows) override
void ActivateItem(long aItemRow) override
Describe ratsnest for a single net.
const std::vector< CN_EDGE > & GetEdges() const
std::vector< SCH_SEARCH_HIT > m_hitlist
std::vector< std::tuple< wxString, int, wxListColumnFormat > > m_columns
TEXT_SEARCH_HANDLER(SCH_EDIT_FRAME *aFrame)
int Search(const wxString &aQuery) override
wxString getResultCell(const SCH_SEARCH_HIT &hit, int aCol) override
wxString MessageTextFromValue(double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const
A lower-precision version of StringFromValue().
ZONE_SEARCH_HANDLER(PCB_EDIT_FRAME *aFrame)
wxString getResultCell(BOARD_ITEM *aItem, int aCol) override
int Search(const wxString &aQuery) override
Handle a list of polygons defining a copper zone.
double GetOutlineArea()
This area is cached from the most recent call to CalculateOutlineArea().
bool GetIsRuleArea() const
Accessors to parameters used in Rule Area zones:
double GetFilledArea()
This area is cached from the most recent call to CalculateFilledArea().
const wxString & GetZoneName() const
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
unsigned GetAssignedPriority() const
PCB_LAYER_ID
A quick note on layer IDs:
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
Class to handle a set of BOARD_ITEMs.
Class that computes missing connections on a PCB.
wxString UnescapeString(const wxString &aSource)
SELECTION_ZOOM selection_zoom
bool search_hidden_fields
EDA_SEARCH_MATCH_MODE matchMode
constexpr KICAD_T BaseType(const KICAD_T aType)
Return the underlying type of the given type.
@ PCB_GENERATOR_T
class PCB_GENERATOR, generator on a layer
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
@ PCB_TABLECELL_T
class PCB_TABLECELL, PCB_TEXTBOX for use in tables
@ PCB_DIMENSION_T
class PCB_DIMENSION_BASE: abstract dimension meta-type