You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.9 KiB

  1. /******************************************************************/
  2. /* onleftclick.cpp: functions called on left or double left click */
  3. /******************************************************************/
  4. #include "fctsys.h"
  5. #include "class_drawpanel.h"
  6. #include "common.h"
  7. //#include "gestfich.h"
  8. //#include "appl_wxstruct.h"
  9. #include "gerbview.h"
  10. //#include "pcbplot.h"
  11. //#include "kicad_device_context.h"
  12. #include "gerbview_id.h"
  13. #include "class_GERBER.h"
  14. #include "dialog_helpers.h"
  15. #include "class_DCodeSelectionbox.h"
  16. /* Process the command triggered by the left button of the mouse when a tool
  17. * is already selected.
  18. */
  19. void GERBVIEW_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition )
  20. {
  21. BOARD_ITEM* DrawStruct = GetScreen()->GetCurItem();
  22. wxString msg;
  23. if( GetToolId() == ID_NO_TOOL_SELECTED )
  24. {
  25. if( DrawStruct && DrawStruct->m_Flags )
  26. {
  27. msg.Printf( wxT( "GERBVIEW_FRAME::OnLeftClick err: Struct %d, m_Flags = %X" ),
  28. (unsigned) DrawStruct->Type(),
  29. (unsigned) DrawStruct->m_Flags );
  30. wxFAIL_MSG( msg );
  31. }
  32. else
  33. {
  34. DrawStruct = Locate( aPosition, CURSEUR_OFF_GRILLE );
  35. GetScreen()->SetCurItem( DrawStruct );
  36. if( DrawStruct == NULL )
  37. {
  38. GERBER_IMAGE* gerber = g_GERBER_List[getActiveLayer() ];
  39. if( gerber )
  40. gerber->DisplayImageInfo( );
  41. }
  42. }
  43. }
  44. switch( GetToolId() )
  45. {
  46. case ID_NO_TOOL_SELECTED:
  47. break;
  48. if( DrawStruct == NULL )
  49. break;
  50. default:
  51. wxFAIL_MSG( wxT( "GERBVIEW_FRAME::ProcessCommand error" ) );
  52. break;
  53. }
  54. }
  55. /* Called on a double click of left mouse button.
  56. */
  57. void GERBVIEW_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& aPosition )
  58. {
  59. // Currently: no nothing
  60. }