KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_navigate_tool.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) 2019 CERN
5
* Copyright (C) 2019-2022 KiCad Developers, see AUTHORS.txt for contributors.
6
*
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 2
10
* of the License, or (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, you may find one here:
19
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20
* or you may search the http://www.gnu.org website for the version 2 license,
21
* or you may write to the Free Software Foundation, Inc.,
22
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23
*/
24
25
26
#ifndef SCH_NAVIGATE_TOOL_H
27
#define SCH_NAVIGATE_TOOL_H
28
29
#include <
sch_base_frame.h
>
30
#include <
tools/ee_tool_base.h
>
31
#include <
status_popup.h
>
32
33
class
SCH_EDIT_FRAME
;
34
38
class
SCH_NAVIGATE_TOOL
:
public
wxEvtHandler,
public
EE_TOOL_BASE
<SCH_EDIT_FRAME>
39
{
40
public
:
41
SCH_NAVIGATE_TOOL
() :
EE_TOOL_BASE
<
SCH_EDIT_FRAME
>(
"eeschema.NavigateTool"
) {}
42
43
~SCH_NAVIGATE_TOOL
() { }
44
46
void
ResetHistory
();
48
// hierarchy changes.
49
void
CleanHistory
();
50
52
int
ChangeSheet
(
const
TOOL_EVENT
& aEvent );
54
int
EnterSheet
(
const
TOOL_EVENT
& aEvent );
56
int
LeaveSheet
(
const
TOOL_EVENT
& aEvent );
58
int
Up
(
const
TOOL_EVENT
& aEvent );
60
int
Forward
(
const
TOOL_EVENT
& aEvent );
62
int
Back
(
const
TOOL_EVENT
& aEvent );
64
int
Previous
(
const
TOOL_EVENT
& aEvent );
66
int
Next
(
const
TOOL_EVENT
& aEvent );
67
68
void
HypertextCommand
(
const
wxString& href );
69
70
bool
CanGoBack
();
71
bool
CanGoForward
();
72
bool
CanGoUp
();
73
bool
CanGoPrevious
();
74
bool
CanGoNext
();
75
76
public
:
77
static
wxString
g_BackLink
;
78
79
private
:
81
void
setTransitions
()
override
;
83
void
pushToHistory
(
SCH_SHEET_PATH
aPath );
85
void
changeSheet
(
SCH_SHEET_PATH
aPath );
86
87
private
:
88
std::list<SCH_SHEET_PATH>
m_navHistory
;
89
std::list<SCH_SHEET_PATH>::iterator
m_navIndex
;
90
};
91
92
93
#endif
// SCH_NAVIGATE_TOOL_H
EE_TOOL_BASE
A foundation class for a tool operating on a schematic or symbol.
Definition:
ee_tool_base.h:48
SCH_EDIT_FRAME
Schematic editor (Eeschema) main window.
Definition:
sch_edit_frame.h:137
SCH_NAVIGATE_TOOL
Handle actions specific to the schematic editor.
Definition:
sch_navigate_tool.h:39
SCH_NAVIGATE_TOOL::pushToHistory
void pushToHistory(SCH_SHEET_PATH aPath)
Change current sheet to aPath and handle history, zooming, etc.
Definition:
sch_navigate_tool.cpp:285
SCH_NAVIGATE_TOOL::~SCH_NAVIGATE_TOOL
~SCH_NAVIGATE_TOOL()
Reset navigation history. Must be done when schematic changes.
Definition:
sch_navigate_tool.h:43
SCH_NAVIGATE_TOOL::ResetHistory
void ResetHistory()
Remove deleted pages from history. Must be done when schematic.
Definition:
sch_navigate_tool.cpp:35
SCH_NAVIGATE_TOOL::CleanHistory
void CleanHistory()
Enter sheet provided in aEvent.
Definition:
sch_navigate_tool.cpp:43
SCH_NAVIGATE_TOOL::Back
int Back(const TOOL_EVENT &aEvent)
Navigate to previous sheet by numeric sheet number.
Definition:
sch_navigate_tool.cpp:140
SCH_NAVIGATE_TOOL::Previous
int Previous(const TOOL_EVENT &aEvent)
Navigate to next sheet by numeric sheet number.
Definition:
sch_navigate_tool.cpp:161
SCH_NAVIGATE_TOOL::Next
int Next(const TOOL_EVENT &aEvent)
Definition:
sch_navigate_tool.cpp:177
SCH_NAVIGATE_TOOL::m_navIndex
std::list< SCH_SHEET_PATH >::iterator m_navIndex
Definition:
sch_navigate_tool.h:89
SCH_NAVIGATE_TOOL::ChangeSheet
int ChangeSheet(const TOOL_EVENT &aEvent)
Enter selected sheet.
Definition:
sch_navigate_tool.cpp:224
SCH_NAVIGATE_TOOL::Forward
int Forward(const TOOL_EVENT &aEvent)
Navigate back in sheet history.
Definition:
sch_navigate_tool.cpp:119
SCH_NAVIGATE_TOOL::CanGoBack
bool CanGoBack()
Definition:
sch_navigate_tool.cpp:193
SCH_NAVIGATE_TOOL::EnterSheet
int EnterSheet(const TOOL_EVENT &aEvent)
Return to parent sheet. Synonymous with Up.
Definition:
sch_navigate_tool.cpp:235
SCH_NAVIGATE_TOOL::SCH_NAVIGATE_TOOL
SCH_NAVIGATE_TOOL()
Definition:
sch_navigate_tool.h:41
SCH_NAVIGATE_TOOL::g_BackLink
static wxString g_BackLink
Definition:
sch_navigate_tool.h:77
SCH_NAVIGATE_TOOL::CanGoUp
bool CanGoUp()
Definition:
sch_navigate_tool.cpp:205
SCH_NAVIGATE_TOOL::changeSheet
void changeSheet(SCH_SHEET_PATH aPath)
Definition:
sch_navigate_tool.cpp:297
SCH_NAVIGATE_TOOL::CanGoNext
bool CanGoNext()
Definition:
sch_navigate_tool.cpp:217
SCH_NAVIGATE_TOOL::Up
int Up(const TOOL_EVENT &aEvent)
Navigate forward in sheet history.
Definition:
sch_navigate_tool.cpp:111
SCH_NAVIGATE_TOOL::HypertextCommand
void HypertextCommand(const wxString &href)
Definition:
sch_navigate_tool.cpp:77
SCH_NAVIGATE_TOOL::setTransitions
void setTransitions() override
< Set up handlers for various events.
Definition:
sch_navigate_tool.cpp:270
SCH_NAVIGATE_TOOL::CanGoForward
bool CanGoForward()
Definition:
sch_navigate_tool.cpp:199
SCH_NAVIGATE_TOOL::CanGoPrevious
bool CanGoPrevious()
Definition:
sch_navigate_tool.cpp:211
SCH_NAVIGATE_TOOL::m_navHistory
std::list< SCH_SHEET_PATH > m_navHistory
Definition:
sch_navigate_tool.h:88
SCH_NAVIGATE_TOOL::LeaveSheet
int LeaveSheet(const TOOL_EVENT &aEvent)
Navigate up in sheet hierarchy.
Definition:
sch_navigate_tool.cpp:252
SCH_SHEET_PATH
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Definition:
sch_sheet_path.h:137
TOOL_EVENT
Generic, UI-independent tool event.
Definition:
tool_event.h:167
ee_tool_base.h
sch_base_frame.h
status_popup.h
src
eeschema
tools
sch_navigate_tool.h
Generated on Thu Dec 26 2024 00:05:09 for KiCad PCB EDA Suite by
1.9.6