KiCad PCB EDA Suite
Loading...
Searching...
No Matches
sch_design_block_control.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-2024 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24
25#ifndef SCH_DESIGN_BLOCK_CONTROL_H
26#define SCH_DESIGN_BLOCK_CONTROL_H
27
28#include <sch_base_frame.h>
29#include <tools/ee_tool_base.h>
30
34class SCH_DESIGN_BLOCK_CONTROL : public wxEvtHandler, public EE_TOOL_BASE<SCH_BASE_FRAME>
35{
36public:
37 SCH_DESIGN_BLOCK_CONTROL() : EE_TOOL_BASE<SCH_BASE_FRAME>( "eeschema.SchDesignBlockControl" ) {}
38
40 bool Init() override;
41
42 int PinLibrary( const TOOL_EVENT& aEvent );
43 int UnpinLibrary( const TOOL_EVENT& aEvent );
44
45 int NewLibrary( const TOOL_EVENT& aEvent );
46 int DeleteLibrary( const TOOL_EVENT& aEvent );
47
48 int SaveSheetAsDesignBlock( const TOOL_EVENT& aEvent );
49 int SaveSelectionAsDesignBlock( const TOOL_EVENT& aEvent );
50 int DeleteDesignBlock( const TOOL_EVENT& aEvent );
51 int EditDesignBlockProperties( const TOOL_EVENT& aEvent );
52
53 int HideLibraryTree( const TOOL_EVENT& aEvent );
54
55private:
58 void setTransitions() override;
59
62
64};
65
66
67#endif
A foundation class for a tool operating on a schematic or symbol.
Definition: ee_tool_base.h:48
A logical library item identifier and consists of various portions much like a URI.
Definition: lib_id.h:49
Model class in the component selector Model-View-Adapter (mediated MVC) architecture.
A shim class between EDA_DRAW_FRAME and several derived classes: SYMBOL_EDIT_FRAME,...
Handle schematic design block actions in the schematic editor.
int DeleteDesignBlock(const TOOL_EVENT &aEvent)
int PinLibrary(const TOOL_EVENT &aEvent)
int HideLibraryTree(const TOOL_EVENT &aEvent)
LIB_ID getSelectedLibId()
Set up handlers for various events.
int SaveSheetAsDesignBlock(const TOOL_EVENT &aEvent)
int EditDesignBlockProperties(const TOOL_EVENT &aEvent)
void setTransitions() override
This method is meant to be overridden in order to specify handlers for events.
int DeleteLibrary(const TOOL_EVENT &aEvent)
int SaveSelectionAsDesignBlock(const TOOL_EVENT &aEvent)
bool Init() override
Init() is called once upon a registration of the tool.
DESIGN_BLOCK_PANE * getDesignBlockPane()
int UnpinLibrary(const TOOL_EVENT &aEvent)
int NewLibrary(const TOOL_EVENT &aEvent)
Schematic editor (Eeschema) main window.
Generic, UI-independent tool event.
Definition: tool_event.h:167