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 {
40 
41  GERBER_DRAW_ITEM* DrawStruct = Locate( aPosition, CURSEUR_OFF_GRILLE );
42 
43  GetScreen()->SetCurItem( DrawStruct );
44 
45  if( DrawStruct == NULL )
46  {
48 
49  if( gerber )
50  gerber->DisplayImageInfo( this );
51  }
52 }
53 
54 
55 /* Called on a double click of left mouse button.
56  */
57 void GERBVIEW_FRAME::OnLeftDClick( wxDC* aDC, const wxPoint& aPosition )
58 {
59  // Currently: no nothing
60 }
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 ...
int GetActiveLayer()
Function SetActiveLayer returns the active layer.
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:347
Helper dialog and control classes.
void OnLeftClick(wxDC *aDC, const wxPoint &aMousePos) override
virtual void SetToolID(int aId, int aCursor, const wxString &aToolMsg)
Function SetToolID sets the tool command ID to aId and sets the cursor to aCursor.
Definition: draw_frame.cpp:546
GERBER_DRAW_ITEM * Locate(const wxPoint &aPosition, int typeloc)
Definition: locate.cpp:43
EDA_DRAW_PANEL * m_canvas
The area to draw on.
Definition: draw_frame.h:93
#define CURSEUR_OFF_GRILLE
Definition: pcbnew.h:47
GERBER_FILE_IMAGE * GetGbrImage(int aIdx) const
int GetDefaultCursor() const
Function GetDefaultCursor.