2011-03-14 21:19:13 +00:00
|
|
|
/******************************************************************/
|
|
|
|
/* onleftclick.cpp: functions called on left or double left click */
|
|
|
|
/******************************************************************/
|
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <fctsys.h>
|
|
|
|
#include <class_drawpanel.h>
|
|
|
|
#include <common.h>
|
2011-03-14 21:19:13 +00:00
|
|
|
//#include "gestfich.h"
|
|
|
|
//#include "appl_wxstruct.h"
|
|
|
|
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <gerbview.h>
|
2011-03-14 21:19:13 +00:00
|
|
|
//#include "pcbplot.h"
|
|
|
|
//#include "kicad_device_context.h"
|
2012-01-23 04:33:36 +00:00
|
|
|
#include <gerbview_id.h>
|
|
|
|
#include <class_GERBER.h>
|
|
|
|
#include <dialog_helpers.h>
|
|
|
|
#include <class_DCodeSelectionbox.h>
|
2011-03-14 21:19:13 +00:00
|
|
|
|
|
|
|
/* Process the command triggered by the left button of the mouse when a tool
|
|
|
|
* is already selected.
|
|
|
|
*/
|
|
|
|
void GERBVIEW_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition )
|
|
|
|
{
|
2012-05-04 17:44:42 +00:00
|
|
|
GERBER_DRAW_ITEM* DrawStruct = (GERBER_DRAW_ITEM*) GetScreen()->GetCurItem();
|
2011-03-14 21:19:13 +00:00
|
|
|
wxString msg;
|
|
|
|
|
|
|
|
if( GetToolId() == ID_NO_TOOL_SELECTED )
|
|
|
|
{
|
2011-12-21 13:42:02 +00:00
|
|
|
if( DrawStruct && DrawStruct->GetFlags() )
|
2011-03-14 21:19:13 +00:00
|
|
|
{
|
|
|
|
msg.Printf( wxT( "GERBVIEW_FRAME::OnLeftClick err: Struct %d, m_Flags = %X" ),
|
|
|
|
(unsigned) DrawStruct->Type(),
|
2011-12-21 13:42:02 +00:00
|
|
|
(unsigned) DrawStruct->GetFlags() );
|
2011-03-14 21:19:13 +00:00
|
|
|
wxFAIL_MSG( msg );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
DrawStruct = Locate( aPosition, CURSEUR_OFF_GRILLE );
|
2012-05-04 17:44:42 +00:00
|
|
|
GetScreen()->SetCurItem( DrawStruct );
|
2011-03-14 21:19:13 +00:00
|
|
|
if( DrawStruct == NULL )
|
|
|
|
{
|
|
|
|
GERBER_IMAGE* gerber = g_GERBER_List[getActiveLayer() ];
|
|
|
|
if( gerber )
|
|
|
|
gerber->DisplayImageInfo( );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
switch( GetToolId() )
|
|
|
|
{
|
|
|
|
case ID_NO_TOOL_SELECTED:
|
|
|
|
break;
|
|
|
|
|
|
|
|
if( DrawStruct == NULL )
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
wxFAIL_MSG( wxT( "GERBVIEW_FRAME::ProcessCommand error" ) );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Called on a double click of left mouse button.
|
|
|
|
*/
|
|
|
|
void GERBVIEW_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& aPosition )
|
|
|
|
{
|
|
|
|
// Currently: no nothing
|
|
|
|
}
|