21#ifndef DIALOG_KICAD_DIFF_H
22#define DIALOG_KICAD_DIFF_H
56 DIALOG_KICAD_DIFF( wxWindow* aParent,
const wxString& aReferencePath,
const wxString& aComparisonPath,
59 KIID_PATH aInitialSheet = {} );
93 void OnClose( wxCloseEvent& aEvent )
override;
96 void OnOK( wxCommandEvent& aEvent )
override;
104 void buildTree(
const std::optional<KIID_PATH>& aSelect );
DIALOG_KICAD_DIFF_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Compare Files"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(900, 650), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
std::vector< KIID_PATH > changeRowIds(const KICAD_DIFF::ITEM_CHANGE &aChange) const
Change ids a tree row stands for.
SHEET_SWITCHER m_sheetSwitcher
std::optional< KIID_PATH > selectedChangeId() const
The selected row's change id. Valid only while m_diff still owns the listed changes.
size_t m_layerControlsIndex
Index in m_filterSizer of the first layer control, which follow the category filters.
void OnTreeSelectionChanged(wxTreeEvent &aEvent) override
std::function< void(WIDGET_DIFF_CANVAS &, const wxString &aName)> LIBRARY_ITEM_DRAWER
std::set< KIID_PATH > m_hiddenChanges
Changes the user has muted via the tree's right-click menu.
void showChange(const KICAD_DIFF::ITEM_CHANGE *aChange)
Populate the property list for the change associated with the selected tree node, or clear the list i...
wxWrapSizer * m_filterSizer
KIID_PATH m_currentCanvasSheet
std::function< void(int aIndex)> REVISION_HANDLER
WIDGET_DIFF_CANVAS * m_canvas
GAL-backed canvas showing the DIFF_SCENE shape rectangles.
void DrawChosenLibraryItem(LIBRARY_ITEM_DRAWER aDraw)
Draw only the library item named by the chosen change, since the outlines of a whole library pile up ...
std::function< void()> UP_HANDLER
std::map< wxUIntPtr, const KICAD_DIFF::ITEM_CHANGE * > m_changeByTreeId
Maps tree item IDs to the underlying change record so selection can find the data without walking the...
std::vector< wxWindow * > m_layerControls
wxChoice * m_revisionChoice
void OnOK(wxCommandEvent &aEvent) override
void buildTree()
Populate the tree from m_diff, keeping the selected change. Groups by CHANGE_KIND.
void SetUpHandler(UP_HANDLER aHandler)
std::function< void(WIDGET_DIFF_CANVAS &, const KIID_PATH &)> SHEET_SWITCHER
wxString m_searchFilter
Lowercased free-text filter applied to typeName / refdes.
void applyHiddenToTree()
Grey out tree rows whose change is in m_hiddenChanges, restore the rest.
DIALOG_KICAD_DIFF(wxWindow *aParent, const wxString &aReferencePath, const wxString &aComparisonPath, const KICAD_DIFF::DOCUMENT_DIFF &aDiff, KICAD_DIFF::DOCUMENT_GEOMETRY aReferenceGeometry={}, KICAD_DIFF::DOCUMENT_GEOMETRY aComparisonGeometry={}, SHEET_SWITCHER aSheetSwitcher={}, KIID_PATH aInitialSheet={})
bool selectChangeById(const KIID_PATH &aChangeId)
Select the tree row whose change has the given KIID_PATH.
KICAD_DIFF::DOCUMENT_DIFF m_diff
void OnClose(wxCloseEvent &aEvent) override
REVISION_HANDLER m_revisionHandler
void OnTreeItemMenu(wxTreeEvent &aEvent)
LIBRARY_ITEM_DRAWER m_drawLibraryItem
void showDiffSummary()
Report the number of changes in the summary label.
void buildLayerControls(const KICAD_DIFF::DIFF_SCENE &aScene)
Replace the layer checkboxes with one per layer of aScene's geometry, after the category filters.
~DIALOG_KICAD_DIFF() override=default
WIDGET_DIFF_CANVAS * DiffCanvas() const
void EnableUp(bool aEnable)
bool m_suppressCenter
True while a canvas click is propagating into the tree, so the tree- selection handler skips re-cente...
void SetRevisionChooser(const std::vector< wxString > &aLabels, int aSelected, REVISION_HANDLER aOnChange)
Add a revision dropdown (with prev/next) at the top.
void Reload(const wxString &aReferencePath, const wxString &aComparisonPath, KICAD_DIFF::DOCUMENT_DIFF aDiff, KICAD_DIFF::DOCUMENT_GEOMETRY aReferenceGeometry, KICAD_DIFF::DOCUMENT_GEOMETRY aComparisonGeometry, SHEET_SWITCHER aSheetSwitcher, KIID_PATH aInitialSheet)
Swap in a fresh diff with new schematics.
The full set of changes between two parsed documents of one type.
Aggregate of background geometry extracted from one source document.
One change record on a single item.