KiCad PCB EDA Suite
gerbview_actions.cpp
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) 2017 Jon Evans <jon@craftyjon.com>
5  * Copyright (C) 2017 KiCad Developers, see AUTHORS.txt for contributors.
6  *
7  * This program is free software: you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the
9  * Free Software Foundation, either version 3 of the License, or (at your
10  * option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #include <tool/tool_manager.h>
22 #include <tool/common_tools.h>
23 #include <tool/zoom_tool.h>
24 #include <gerbview_id.h>
25 
26 #include "gerbview_actions.h"
27 #include "selection_tool.h"
28 #include "gerbview_control.h"
29 
30 
32 {
33  aToolManager->RegisterTool( new COMMON_TOOLS );
34  aToolManager->RegisterTool( new GERBVIEW_SELECTION_TOOL );
35  aToolManager->RegisterTool( new GERBVIEW_CONTROL );
36  aToolManager->RegisterTool( new ZOOM_TOOL );
37 }
38 
40 {
41  switch( aId )
42  {
43  case ID_ZOOM_IN: // toolbar button "Zoom In"
45 
46  case ID_ZOOM_OUT: // toolbar button "Zoom In"
48 
49  case ID_ZOOM_PAGE: // toolbar button "Fit on Screen"
51 
52  case ID_ZOOM_SELECTION:
54 
57 
60 
63 
66 
69 
72  break;
73  }
74 
75  return OPT<TOOL_EVENT>();
76 }
static TOOL_ACTION zoomInCenter
Definition: actions.h:53
virtual void RegisterAllTools(TOOL_MANAGER *aToolManager) override
>
static TOOL_ACTION zoomTool
Definition: actions.h:58
Definition: id.h:241
static TOOL_ACTION zoomFitScreen
Definition: actions.h:56
static TOOL_ACTION highlightNet
static TOOL_ACTION zoomOutCenter
Definition: actions.h:54
Class TOOL_MANAGER.
Definition: tool_manager.h:49
static TOOL_ACTION measureTool
static TOOL_ACTION selectionTool
static TOOL_ACTION highlightAttribute
Class COMMON_TOOLS.
Definition: common_tools.h:38
Class GERBVIEW_SELECTION_TOOL.
TOOL_EVENT MakeEvent() const
Function HasHotKey() Checks if the action has a hot key assigned.
Definition: tool_action.h:104
static TOOL_ACTION highlightClear
boost::optional< T > OPT
Definition: optional.h:7
virtual OPT< TOOL_EVENT > TranslateLegacyId(int aId) override
>
void RegisterTool(TOOL_BASE *aTool)
Function RegisterTool() Adds a tool to the manager set and sets it up.
Class PCBNEW_CONTROL.
static TOOL_ACTION highlightComponent