2007-08-20 01:20:48 +00:00
|
|
|
/******************************************************/
|
|
|
|
/* schedit.cpp: fonctions generales de la schematique */
|
|
|
|
/******************************************************/
|
2007-05-06 16:03:28 +00:00
|
|
|
|
|
|
|
#include "fctsys.h"
|
|
|
|
|
|
|
|
#include "gr_basic.h"
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
#include "program.h"
|
|
|
|
#include "libcmp.h"
|
|
|
|
#include "general.h"
|
|
|
|
|
|
|
|
#include "id.h"
|
|
|
|
|
|
|
|
#include "protos.h"
|
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
|
2008-02-27 19:38:16 +00:00
|
|
|
/*****************************************************************************
|
2008-03-10 11:42:41 +00:00
|
|
|
*
|
|
|
|
* Traite les selections d'outils et les commandes appelees du menu POPUP
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
2008-02-27 19:38:16 +00:00
|
|
|
void WinEDA_SchematicFrame::Process_Special_Functions( wxCommandEvent& event )
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2008-04-17 16:25:29 +00:00
|
|
|
int id = event.GetId();
|
|
|
|
wxPoint pos;
|
|
|
|
wxClientDC dc( DrawPanel );
|
|
|
|
SCH_SCREEN* screen = GetScreen();
|
2007-08-20 01:20:48 +00:00
|
|
|
|
|
|
|
DrawPanel->PrepareGraphicContext( &dc );
|
|
|
|
|
|
|
|
pos = wxGetMousePosition();
|
|
|
|
|
|
|
|
pos.y += 20;
|
|
|
|
|
|
|
|
// If needed, stop the current command and deselect current tool
|
|
|
|
switch( id )
|
|
|
|
{
|
2008-03-10 11:42:41 +00:00
|
|
|
case ID_POPUP_SCH_ENTRY_SELECT_SLASH:
|
|
|
|
case ID_POPUP_SCH_ENTRY_SELECT_ANTISLASH:
|
|
|
|
case ID_POPUP_END_LINE:
|
|
|
|
case ID_POPUP_SCH_EDIT_TEXT:
|
|
|
|
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_LABEL:
|
|
|
|
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL:
|
|
|
|
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT:
|
|
|
|
case ID_POPUP_SCH_SET_SHAPE_TEXT:
|
|
|
|
case ID_POPUP_SCH_ROTATE_TEXT:
|
|
|
|
case ID_POPUP_SCH_EDIT_SHEET:
|
|
|
|
case ID_POPUP_SCH_CLEANUP_SHEET:
|
|
|
|
case ID_POPUP_SCH_END_SHEET:
|
|
|
|
case ID_POPUP_SCH_RESIZE_SHEET:
|
|
|
|
case ID_POPUP_SCH_EDIT_PINSHEET:
|
|
|
|
case ID_POPUP_SCH_MOVE_PINSHEET:
|
|
|
|
case ID_POPUP_SCH_MOVE_ITEM_REQUEST:
|
|
|
|
case ID_POPUP_SCH_MOVE_CMP_REQUEST:
|
|
|
|
case ID_POPUP_SCH_DRAG_CMP_REQUEST:
|
|
|
|
case ID_POPUP_SCH_EDIT_CMP:
|
|
|
|
case ID_POPUP_SCH_MIROR_X_CMP:
|
|
|
|
case ID_POPUP_SCH_MIROR_Y_CMP:
|
|
|
|
case ID_POPUP_SCH_ROTATE_CMP_CLOCKWISE:
|
|
|
|
case ID_POPUP_SCH_ROTATE_CMP_COUNTERCLOCKWISE:
|
|
|
|
case ID_POPUP_SCH_ORIENT_NORMAL_CMP:
|
|
|
|
case ID_POPUP_SCH_INIT_CMP:
|
|
|
|
case ID_POPUP_SCH_DISPLAYDOC_CMP:
|
|
|
|
case ID_POPUP_SCH_EDIT_VALUE_CMP:
|
|
|
|
case ID_POPUP_SCH_EDIT_REF_CMP:
|
|
|
|
case ID_POPUP_SCH_EDIT_FOOTPRINT_CMP:
|
|
|
|
case ID_POPUP_SCH_EDIT_CONVERT_CMP:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT_CMP:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT1:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT2:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT3:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT4:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT5:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT6:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT7:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT8:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT9:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT10:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT11:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT12:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT13:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT14:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT15:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT16:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT17:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT18:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT19:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT20:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT21:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT22:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT23:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT24:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT25:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT26:
|
|
|
|
case ID_POPUP_SCH_ROTATE_FIELD:
|
|
|
|
case ID_POPUP_SCH_EDIT_FIELD:
|
|
|
|
case ID_POPUP_DELETE_BLOCK:
|
|
|
|
case ID_POPUP_PLACE_BLOCK:
|
|
|
|
case ID_POPUP_ZOOM_BLOCK:
|
|
|
|
case ID_POPUP_DRAG_BLOCK:
|
|
|
|
case ID_POPUP_COPY_BLOCK:
|
|
|
|
case ID_POPUP_ROTATE_BLOCK:
|
|
|
|
case ID_POPUP_MIRROR_X_BLOCK:
|
|
|
|
case ID_POPUP_MIRROR_Y_BLOCK:
|
|
|
|
case ID_POPUP_SCH_DELETE_NODE:
|
|
|
|
case ID_POPUP_SCH_DELETE_CONNECTION:
|
|
|
|
case wxID_CUT:
|
|
|
|
case wxID_COPY:
|
|
|
|
case ID_POPUP_SCH_ENTER_SHEET:
|
|
|
|
case ID_POPUP_SCH_LEAVE_SHEET:
|
|
|
|
case ID_POPUP_SCH_ADD_JUNCTION:
|
|
|
|
case ID_POPUP_SCH_ADD_LABEL:
|
|
|
|
|
|
|
|
/* At this point: Do nothing. these commands do not need to stop the current command
|
|
|
|
* (mainly a block command) or reset the current state
|
|
|
|
* They will be executed later, in next switch structure.
|
|
|
|
*/
|
|
|
|
break;
|
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
case ID_POPUP_CANCEL_CURRENT_COMMAND:
|
2008-04-17 16:25:29 +00:00
|
|
|
if( screen->BlockLocate.m_Command != BLOCK_IDLE )
|
2008-02-26 01:07:38 +00:00
|
|
|
DrawPanel->SetCursor( wxCursor( DrawPanel->m_PanelCursor =
|
2008-03-10 11:42:41 +00:00
|
|
|
DrawPanel->
|
|
|
|
m_PanelDefaultCursor ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
|
|
|
|
if( DrawPanel->ManageCurseur && DrawPanel->ForceCloseManageCurseur )
|
|
|
|
{
|
|
|
|
DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc );
|
|
|
|
}
|
|
|
|
/* ne devrait pas etre execute, sauf bug: */
|
2008-04-17 16:25:29 +00:00
|
|
|
if( screen->BlockLocate.m_Command != BLOCK_IDLE )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
2008-04-17 16:25:29 +00:00
|
|
|
screen->BlockLocate.m_Command = BLOCK_IDLE;
|
|
|
|
screen->BlockLocate.m_State = STATE_NO_BLOCK;
|
|
|
|
screen->BlockLocate.m_BlockDrawStruct = NULL;
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_DELETE_CMP:
|
|
|
|
case ID_POPUP_SCH_DELETE: // Stop the, current command, keep the current tool
|
|
|
|
if( DrawPanel->ManageCurseur && DrawPanel->ForceCloseManageCurseur )
|
|
|
|
{
|
|
|
|
DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default: // Stop the current command, and deselect the current tool
|
|
|
|
if( DrawPanel->ManageCurseur && DrawPanel->ForceCloseManageCurseur )
|
|
|
|
{
|
|
|
|
DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc );
|
|
|
|
}
|
2008-02-26 01:07:38 +00:00
|
|
|
DrawPanel->m_PanelCursor = DrawPanel->m_PanelDefaultCursor =
|
|
|
|
wxCURSOR_ARROW;
|
2007-08-20 01:20:48 +00:00
|
|
|
SetToolID( 0, DrawPanel->m_PanelCursor, wxEmptyString );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2008-02-26 01:07:38 +00:00
|
|
|
// End switch commande en cours
|
2007-08-20 01:20:48 +00:00
|
|
|
|
|
|
|
switch( id ) // Command execution:
|
|
|
|
{
|
|
|
|
case ID_HIERARCHY:
|
|
|
|
InstallHierarchyFrame( &dc, pos );
|
|
|
|
g_ItemToRepeat = NULL;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case wxID_CUT:
|
2008-04-17 16:25:29 +00:00
|
|
|
if( screen->BlockLocate.m_Command != BLOCK_MOVE )
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
HandleBlockEndByPopUp( BLOCK_DELETE, &dc );
|
|
|
|
g_ItemToRepeat = NULL;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case wxID_PASTE:
|
2008-04-17 16:25:29 +00:00
|
|
|
HandleBlockBegin( &dc, BLOCK_PASTE, screen->m_Curseur );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_HIERARCHY_PUSH_POP_BUTT:
|
|
|
|
SetToolID( id, wxCURSOR_HAND, _( "Push/Pop Hierarchy" ) );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_NOCONN_BUTT:
|
|
|
|
SetToolID( id, wxCURSOR_PENCIL, _( "Add NoConnect Flag" ) );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_WIRE_BUTT:
|
|
|
|
SetToolID( id, wxCURSOR_PENCIL, _( "Add Wire" ) );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_BUS_BUTT:
|
|
|
|
SetToolID( id, wxCURSOR_PENCIL, _( "Add Bus" ) );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_LINE_COMMENT_BUTT:
|
|
|
|
SetToolID( id, wxCURSOR_PENCIL, _( "Add Drawing" ) );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_JUNCTION_BUTT:
|
|
|
|
SetToolID( id, wxCURSOR_PENCIL, _( "Add Junction" ) );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_LABEL_BUTT:
|
|
|
|
SetToolID( id, wxCURSOR_PENCIL, _( "Add Label" ) );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_GLABEL_BUTT:
|
|
|
|
SetToolID( id, wxCURSOR_PENCIL, _( "Add Global label" ) );
|
|
|
|
break;
|
2008-02-26 01:07:38 +00:00
|
|
|
|
|
|
|
case ID_HIERLABEL_BUTT:
|
|
|
|
SetToolID( id, wxCURSOR_PENCIL, _( "Add Hierarchal label" ) );
|
|
|
|
break;
|
2007-08-20 01:20:48 +00:00
|
|
|
|
|
|
|
case ID_TEXT_COMMENT_BUTT:
|
|
|
|
SetToolID( id, wxCURSOR_PENCIL, _( "Add Text" ) );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_WIRETOBUS_ENTRY_BUTT:
|
2008-11-09 18:15:24 +00:00
|
|
|
SetToolID( id, wxCURSOR_PENCIL, _( "Add Wire to Bus entry" ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_BUSTOBUS_ENTRY_BUTT:
|
|
|
|
SetToolID( id, wxCURSOR_PENCIL, _( "Add Bus to Bus entry" ) );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_SHEET_SYMBOL_BUTT:
|
|
|
|
SetToolID( id, wxCURSOR_PENCIL, _( "Add Sheet" ) );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_SHEET_LABEL_BUTT:
|
|
|
|
SetToolID( id, wxCURSOR_PENCIL, _( "Add PinSheet" ) );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_IMPORT_GLABEL_BUTT:
|
|
|
|
SetToolID( id, wxCURSOR_PENCIL, _( "Import PinSheet" ) );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_COMPONENT_BUTT:
|
|
|
|
SetToolID( id, wxCURSOR_PENCIL, _( "Add Component" ) );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_PLACE_POWER_BUTT:
|
|
|
|
SetToolID( id, wxCURSOR_PENCIL, _( "Add Power" ) );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_ENTRY_SELECT_SLASH:
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
|
|
|
SetBusEntryShape( &dc,
|
2008-04-17 16:25:29 +00:00
|
|
|
(DrawBusEntryStruct*) screen->GetCurItem(), '/' );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_ENTRY_SELECT_ANTISLASH:
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
|
|
|
SetBusEntryShape( &dc,
|
2008-04-17 16:25:29 +00:00
|
|
|
(DrawBusEntryStruct*) screen->GetCurItem(), '\\' );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_NO_SELECT_BUTT:
|
|
|
|
SetToolID( 0, wxCURSOR_ARROW, wxEmptyString );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_CANCEL_CURRENT_COMMAND:
|
|
|
|
if( m_ID_current_state == 0 )
|
|
|
|
SetToolID( 0, wxCURSOR_ARROW, wxEmptyString );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_END_LINE:
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
|
|
|
EndSegment( &dc );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_EDIT_TEXT:
|
2008-04-17 16:25:29 +00:00
|
|
|
EditSchematicText( (SCH_TEXT*) screen->GetCurItem(), &dc );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_ROTATE_TEXT:
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
2008-04-17 16:25:29 +00:00
|
|
|
ChangeTextOrient( (SCH_TEXT*) screen->GetCurItem(), &dc );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_LABEL:
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
2008-04-17 16:25:29 +00:00
|
|
|
ConvertTextType( (SCH_TEXT*) screen->GetCurItem(),
|
2008-03-20 01:50:21 +00:00
|
|
|
&dc, TYPE_SCH_LABEL );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_GLABEL:
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
2008-04-17 16:25:29 +00:00
|
|
|
ConvertTextType( (SCH_TEXT*) screen->GetCurItem(),
|
2008-03-20 01:50:21 +00:00
|
|
|
&dc, TYPE_SCH_GLOBALLABEL );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
2008-02-21 12:21:01 +00:00
|
|
|
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_HLABEL:
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
2008-04-17 16:25:29 +00:00
|
|
|
ConvertTextType( (SCH_TEXT*) screen->GetCurItem(),
|
2008-03-20 01:50:21 +00:00
|
|
|
&dc, TYPE_SCH_HIERLABEL );
|
2008-02-21 12:21:01 +00:00
|
|
|
break;
|
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
case ID_POPUP_SCH_CHANGE_TYPE_TEXT_TO_COMMENT:
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
2008-04-17 16:25:29 +00:00
|
|
|
ConvertTextType( (SCH_TEXT*) screen->GetCurItem(),
|
2008-03-20 01:50:21 +00:00
|
|
|
&dc, TYPE_SCH_TEXT );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_SET_SHAPE_TEXT:
|
|
|
|
|
2008-02-21 12:21:01 +00:00
|
|
|
// Not used
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_ROTATE_FIELD:
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
2008-09-17 17:26:25 +00:00
|
|
|
RotateCmpField( (SCH_CMP_FIELD*) screen->GetCurItem(), &dc );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_EDIT_FIELD:
|
2008-09-17 17:26:25 +00:00
|
|
|
EditCmpFieldText( (SCH_CMP_FIELD*) screen->GetCurItem(), &dc );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_DELETE_NODE:
|
|
|
|
case ID_POPUP_SCH_DELETE_CONNECTION:
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
2008-02-26 01:07:38 +00:00
|
|
|
DeleteConnection( &dc,
|
2008-03-10 11:42:41 +00:00
|
|
|
id == ID_POPUP_SCH_DELETE_CONNECTION ? TRUE : FALSE );
|
2008-04-17 16:25:29 +00:00
|
|
|
screen->SetCurItem( NULL );
|
2007-08-20 01:20:48 +00:00
|
|
|
g_ItemToRepeat = NULL;
|
2008-04-17 16:25:29 +00:00
|
|
|
TestDanglingEnds( screen->EEDrawList, &dc );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_BREAK_WIRE:
|
|
|
|
{
|
|
|
|
DrawPickedStruct* ListForUndo;
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
2008-04-17 16:25:29 +00:00
|
|
|
ListForUndo = BreakSegment( screen, screen->m_Curseur, TRUE );
|
2007-08-20 01:20:48 +00:00
|
|
|
if( ListForUndo )
|
|
|
|
SaveCopyInUndoList( ListForUndo, IS_NEW | IS_CHANGED );
|
2008-04-17 16:25:29 +00:00
|
|
|
TestDanglingEnds( screen->EEDrawList, &dc );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_DELETE_CMP:
|
2008-04-17 16:25:29 +00:00
|
|
|
if( screen->GetCurItem() == NULL )
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
2008-02-26 01:07:38 +00:00
|
|
|
// Ensure the struct is a component (could be a struct of a
|
|
|
|
// component, like Field, text..)
|
2008-04-17 16:25:29 +00:00
|
|
|
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
|
|
|
screen->SetCurItem( LocateSmallestComponent( screen ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
|
|
|
|
case ID_POPUP_SCH_DELETE:
|
2008-04-17 16:25:29 +00:00
|
|
|
{
|
|
|
|
SCH_ITEM* item = screen->GetCurItem();
|
|
|
|
if( item == NULL )
|
|
|
|
break;
|
|
|
|
|
|
|
|
DeleteStruct( DrawPanel, &dc, item );
|
|
|
|
screen->SetCurItem( NULL );
|
|
|
|
g_ItemToRepeat = NULL;
|
|
|
|
TestDanglingEnds( screen->EEDrawList, &dc );
|
|
|
|
screen->SetModify();
|
|
|
|
}
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_SCHEMATIC_DELETE_ITEM_BUTT:
|
|
|
|
SetToolID( id, wxCURSOR_BULLSEYE, _( "Delete item" ) );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_END_SHEET:
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
2008-04-17 16:25:29 +00:00
|
|
|
screen->GetCurItem()->Place( this, &dc );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_RESIZE_SHEET:
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
2008-04-17 16:25:29 +00:00
|
|
|
ReSizeSheet( (DrawSheetStruct*) screen->GetCurItem(), &dc );
|
|
|
|
TestDanglingEnds( screen->EEDrawList, &dc );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_EDIT_SHEET:
|
2008-04-17 16:25:29 +00:00
|
|
|
EditSheet( (DrawSheetStruct*) screen->GetCurItem(), &dc );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_CLEANUP_SHEET:
|
|
|
|
( (DrawSheetStruct*)
|
2008-04-25 07:33:45 +00:00
|
|
|
screen->GetCurItem() )->CleanupSheet( this, true );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_EDIT_PINSHEET:
|
2008-04-15 19:38:19 +00:00
|
|
|
Edit_PinSheet( (Hierarchical_PIN_Sheet_Struct*)
|
2008-04-17 16:25:29 +00:00
|
|
|
screen->GetCurItem(), &dc );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_MOVE_PINSHEET:
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
2008-04-15 19:38:19 +00:00
|
|
|
StartMove_PinSheet( (Hierarchical_PIN_Sheet_Struct*)
|
2008-04-17 16:25:29 +00:00
|
|
|
screen->GetCurItem(), &dc );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
2007-09-22 14:31:20 +00:00
|
|
|
case ID_POPUP_SCH_DRAG_CMP_REQUEST:
|
2007-08-20 01:20:48 +00:00
|
|
|
case ID_POPUP_SCH_MOVE_CMP_REQUEST:
|
2008-02-26 01:07:38 +00:00
|
|
|
|
|
|
|
// Ensure the struct is a component (could be a struct of a
|
|
|
|
// component, like Field, text..)
|
2008-04-17 16:25:29 +00:00
|
|
|
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
|
|
|
screen->SetCurItem( LocateSmallestComponent( screen ) );
|
|
|
|
if( screen->GetCurItem() == NULL )
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
2008-02-26 01:07:38 +00:00
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
case ID_POPUP_SCH_MOVE_ITEM_REQUEST:
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
2008-02-26 01:07:38 +00:00
|
|
|
if( id == ID_POPUP_SCH_DRAG_CMP_REQUEST )
|
|
|
|
{
|
|
|
|
// The easiest way to handle a drag component is simulate a
|
|
|
|
// block drag command
|
2008-04-17 16:25:29 +00:00
|
|
|
if( screen->BlockLocate.m_State == STATE_NO_BLOCK )
|
2007-09-22 14:31:20 +00:00
|
|
|
{
|
2008-02-26 01:07:38 +00:00
|
|
|
if( !HandleBlockBegin( &dc, BLOCK_DRAG,
|
2008-04-17 16:25:29 +00:00
|
|
|
screen->m_Curseur ) )
|
2008-02-26 01:07:38 +00:00
|
|
|
break;
|
2007-09-22 14:31:20 +00:00
|
|
|
HandleBlockEnd( &dc );
|
2008-02-26 01:07:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2008-04-17 16:25:29 +00:00
|
|
|
Process_Move_Item( (SCH_ITEM*) screen->GetCurItem(), &dc );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_EDIT_CMP:
|
2008-03-10 11:42:41 +00:00
|
|
|
|
2008-02-26 01:07:38 +00:00
|
|
|
// Ensure the struct is a component (could be a struct of a
|
|
|
|
// component, like Field, text..)
|
2008-04-17 16:25:29 +00:00
|
|
|
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
|
|
|
screen->SetCurItem( LocateSmallestComponent( screen ) );
|
|
|
|
if( screen->GetCurItem() == NULL )
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
InstallCmpeditFrame( this, pos,
|
2008-04-17 16:25:29 +00:00
|
|
|
(SCH_COMPONENT*) screen->GetCurItem() );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_MIROR_X_CMP:
|
|
|
|
case ID_POPUP_SCH_MIROR_Y_CMP:
|
|
|
|
case ID_POPUP_SCH_ROTATE_CMP_CLOCKWISE:
|
|
|
|
case ID_POPUP_SCH_ROTATE_CMP_COUNTERCLOCKWISE:
|
|
|
|
case ID_POPUP_SCH_ORIENT_NORMAL_CMP:
|
2008-03-10 11:42:41 +00:00
|
|
|
|
2008-02-26 01:07:38 +00:00
|
|
|
// Ensure the struct is a component (could be a struct of a
|
|
|
|
// component, like Field, text..)
|
2008-04-17 16:25:29 +00:00
|
|
|
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
|
|
|
screen->SetCurItem( LocateSmallestComponent( screen ) );
|
|
|
|
if( screen->GetCurItem() == NULL )
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
{
|
|
|
|
int option;
|
|
|
|
|
|
|
|
switch( id )
|
|
|
|
{
|
|
|
|
case ID_POPUP_SCH_MIROR_X_CMP:
|
|
|
|
option = CMP_MIROIR_X; break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_MIROR_Y_CMP:
|
|
|
|
option = CMP_MIROIR_Y; break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_ROTATE_CMP_COUNTERCLOCKWISE:
|
|
|
|
option = CMP_ROTATE_COUNTERCLOCKWISE; break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_ROTATE_CMP_CLOCKWISE:
|
|
|
|
option = CMP_ROTATE_CLOCKWISE; break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
case ID_POPUP_SCH_ORIENT_NORMAL_CMP:
|
|
|
|
option = CMP_NORMAL; break;
|
|
|
|
}
|
|
|
|
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
2008-04-17 16:25:29 +00:00
|
|
|
if( screen->GetCurItem()->m_Flags == 0 )
|
|
|
|
SaveCopyInUndoList( (SCH_ITEM*) screen->GetCurItem(), IS_CHANGED );
|
2008-03-13 05:04:59 +00:00
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
CmpRotationMiroir(
|
2008-04-17 16:25:29 +00:00
|
|
|
(SCH_COMPONENT*) screen->GetCurItem(),
|
2007-08-20 01:20:48 +00:00
|
|
|
&dc, option );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_INIT_CMP:
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_EDIT_VALUE_CMP:
|
|
|
|
|
2008-02-26 01:07:38 +00:00
|
|
|
// Ensure the struct is a component (could be a struct of a
|
|
|
|
// component, like Field, text..)
|
2008-04-17 16:25:29 +00:00
|
|
|
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
|
|
|
screen->SetCurItem( LocateSmallestComponent( screen ) );
|
|
|
|
if( screen->GetCurItem() == NULL )
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
2008-03-13 05:04:59 +00:00
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
EditComponentValue(
|
2008-04-17 16:25:29 +00:00
|
|
|
(SCH_COMPONENT*) screen->GetCurItem(), &dc );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_EDIT_REF_CMP:
|
2008-03-10 11:42:41 +00:00
|
|
|
|
2008-02-26 01:07:38 +00:00
|
|
|
// Ensure the struct is a component (could be a struct of a
|
|
|
|
// component, like Field, text..)
|
2008-04-17 16:25:29 +00:00
|
|
|
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
|
|
|
screen->SetCurItem( LocateSmallestComponent( screen ) );
|
|
|
|
if( screen->GetCurItem() == NULL )
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
2008-03-13 05:04:59 +00:00
|
|
|
|
2007-08-20 01:20:48 +00:00
|
|
|
EditComponentReference(
|
2008-04-17 16:25:29 +00:00
|
|
|
(SCH_COMPONENT*) screen->GetCurItem(), &dc );
|
2008-02-26 01:07:38 +00:00
|
|
|
break;
|
2007-12-11 16:41:43 +00:00
|
|
|
|
2008-02-26 01:07:38 +00:00
|
|
|
case ID_POPUP_SCH_EDIT_FOOTPRINT_CMP:
|
2008-03-10 11:42:41 +00:00
|
|
|
|
2008-02-26 01:07:38 +00:00
|
|
|
// Ensure the struct is a component (could be a struct of a
|
|
|
|
// component, like Field, text..)
|
2008-04-17 16:25:29 +00:00
|
|
|
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
|
|
|
screen->SetCurItem( LocateSmallestComponent( screen ) );
|
|
|
|
if( screen->GetCurItem() == NULL )
|
2007-12-11 16:41:43 +00:00
|
|
|
break;
|
|
|
|
EditComponentFootprint(
|
2008-04-17 16:25:29 +00:00
|
|
|
(SCH_COMPONENT*) screen->GetCurItem(), &dc );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
2008-02-26 01:07:38 +00:00
|
|
|
case ID_POPUP_SCH_EDIT_CONVERT_CMP:
|
2008-03-10 11:42:41 +00:00
|
|
|
|
2008-02-26 01:07:38 +00:00
|
|
|
// Ensure the struct is a component (could be a struct of a
|
|
|
|
// component, like Field, text..)
|
2008-04-17 16:25:29 +00:00
|
|
|
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
|
|
|
screen->SetCurItem( LocateSmallestComponent( screen ) );
|
|
|
|
if( screen->GetCurItem() == NULL )
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
|
|
|
ConvertPart(
|
2008-04-17 16:25:29 +00:00
|
|
|
(SCH_COMPONENT*) screen->GetCurItem(),
|
2007-08-20 01:20:48 +00:00
|
|
|
&dc );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_COPY_COMPONENT_CMP:
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
|
|
|
{
|
2008-03-20 01:50:21 +00:00
|
|
|
SCH_COMPONENT* olditem, * newitem;
|
2008-04-17 16:25:29 +00:00
|
|
|
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
|
|
|
screen->SetCurItem( LocateSmallestComponent( screen ) );
|
|
|
|
olditem = (SCH_COMPONENT*) screen->GetCurItem();
|
2007-08-20 01:20:48 +00:00
|
|
|
if( olditem == NULL )
|
|
|
|
break;
|
|
|
|
newitem = olditem->GenCopy();
|
2008-02-26 01:07:38 +00:00
|
|
|
newitem->m_TimeStamp = GetTimeStamp();
|
2008-04-21 06:34:56 +00:00
|
|
|
newitem->ClearAnnotation(NULL);
|
2007-08-20 01:20:48 +00:00
|
|
|
newitem->m_Flags = IS_NEW;
|
|
|
|
StartMovePart( newitem, &dc );
|
2008-03-10 11:42:41 +00:00
|
|
|
|
2008-02-26 01:07:38 +00:00
|
|
|
/* Redraw the original part, because StartMovePart() has erase
|
|
|
|
* it from screen */
|
2007-08-20 01:20:48 +00:00
|
|
|
RedrawOneStruct( DrawPanel, &dc, olditem, GR_DEFAULT_DRAWMODE );
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT1:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT2:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT3:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT4:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT5:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT6:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT7:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT8:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT9:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT10:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT11:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT12:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT13:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT14:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT15:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT16:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT17:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT18:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT19:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT20:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT21:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT22:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT23:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT24:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT25:
|
|
|
|
case ID_POPUP_SCH_SELECT_UNIT26:
|
2008-03-10 11:42:41 +00:00
|
|
|
|
2008-02-26 01:07:38 +00:00
|
|
|
// Ensure the struct is a component (could be a struct of a
|
|
|
|
// component, like Field, text..)
|
2008-04-17 16:25:29 +00:00
|
|
|
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
|
|
|
screen->SetCurItem( LocateSmallestComponent( screen ) );
|
|
|
|
if( screen->GetCurItem() == NULL )
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
|
|
|
SelPartUnit(
|
2008-04-17 16:25:29 +00:00
|
|
|
(SCH_COMPONENT*) screen->GetCurItem(),
|
2007-08-20 01:20:48 +00:00
|
|
|
id + 1 - ID_POPUP_SCH_SELECT_UNIT1,
|
|
|
|
&dc );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_DISPLAYDOC_CMP:
|
2008-03-10 11:42:41 +00:00
|
|
|
|
2008-02-26 01:07:38 +00:00
|
|
|
// Ensure the struct is a component (could be a piece of a
|
|
|
|
// component, like Field, text..)
|
2008-04-17 16:25:29 +00:00
|
|
|
if( screen->GetCurItem()->Type() != TYPE_SCH_COMPONENT )
|
|
|
|
screen->SetCurItem( LocateSmallestComponent( screen ) );
|
|
|
|
if( screen->GetCurItem() == NULL )
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
{
|
|
|
|
EDA_LibComponentStruct* LibEntry;
|
2008-02-26 01:07:38 +00:00
|
|
|
LibEntry = FindLibPart(
|
2008-05-15 11:20:19 +00:00
|
|
|
( (SCH_COMPONENT*) screen->GetCurItem() )->m_ChipName.GetData(),
|
2008-02-26 01:07:38 +00:00
|
|
|
wxEmptyString,
|
|
|
|
FIND_ALIAS );
|
2007-08-20 01:20:48 +00:00
|
|
|
if( LibEntry && LibEntry->m_DocFile != wxEmptyString )
|
2008-02-26 01:07:38 +00:00
|
|
|
GetAssociatedDocument( this,
|
|
|
|
g_RealLibDirBuffer,
|
|
|
|
LibEntry->m_DocFile );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_ENTER_SHEET:
|
|
|
|
{
|
2008-04-17 16:25:29 +00:00
|
|
|
EDA_BaseStruct* DrawStruct = screen->GetCurItem();
|
2007-09-01 12:00:30 +00:00
|
|
|
if( DrawStruct && (DrawStruct->Type() == DRAW_SHEET_STRUCT_TYPE) )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
|
|
|
InstallNextScreen( (DrawSheetStruct*) DrawStruct );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_LEAVE_SHEET:
|
2008-02-12 21:12:46 +00:00
|
|
|
InstallPreviousSheet();
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_CLOSE_CURRENT_TOOL:
|
|
|
|
SetToolID( 0, wxCURSOR_ARROW, wxEmptyString );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case wxID_COPY: // really this is a Save block for paste
|
|
|
|
HandleBlockEndByPopUp( BLOCK_SAVE, &dc );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_PLACE_BLOCK:
|
|
|
|
DrawPanel->m_AutoPAN_Request = FALSE;
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
|
|
|
HandleBlockPlace( &dc );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_ZOOM_BLOCK:
|
|
|
|
HandleBlockEndByPopUp( BLOCK_ZOOM, &dc );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_DELETE_BLOCK:
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
|
|
|
HandleBlockEndByPopUp( BLOCK_DELETE, &dc );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_ROTATE_BLOCK:
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
|
|
|
HandleBlockEndByPopUp( BLOCK_ROTATE, &dc );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_MIRROR_X_BLOCK:
|
|
|
|
case ID_POPUP_MIRROR_Y_BLOCK:
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
|
|
|
HandleBlockEndByPopUp( BLOCK_MIRROR_Y, &dc );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_COPY_BLOCK:
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
|
|
|
HandleBlockEndByPopUp( BLOCK_COPY, &dc );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_DRAG_BLOCK:
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
|
|
|
HandleBlockEndByPopUp( BLOCK_DRAG, &dc );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_ADD_JUNCTION:
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
2008-04-17 16:25:29 +00:00
|
|
|
screen->SetCurItem(
|
|
|
|
CreateNewJunctionStruct( &dc, screen->m_Curseur, TRUE ) );
|
|
|
|
TestDanglingEnds( screen->EEDrawList, &dc );
|
|
|
|
screen->SetCurItem( NULL );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_POPUP_SCH_ADD_LABEL:
|
|
|
|
case ID_POPUP_SCH_ADD_GLABEL:
|
2008-04-17 16:25:29 +00:00
|
|
|
screen->SetCurItem(
|
2008-02-26 01:07:38 +00:00
|
|
|
CreateNewText( &dc,
|
|
|
|
id == ID_POPUP_SCH_ADD_LABEL ?
|
|
|
|
LAYER_LOCLABEL : LAYER_GLOBLABEL ) );
|
2008-04-17 16:25:29 +00:00
|
|
|
if( screen->GetCurItem() )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
2008-04-17 16:25:29 +00:00
|
|
|
((SCH_ITEM*)screen->GetCurItem())->Place( this, &dc );
|
|
|
|
TestDanglingEnds( screen->EEDrawList, &dc );
|
|
|
|
screen->SetCurItem( NULL );
|
2007-08-20 01:20:48 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_SCHEMATIC_UNDO:
|
2008-04-02 07:08:09 +00:00
|
|
|
if( GetSchematicFromUndoList() )
|
|
|
|
{
|
2008-04-17 16:25:29 +00:00
|
|
|
TestDanglingEnds( screen->EEDrawList, NULL );
|
2008-02-26 01:07:38 +00:00
|
|
|
DrawPanel->Refresh( TRUE );
|
2008-04-01 19:45:30 +00:00
|
|
|
}
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case ID_SCHEMATIC_REDO:
|
2008-04-02 07:08:09 +00:00
|
|
|
if( GetSchematicFromRedoList() )
|
|
|
|
{
|
2008-04-17 16:25:29 +00:00
|
|
|
TestDanglingEnds( screen->EEDrawList, NULL );
|
2008-02-26 01:07:38 +00:00
|
|
|
DrawPanel->Refresh( TRUE );
|
2008-04-01 19:45:30 +00:00
|
|
|
}
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default: // Log error:
|
2008-02-26 01:07:38 +00:00
|
|
|
DisplayError( this,
|
2008-03-10 11:42:41 +00:00
|
|
|
wxT( "WinEDA_SchematicFrame::Process_Special_Functions error" ) );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2008-02-26 01:07:38 +00:00
|
|
|
// End switch ( id ) (Command execution)
|
2007-08-20 01:20:48 +00:00
|
|
|
|
|
|
|
if( m_ID_current_state == 0 )
|
|
|
|
g_ItemToRepeat = NULL;
|
|
|
|
SetToolbars();
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-04-14 19:22:48 +00:00
|
|
|
/*************************************************************************************/
|
|
|
|
void WinEDA_SchematicFrame::Process_Move_Item( SCH_ITEM* DrawStruct, wxDC* DC )
|
|
|
|
/*************************************************************************************/
|
2007-05-06 16:03:28 +00:00
|
|
|
{
|
2007-08-20 01:20:48 +00:00
|
|
|
if( DrawStruct == NULL )
|
|
|
|
return;
|
|
|
|
|
|
|
|
DrawPanel->MouseToCursorSchema();
|
|
|
|
|
2007-09-01 12:00:30 +00:00
|
|
|
switch( DrawStruct->Type() )
|
2007-08-20 01:20:48 +00:00
|
|
|
{
|
|
|
|
case DRAW_JUNCTION_STRUCT_TYPE:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case DRAW_BUSENTRY_STRUCT_TYPE:
|
|
|
|
StartMoveBusEntry( (DrawBusEntryStruct*) DrawStruct, DC );
|
|
|
|
break;
|
|
|
|
|
2008-03-20 01:50:21 +00:00
|
|
|
case TYPE_SCH_LABEL:
|
|
|
|
case TYPE_SCH_GLOBALLABEL:
|
|
|
|
case TYPE_SCH_HIERLABEL:
|
|
|
|
case TYPE_SCH_TEXT:
|
|
|
|
StartMoveTexte( (SCH_TEXT*) DrawStruct, DC );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
2008-03-20 01:50:21 +00:00
|
|
|
case TYPE_SCH_COMPONENT:
|
|
|
|
StartMovePart( (SCH_COMPONENT*) DrawStruct, DC );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DRAW_SEGMENT_STRUCT_TYPE:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case DRAW_SHEET_STRUCT_TYPE:
|
|
|
|
StartMoveSheet( (DrawSheetStruct*) DrawStruct, DC );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case DRAW_NOCONNECT_STRUCT_TYPE:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case DRAW_PART_TEXT_STRUCT_TYPE:
|
2008-09-17 17:26:25 +00:00
|
|
|
StartMoveCmpField( (SCH_CMP_FIELD*) DrawStruct, DC );
|
2007-08-20 01:20:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case DRAW_MARKER_STRUCT_TYPE:
|
2008-04-15 19:38:19 +00:00
|
|
|
case DRAW_HIERARCHICAL_PIN_SHEET_STRUCT_TYPE:
|
2007-08-20 01:20:48 +00:00
|
|
|
default:
|
|
|
|
wxString msg;
|
|
|
|
msg.Printf(
|
|
|
|
wxT( "WinEDA_SchematicFrame::Move_Item Error: Bad DrawType %d" ),
|
2007-09-01 12:00:30 +00:00
|
|
|
DrawStruct->Type() );
|
2007-08-20 01:20:48 +00:00
|
|
|
DisplayError( this, msg );
|
|
|
|
break;
|
|
|
|
}
|
2007-05-06 16:03:28 +00:00
|
|
|
}
|