KiCad PCB EDA Suite
tool_onrightclick.cpp
Go to the documentation of this file.
1 
5 /*
6  * This program source code file is part of KiCad, a free EDA CAD application.
7  *
8  * Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
9  * Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
10  * Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, you may find one here:
24  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
25  * or you may search the http://www.gnu.org website for the version 2 license,
26  * or you may write to the Free Software Foundation, Inc.,
27  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
28  */
29 
30 #include <fctsys.h>
31 #include <confirm.h>
32 #include <pcbnew.h>
33 #include <wxPcbStruct.h>
34 #include <module_editor_frame.h>
35 #include <dialog_design_rules.h>
36 #include <pcbnew_id.h>
37 
38 
39 void PCB_EDIT_FRAME::ToolOnRightClick( wxCommandEvent& event )
40 {
41  wxPoint pos;
42  int id = event.GetSelection();
43 
44  wxGetMousePosition( &pos.x, &pos.y );
45 
46  switch( id )
47  {
48  case ID_TRACK_BUTT:
49  {
50  DIALOG_DESIGN_RULES dlg( this );
51 
52  if( dlg.ShowModal() == wxID_OK )
53  {
55  }
56 
57  break;
58  }
59 
60  case ID_PCB_MODULE_BUTT:
61  break;
62 
63  case ID_PCB_CIRCLE_BUTT:
64  case ID_PCB_ARC_BUTT:
68  OnConfigurePcbOptions( event );
69  break;
70 
73  break;
74 
75  default:
76  break;
77  }
78 }
79 
80 
81 void FOOTPRINT_EDIT_FRAME::ToolOnRightClick( wxCommandEvent& event )
82 {
83  wxPoint pos;
84  int id = event.GetSelection();
85 
86  wxGetMousePosition( &pos.x, &pos.y );
87  pos.x -= 400;
88  pos.y -= 30;
89 
90  switch( id )
91  {
93  InstallPadOptionsFrame( NULL );
94  break;
95 
100  InstallOptionsFrame( pos );
101  break;
102 
103  default:
104  DisplayError( this, wxT( "ToolOnRightClick() error" ) );
105  break;
106  }
107 }
Definition of class FOOTPRINT_EDIT_FRAME.
This file is part of the common library.
void ToolOnRightClick(wxCommandEvent &event) override
void InstallOptionsFrame(const wxPoint &pos)
void OnConfigurePcbOptions(wxCommandEvent &aEvent)
void ToolOnRightClick(wxCommandEvent &event) override
void InstallPadOptionsFrame(D_PAD *pad)
void DisplayError(wxWindow *parent, const wxString &text, int displaytime)
Function DisplayError displays an error or warning message box with aMessage.
Definition: confirm.cpp:69
void ReCreateAuxiliaryToolbar() override
Definition: tool_pcb.cpp:544