kicad/pcbnew/tool_onrightclick.cpp

85 lines
1.6 KiB
C++
Raw Normal View History

/*************************/
/* tool_onrightclick.cpp */
/*************************/
#include "fctsys.h"
#include "confirm.h"
#include "pcbnew.h"
2009-07-30 11:04:07 +00:00
#include "wxPcbStruct.h"
#include "module_editor_frame.h"
#include "dialog_design_rules.h"
#include "pcbnew_id.h"
void PCB_EDIT_FRAME::ToolOnRightClick( wxCommandEvent& event )
{
2007-08-04 01:08:43 +00:00
wxPoint pos;
int id = event.GetSelection();
wxGetMousePosition( &pos.x, &pos.y );
switch( id )
{
case ID_TRACK_BUTT:
{
DIALOG_DESIGN_RULES dlg( this );
if( dlg.ShowModal() == wxID_OK )
{
updateTraceWidthSelectBox();
updateViaSizeSelectBox();
}
2007-08-04 01:08:43 +00:00
break;
}
2007-08-04 01:08:43 +00:00
case ID_PCB_MODULE_BUTT:
2007-08-04 01:08:43 +00:00
break;
case ID_PCB_CIRCLE_BUTT:
case ID_PCB_ARC_BUTT:
case ID_PCB_ADD_LINE_BUTT:
case ID_PCB_DIMENSION_BUTT:
case ID_PCB_ADD_TEXT_BUTT:
OnConfigurePcbOptions( event );
2007-08-04 01:08:43 +00:00
break;
case ID_PCB_PLACE_GRID_COORD_BUTT:
InstallGridFrame( wxDefaultPosition );
break;
2007-08-04 01:08:43 +00:00
default:
break;
}
}
2007-08-04 01:08:43 +00:00
void FOOTPRINT_EDIT_FRAME::ToolOnRightClick( wxCommandEvent& event )
{
2007-08-04 01:08:43 +00:00
wxPoint pos;
int id = event.GetSelection();
wxGetMousePosition( &pos.x, &pos.y );
pos.x -= 400;
pos.y -= 30;
switch( id )
{
case ID_MODEDIT_PAD_TOOL:
2009-12-19 19:24:49 +00:00
InstallPadOptionsFrame( NULL );
2007-08-04 01:08:43 +00:00
break;
case ID_MODEDIT_CIRCLE_TOOL:
case ID_MODEDIT_ARC_TOOL:
case ID_MODEDIT_LINE_TOOL:
case ID_MODEDIT_TEXT_TOOL:
2007-08-04 01:08:43 +00:00
InstallOptionsFrame( pos );
break;
default:
DisplayError( this, wxT( "ToolOnRightClick() error" ) );
break;
}
}