kicad/pcbnew/tool_onrightclick.cpp

81 lines
1.6 KiB
C++
Raw Normal View History

/*************************/
/* tool_onrightclick.cpp */
/*************************/
#include "fctsys.h"
#include "common.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"
2007-08-04 01:08:43 +00:00
void WinEDA_PcbFrame::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 );
dlg.ShowModal();
2007-08-04 01:08:43 +00:00
break;
}
2007-08-04 01:08:43 +00:00
case ID_COMPONENT_BUTT:
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 WinEDA_ModuleEditFrame::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_ADD_PAD:
2009-12-19 19:24:49 +00:00
InstallPadOptionsFrame( NULL );
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:
2007-08-04 01:08:43 +00:00
InstallOptionsFrame( pos );
break;
default:
DisplayError( this, wxT( "ToolOnRightClick() error" ) );
break;
}
}