25#include <wx/listctrl.h>
64 m_rows.push_back( aConstraint->m_Uuid );
71 auto it = std::ranges::find(
m_rows, aConstraint );
76 long row =
static_cast<long>( std::distance(
m_rows.begin(), it ) );
77 m_list->SetItemState( row, wxLIST_STATE_SELECTED | wxLIST_STATE_FOCUSED,
78 wxLIST_STATE_SELECTED | wxLIST_STATE_FOCUSED );
79 m_list->EnsureVisible( row );
91 if( aRow < 0 || aRow >=
static_cast<long>(
m_rows.size() ) )
100 for(
int col = 0; col <
m_list->GetColumnCount(); ++col )
104 if(
m_list->GetSubItemRect( aRow, col, rect ) && aPos.x >= rect.GetLeft()
105 && aPos.x <= rect.GetRight() )
118 long row =
m_list->HitTest( aEvent.GetPosition(), flags );
123 long column =
columnAt( row, aEvent.GetPosition() );
125 ?
static_cast<int>( column )
138 tool->EditConstraintById(
rowConstraint( aEvent.GetIndex() ) );
144 long row =
m_list->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
150 if(
long count =
m_list->GetItemCount(); count > 0 )
152 m_list->SetItemState( count - 1, wxLIST_STATE_SELECTED | wxLIST_STATE_FOCUSED,
153 wxLIST_STATE_SELECTED | wxLIST_STATE_FOCUSED );
154 m_list->EnsureVisible( count - 1 );
BOARD_CONSTRAINT_DIAGNOSTICS DiagnoseBoardConstraints(BOARD *aBoard)
Diagnose every constraint cluster on the board (validate only – geometry is not changed) and return t...
Information pertinent to a Pcbnew printed circuit board.
PANEL_CONSTRAINTS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
PCB_BASE_EDIT_FRAME * m_frame
void RefreshList()
Rebuild the rows from the board's current constraints (solving the board diagnosis here).
long columnAt(long aRow, const wxPoint &aPos) const
The list column under aPos within row aRow, or -1.
std::vector< KIID > m_rows
void onRefresh(wxCommandEvent &aEvent) override
void onDelete(wxCommandEvent &aEvent) override
void onLeftDown(wxMouseEvent &aEvent)
const KIID & rowConstraint(long aRow) const
The KIID for a row, or niluuid if out of range.
void onRowActivated(wxListEvent &aEvent) override
void SelectConstraint(const KIID &aConstraint)
Select and reveal the row for aConstraint (e.g. when its badge is clicked on canvas).
PANEL_CONSTRAINTS(PCB_BASE_EDIT_FRAME *aFrame)
CONSTRAINT_EDIT_TOOL * constraintTool() const
The owning constraint tool, which performs all board mutation and selection; the panel only displays ...
Common, abstract interface for edit frames.
A geometric constraint between board items (issue #2329).
void PopulateConstraintList(wxListCtrl *aList, BOARD *aBoard, UNITS_PROVIDER *aUnits, const BOARD_CONSTRAINT_DIAGNOSTICS &aDiag, const std::function< void(long, PCB_CONSTRAINT *)> &aOnRow)
Fill aList with one row per constraint on aBoard (board-owned then footprint-owned),...
void AddConstraintListColumns(wxListCtrl *aList)
Add the four constraint columns (Item 1 / Item 2 / Constraint / State) to a report-mode list.
Board-wide diagnostics for the constraint overlay and info bar.