KiCad PCB EDA Suite
gerbview/onleftclick.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) 2011-2014 Jean-Pierre Charras jp.charras at wanadoo.fr
5  * Copyright (C) 1992-2014 KiCad Developers, see change_log.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 #include <fctsys.h>
26 #include <class_drawpanel.h>
27 
28 #include <gerbview.h>
29 #include <gerbview_frame.h>
32 #include <dialog_helpers.h>
33 
34 /* Process the command triggered by the left button of the mouse
35  * currently: just display info in the message panel.
36  */
37 void GERBVIEW_FRAME::OnLeftClick( wxDC* aDC, const wxPoint& aPosition )
38 {
39  GERBER_DRAW_ITEM* DrawStruct = Locate( aPosition, CURSEUR_OFF_GRILLE );
40 
41  GetScreen()->SetCurItem( DrawStruct );
42 
43  if( DrawStruct == NULL )
44  {
46 
47  if( gerber )
48  gerber->DisplayImageInfo( this );
49  }
50 }
51 
52 
53 /* Called on a double click of left mouse button.
54  */
55 void GERBVIEW_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition )
56 {
57  // Currently: no nothing
58 }
void SetCurItem(EDA_ITEM *aItem)
Function SetCurItem sets the currently selected object, m_CurrentItem.
void OnLeftDClick(wxDC *aDC, const wxPoint &aMousePos) override
Class GERBER_FILE_IMAGE holds the Image data and parameters for one gerber file and layer parameters ...
void DisplayImageInfo(GERBVIEW_FRAME *aMainFrame)
Function DisplayImageInfo has knowledge about the frame and how and where to put status information a...
virtual BASE_SCREEN * GetScreen() const
Function GetScreen returns a pointer to a BASE_SCREEN or one of its derivatives.
Definition: draw_frame.h:309
Helper dialog and control classes.
void OnLeftClick(wxDC *aDC, const wxPoint &aMousePos) override
GERBER_DRAW_ITEM * Locate(const wxPoint &aPosition, int typeloc)
Definition: locate.cpp:43
int getActiveLayer()
Function getActiveLayer returns the active layer.
#define CURSEUR_OFF_GRILLE
Definition: pcbnew.h:47
GERBER_FILE_IMAGE * GetGbrImage(int aIdx) const