kicad/pcbnew/tool_onrightclick.cpp

78 lines
1.5 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 "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 );
pos.x -= 400;
pos.y -= 30;
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:
2007-08-04 01:08:43 +00:00
case ID_PCB_COTATION_BUTT:
case ID_PCB_ADD_TEXT_BUTT:
2009-12-19 19:24:49 +00:00
InstallPcbOptionsFrame( ID_PCB_DRAWINGS_WIDTHS_SETUP );
2007-08-04 01:08:43 +00:00
break;
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:
2007-08-04 01:08:43 +00:00
case ID_PCB_COTATION_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;
}
}