KiCad PCB EDA Suite
Loading...
Searching...
No Matches
hierarchy_pane.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2004 Jean-Pierre Charras, jp.charras at wanadoo.fr
5 * Copyright (C) 2008 Wayne Stambaugh <[email protected]>
6 * Copyright (C) 2022 Mike Williams <mike at mikebwilliams.com>
7 * Copyright (C) 2004-2024 KiCad Developers, see AUTHORS.txt for contributors.
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, you may find one here:
21 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22 * or you may search the http://www.gnu.org website for the version 2 license,
23 * or you may write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25 */
26
27
28#ifndef HIERARCHY_PANE_H
29#define HIERARCHY_PANE_H
30
31#include <wx/imaglist.h>
32#include <wx/object.h> // wxRTTI macros
33#include <wx/treectrl.h>
34#include "widgets/wx_panel.h"
35
36
37class SCH_EDIT_FRAME;
38class SCH_SHEET_PATH;
39
40class HIERARCHY_PANE;
41
42
49class HIERARCHY_TREE : public wxTreeCtrl
50{
51public:
53 wxTreeCtrl( (wxWindow*) parent, wxID_ANY, wxDefaultPosition, wxDefaultSize,
54 wxTR_HAS_BUTTONS, wxDefaultValidator, wxT( "HierachyTreeCtrl" ) )
55 {
56 }
57
58 int OnCompareItems( const wxTreeItemId& item1, const wxTreeItemId& item2 ) override;
59
60private:
61 // Need to use wxRTTI macros in order for OnCompareItems to work properly
62 // See: https://docs.wxwidgets.org/3.1/classwx_tree_ctrl.html#ab90a465793c291ca7aa827a576b7d146
64};
65
66
68{
69public:
71
73
78
83
90
91private:
100 void buildHierarchyTree( SCH_SHEET_PATH* aList, const wxTreeItemId& aParent );
101
106 void onSelectSheetPath( wxTreeEvent& aEvent );
107
108 void onTreeItemRightClick( wxTreeEvent& aEvent );
109 void onRightClick( wxMouseEvent& aEvent );
110 void onRightClick( wxTreeItemId aItem );
111 void onCharHook( wxKeyEvent& aKeyStroke );
112
116 wxString getRootString();
117
121 wxString formatPageString( const wxString& aName, const wxString& aPage );
122
123private:
127
129};
130
131#endif // HIERARCHY_PANE_H
SCH_EDIT_FRAME * m_frame
HIERARCHY_TREE * m_tree
void onSelectSheetPath(wxTreeEvent &aEvent)
Open the selected sheet and display the corresponding screen when a tree item is selected.
void UpdateLabelsHierarchyTree()
Update the labels of the hierarchical tree of the schematic.
wxString formatPageString(const wxString &aName, const wxString &aPage)
wxString getRootString()
SCH_SHEET_PATH m_list
void UpdateHierarchySelection()
Updates the tree's selection to match current page.
void onCharHook(wxKeyEvent &aKeyStroke)
void UpdateHierarchyTree()
Update the hierarchical tree of the schematic.
void buildHierarchyTree(SCH_SHEET_PATH *aList, const wxTreeItemId &aParent)
Create the hierarchical tree of the schematic.
void onTreeItemRightClick(wxTreeEvent &aEvent)
void onRightClick(wxMouseEvent &aEvent)
Navigation hierarchy tree control.
HIERARCHY_TREE(HIERARCHY_PANE *parent)
int OnCompareItems(const wxTreeItemId &item1, const wxTreeItemId &item2) override
wxDECLARE_ABSTRACT_CLASS(HIERARCHY_TREE)
Schematic editor (Eeschema) main window.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...