KiCad PCB EDA Suite
Loading...
Searching...
No Matches
HIERARCHY_PANE Class Reference

#include <hierarchy_pane.h>

Inheritance diagram for HIERARCHY_PANE:
WX_PANEL

Public Types

enum  ContextMenuAction { EDIT_PAGE_NUMBER , EXPAND_ALL , COLLAPSE_ALL , RENAME }
 

Public Member Functions

 HIERARCHY_PANE (SCH_EDIT_FRAME *aParent)
 
 ~HIERARCHY_PANE ()
 
void UpdateHierarchyTree ()
 Update the hierarchical tree of the schematic.
 
void UpdateHierarchySelection ()
 Updates the tree's selection to match current page.
 
void UpdateLabelsHierarchyTree ()
 Update the labels of the hierarchical tree of the schematic.
 
void SetBorders (bool aLeft, bool aRight, bool aTop, bool aBottom)
 
void SetBorderColor (const KIGFX::COLOR4D &aColor)
 

Private Member Functions

void buildHierarchyTree (SCH_SHEET_PATH *aList, const wxTreeItemId &aParent)
 Create the hierarchical tree of the schematic.
 
void onSelectSheetPath (wxTreeEvent &aEvent)
 Open the selected sheet and display the corresponding screen when a tree item is selected.
 
void onTreeItemRightClick (wxTreeEvent &aEvent)
 
void onRightClick (wxMouseEvent &aEvent)
 
void onRightClick (wxTreeItemId aItem)
 
void onCharHook (wxKeyEvent &aKeyStroke)
 
void onTreeRightClick (wxTreeEvent &event)
 
void onTreeEditFinished (wxTreeEvent &event)
 
wxString getRootString ()
 
wxString formatPageString (const wxString &aName, const wxString &aPage)
 
void setIdenticalSheetsHighlighted (const SCH_SHEET_PATH &path, bool highLighted=true)
 When renaming the sheets in tree it is helpful to highlight the identical sheets which got renamed by renaming the current sheet.
 
void renameIdenticalSheets (const SCH_SHEET_PATH &renamedSheet, const wxString newName, SCH_COMMIT *commit)
 Rename all sheets in a hierarchial desing which has the same source renamed sheet.
 
void OnPaint (wxPaintEvent &event)
 

Private Attributes

SCH_SHEET_PATH m_list
 
SCH_EDIT_FRAMEm_frame
 
HIERARCHY_TREEm_tree
 
bool m_events_bound
 
bool m_leftBorder
 
bool m_rightBorder
 
bool m_topBorder
 
bool m_bottomBorder
 
KIGFX::COLOR4D m_borderColor
 

Detailed Description

Definition at line 69 of file hierarchy_pane.h.

Member Enumeration Documentation

◆ ContextMenuAction

Enumerator
EDIT_PAGE_NUMBER 
EXPAND_ALL 
COLLAPSE_ALL 
RENAME 

Definition at line 72 of file hierarchy_pane.h.

Constructor & Destructor Documentation

◆ HIERARCHY_PANE()

◆ ~HIERARCHY_PANE()

HIERARCHY_PANE::~HIERARCHY_PANE ( )

Member Function Documentation

◆ buildHierarchyTree()

void HIERARCHY_PANE::buildHierarchyTree ( SCH_SHEET_PATH aList,
const wxTreeItemId &  aParent 
)
private

Create the hierarchical tree of the schematic.

Warning
This routine is reentrant!
Parameters
[in]aListis the SCH_SHEET_PATH list to explore.
aPreviousmenuis the wxTreeItemId used as parent to add sub items.

Definition at line 127 of file hierarchy_pane.cpp.

References buildHierarchyTree(), formatPageString(), SCH_SHEET::GetFields(), SCH_SHEET_PATH::GetPageNumber(), SCH_SCREEN::GetSheets(), SCH_SHEET_PATH::LastScreen(), m_tree, SCH_SHEET_PATH::pop_back(), SCH_SHEET_PATH::push_back(), and SHEETNAME.

Referenced by buildHierarchyTree(), and UpdateHierarchyTree().

◆ formatPageString()

wxString HIERARCHY_PANE::formatPageString ( const wxString &  aName,
const wxString &  aPage 
)
private
Returns
String with page number in parenthesis

Definition at line 549 of file hierarchy_pane.cpp.

References _.

Referenced by buildHierarchyTree(), getRootString(), onTreeEditFinished(), renameIdenticalSheets(), and UpdateLabelsHierarchyTree().

◆ getRootString()

wxString HIERARCHY_PANE::getRootString ( )
private

◆ onCharHook()

void HIERARCHY_PANE::onCharHook ( wxKeyEvent &  aKeyStroke)
private

Definition at line 507 of file hierarchy_pane.cpp.

References ACTIONS::collapseAll, ACTIONS::expandAll, m_tree, MD_ALT, MD_CTRL, and MD_SHIFT.

Referenced by HIERARCHY_PANE(), and ~HIERARCHY_PANE().

◆ OnPaint()

◆ onRightClick() [1/2]

void HIERARCHY_PANE::onRightClick ( wxMouseEvent &  aEvent)
private

Definition at line 375 of file hierarchy_pane.cpp.

References onRightClick().

Referenced by HIERARCHY_PANE(), onRightClick(), onTreeItemRightClick(), and ~HIERARCHY_PANE().

◆ onRightClick() [2/2]

◆ onSelectSheetPath()

void HIERARCHY_PANE::onSelectSheetPath ( wxTreeEvent &  aEvent)
private

Open the selected sheet and display the corresponding screen when a tree item is selected.

Definition at line 310 of file hierarchy_pane.cpp.

References EE_ACTIONS::changeSheet, TOOLS_HOLDER::GetToolManager(), m_frame, TREE_ITEM_DATA::m_SheetPath, m_tree, and TOOL_MANAGER::RunAction().

Referenced by HIERARCHY_PANE(), UpdateHierarchySelection(), UpdateHierarchyTree(), and ~HIERARCHY_PANE().

◆ onTreeEditFinished()

◆ onTreeItemRightClick()

void HIERARCHY_PANE::onTreeItemRightClick ( wxTreeEvent &  aEvent)
private

◆ onTreeRightClick()

void HIERARCHY_PANE::onTreeRightClick ( wxTreeEvent &  event)
private

◆ renameIdenticalSheets()

void HIERARCHY_PANE::renameIdenticalSheets ( const SCH_SHEET_PATH renamedSheet,
const wxString  newName,
SCH_COMMIT commit 
)
private

◆ SetBorderColor()

void WX_PANEL::SetBorderColor ( const KIGFX::COLOR4D aColor)
inlineinherited

Definition at line 47 of file wx_panel.h.

References WX_PANEL::m_borderColor.

Referenced by SYMBOL_TREE_SYNCHRONIZING_ADAPTER::ShowPreview().

◆ SetBorders()

◆ setIdenticalSheetsHighlighted()

void HIERARCHY_PANE::setIdenticalSheetsHighlighted ( const SCH_SHEET_PATH path,
bool  highLighted = true 
)
private

When renaming the sheets in tree it is helpful to highlight the identical sheets which got renamed by renaming the current sheet.

Definition at line 554 of file hierarchy_pane.cpp.

References SCH_SHEET_PATH::Cmp(), SCH_SHEET_PATH::Last(), TREE_ITEM_DATA::m_SheetPath, m_tree, path, and recursiveDescent().

Referenced by onRightClick(), and onTreeEditFinished().

◆ UpdateHierarchySelection()

void HIERARCHY_PANE::UpdateHierarchySelection ( )

◆ UpdateHierarchyTree()

◆ UpdateLabelsHierarchyTree()

void HIERARCHY_PANE::UpdateLabelsHierarchyTree ( )

Update the labels of the hierarchical tree of the schematic.

Must be called only for an up to date tree, to update displayed labels after a sheet name or a sheet number change.

Definition at line 328 of file hierarchy_pane.cpp.

References formatPageString(), SCH_SHEET::GetFields(), SCH_SHEET_PATH::GetPageNumber(), SCH_SHEET_PATH::Last(), TREE_ITEM_DATA::m_SheetPath, m_tree, recursiveDescent(), and SHEETNAME.

Referenced by onRightClick(), and SCH_EDIT_FRAME::UpdateLabelsHierarchyNavigator().

Member Data Documentation

◆ m_borderColor

KIGFX::COLOR4D WX_PANEL::m_borderColor
privateinherited

Definition at line 61 of file wx_panel.h.

Referenced by WX_PANEL::OnPaint(), and WX_PANEL::SetBorderColor().

◆ m_bottomBorder

bool WX_PANEL::m_bottomBorder
privateinherited

Definition at line 59 of file wx_panel.h.

Referenced by WX_PANEL::OnPaint(), and WX_PANEL::SetBorders().

◆ m_events_bound

bool HIERARCHY_PANE::m_events_bound
private

Definition at line 152 of file hierarchy_pane.h.

Referenced by HIERARCHY_PANE(), UpdateHierarchySelection(), and UpdateHierarchyTree().

◆ m_frame

◆ m_leftBorder

bool WX_PANEL::m_leftBorder
privateinherited

Definition at line 56 of file wx_panel.h.

Referenced by WX_PANEL::OnPaint(), and WX_PANEL::SetBorders().

◆ m_list

SCH_SHEET_PATH HIERARCHY_PANE::m_list
private

Definition at line 148 of file hierarchy_pane.h.

Referenced by UpdateHierarchyTree().

◆ m_rightBorder

bool WX_PANEL::m_rightBorder
privateinherited

Definition at line 57 of file wx_panel.h.

Referenced by WX_PANEL::OnPaint(), and WX_PANEL::SetBorders().

◆ m_topBorder

bool WX_PANEL::m_topBorder
privateinherited

Definition at line 58 of file wx_panel.h.

Referenced by WX_PANEL::OnPaint(), and WX_PANEL::SetBorders().

◆ m_tree


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