Loading common/drawframe.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -462,9 +462,9 @@ void WinEDA_DrawFrame::HandleBlockPlace( wxDC* DC ) } int WinEDA_DrawFrame::HandleBlockEnd( wxDC* DC ) bool WinEDA_DrawFrame::HandleBlockEnd( wxDC* DC ) { return 0; return false; } Loading eeschema/block.cpp +36 −34 Original line number Diff line number Diff line Loading @@ -101,19 +101,19 @@ void WinEDA_SchematicFrame::InitBlockPasteInfos() */ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC ) { bool err = FALSE; bool err = false; BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate; if( DrawPanel->ManageCurseur == NULL ) { err = TRUE; err = true; DisplayError( this, wxT( "HandleBlockPLace() : ManageCurseur = NULL" ) ); } if( block->GetCount() == 0 ) { wxString msg; err = TRUE; err = true; msg.Printf( wxT( "HandleBlockPLace() error : no items to place (cmd %d, state %d)" ), block->m_Command, block->m_State ); DisplayError( this, msg ); Loading @@ -124,7 +124,7 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC ) switch( block->m_Command ) { case BLOCK_IDLE: err = TRUE; err = true; break; case BLOCK_ROTATE: Loading @@ -133,7 +133,7 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC ) case BLOCK_DRAG: /* Drag */ case BLOCK_MOVE: /* Move */ if( DrawPanel->ManageCurseur ) DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); SaveCopyInUndoList( block->m_ItemsSelection, UR_MOVED, block->m_MoveVector ); MoveItemsInList( block->m_ItemsSelection, block->m_MoveVector ); Loading @@ -143,7 +143,7 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC ) case BLOCK_COPY: /* Copy */ case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ if( DrawPanel->ManageCurseur ) DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); DuplicateItemsInList( GetScreen(), block->m_ItemsSelection, block->m_MoveVector ); Loading @@ -155,7 +155,7 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC ) case BLOCK_PASTE: if( DrawPanel->ManageCurseur ) DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); PasteListOfItems( DC ); block->ClearItemsList(); break; Loading Loading @@ -194,16 +194,20 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC ) } /* Manage end block command * Returns: * 0 if no features selected * 1 otherwise * -1 If control ended and components selection (block delete, block save) /** * Function HandleBlockEnd( ) * Handle the "end" of a block command, * i.e. is called at the end of the definition of the area of a block. * depending on the current block command, this command is executed * or parameters are initialized to prepare a call to HandleBlockPlace * in GetScreen()->m_BlockLocate * @return false if no item selected, or command finished, * true if some items found and HandleBlockPlace must be called later */ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC ) bool WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC ) { int ii = 0; bool zoom_command = FALSE; bool nextcmd = false; bool zoom_command = false; BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate; if( block->GetCount() ) Loading Loading @@ -241,16 +245,16 @@ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC ) case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ if( block->GetCount() ) { ii = 1; nextcmd = true; CollectStructsToDrag( GetScreen() ); DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); DrawPanel->ManageCurseur = DrawMovingBlockOutlines; DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); block->m_State = STATE_BLOCK_MOVE; } else { DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); DrawPanel->ManageCurseur = NULL; DrawPanel->ForceCloseManageCurseur = NULL; } Loading @@ -258,10 +262,9 @@ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC ) case BLOCK_DELETE: /* Delete */ PickItemsInBlock( GetScreen()->m_BlockLocate, GetScreen() ); DrawAndSizingBlockOutlines( DrawPanel, DC, FALSE ); DrawAndSizingBlockOutlines( DrawPanel, DC, false ); if( block->GetCount() ) { ii = -1; DeleteItemsInList( DrawPanel, block->m_ItemsSelection ); OnModify(); } Loading @@ -272,13 +275,12 @@ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC ) case BLOCK_SAVE: /* Save */ PickItemsInBlock( GetScreen()->m_BlockLocate, GetScreen() ); DrawAndSizingBlockOutlines( DrawPanel, DC, FALSE ); DrawAndSizingBlockOutlines( DrawPanel, DC, false ); if( block->GetCount() ) { wxPoint move_vector = -GetScreen()->m_BlockLocate.m_BlockLastCursorPosition; SaveStructListForPaste( block->m_ItemsSelection ); MoveItemsInList( g_BlockSaveDataList.m_ItemsSelection, move_vector ); ii = -1; } block->ClearItemsList(); break; Loading @@ -292,7 +294,7 @@ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC ) case BLOCK_ZOOM: /* Window Zoom */ zoom_command = TRUE; zoom_command = true; break; case BLOCK_SELECT_ITEMS_ONLY: /* Not used */ Loading @@ -305,7 +307,7 @@ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC ) GetScreen()->ClearDrawingState(); } if( ii <= 0 ) if( ! nextcmd ) { block->m_Flags = 0; block->m_State = STATE_NO_BLOCK; Loading @@ -319,7 +321,7 @@ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC ) if( zoom_command ) Window_Zoom( GetScreen()->m_BlockLocate ); return ii; return nextcmd ; } Loading Loading @@ -359,7 +361,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC ) case BLOCK_DRAG: /* move to Drag */ if( DrawPanel->ManageCurseur ) DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); // Clear list of items to move, and rebuild it with items to drag: block->ClearItemsList(); Loading @@ -371,14 +373,14 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC ) blockCmdFinished = false; CollectStructsToDrag( (SCH_SCREEN*) GetScreen() ); if( DrawPanel->ManageCurseur ) DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); block->m_State = STATE_BLOCK_MOVE; } break; case BLOCK_DELETE: /* move to Delete */ if( DrawPanel->ManageCurseur ) DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); if( block->GetCount() ) { DeleteItemsInList( DrawPanel, block->m_ItemsSelection ); Loading @@ -390,7 +392,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC ) case BLOCK_SAVE: /* Save list in paste buffer*/ if( DrawPanel->ManageCurseur ) DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); if( block->GetCount() ) { wxPoint move_vector = -GetScreen()->m_BlockLocate.m_BlockLastCursorPosition; Loading @@ -408,7 +410,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC ) case BLOCK_ROTATE: if( DrawPanel->ManageCurseur ) DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); if( block->GetCount() ) { // blockCmdFinished = true; Loading @@ -427,7 +429,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC ) case BLOCK_MIRROR_X: if( DrawPanel->ManageCurseur ) DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); if( block->GetCount() ) { // blockCmdFinished = true; Loading @@ -446,7 +448,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC ) case BLOCK_MIRROR_Y: if( DrawPanel->ManageCurseur ) DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); if( block->GetCount() ) { // blockCmdFinished = true; Loading eeschema/block_libedit.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -69,10 +69,10 @@ int WinEDA_LibeditFrame::ReturnBlockCommand( int key ) * 1 if HandleBlockPlace must follow (items found, and a block place * command must follow) */ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) bool WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) { int ItemCount = 0; int MustDoPlace = 0; int nextCmd = false; wxPoint pt; if( GetScreen()->m_BlockLocate.GetCount() ) Loading Loading @@ -104,7 +104,7 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) g_EditPinByPinIsOn ); if( ItemCount ) { MustDoPlace = 1; nextCmd = true; if( DrawPanel->ManageCurseur != NULL ) { DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); Loading @@ -117,7 +117,7 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) break; case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ MustDoPlace = 1; nextCmd = true; DrawPanel->ManageCurseur = DrawMovingBlockOutlines; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE; break; Loading Loading @@ -165,7 +165,7 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) break; } if( MustDoPlace <= 0 ) if( ! nextCmd ) { if( GetScreen()->m_BlockLocate.m_Command != BLOCK_SELECT_ITEMS_ONLY ) if ( m_component ) Loading @@ -182,7 +182,7 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) } return MustDoPlace; return nextCmd; } Loading eeschema/libeditframe.h +78 −76 Original line number Diff line number Diff line Loading @@ -122,6 +122,7 @@ public: Close( false ); } /** * Function OnModify * Must be called after a schematic change Loading @@ -132,6 +133,7 @@ public: GetScreen()->SetModify(); } LIB_COMPONENT* GetComponent( void ) { return m_component; } CMP_LIBRARY* GetLibrary( void ) { return m_library; } Loading Loading @@ -252,9 +254,9 @@ private: public: /* Block commands: */ int ReturnBlockCommand( int key ); void HandleBlockPlace( wxDC* DC ); int HandleBlockEnd( wxDC* DC ); virtual int ReturnBlockCommand( int key ); virtual void HandleBlockPlace( wxDC* DC ); virtual bool HandleBlockEnd( wxDC* DC ); void PlacePin( wxDC* DC ); void GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id ); Loading gerbview/block.cpp +25 −21 Original line number Diff line number Diff line Loading @@ -88,11 +88,11 @@ int WinEDA_GerberFrame::ReturnBlockCommand( int key ) /* Routine to handle the BLOCK PLACE command */ void WinEDA_GerberFrame::HandleBlockPlace( wxDC* DC ) { bool err = FALSE; bool err = false; if( DrawPanel->ManageCurseur == NULL ) { err = TRUE; err = true; DisplayError( this, wxT( "Error in HandleBlockPLace : ManageCurseur = NULL" ) ); } Loading @@ -101,21 +101,21 @@ void WinEDA_GerberFrame::HandleBlockPlace( wxDC* DC ) switch( GetScreen()->m_BlockLocate.m_Command ) { case BLOCK_IDLE: err = TRUE; err = true; break; case BLOCK_DRAG: /* Drag */ case BLOCK_MOVE: /* Move */ case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ if( DrawPanel->ManageCurseur ) DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); Block_Move( DC ); GetScreen()->m_BlockLocate.ClearItemsList(); break; case BLOCK_COPY: /* Copy */ if( DrawPanel->ManageCurseur ) DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); Block_Duplicate( DC ); GetScreen()->m_BlockLocate.ClearItemsList(); break; Loading Loading @@ -152,16 +152,20 @@ void WinEDA_GerberFrame::HandleBlockPlace( wxDC* DC ) } /* Routine management command END BLOCK * Returns: * 0 if no and selects compounds * 1 otherwise * -1 If order is completed and components found (block delete, block save) /** * Function HandleBlockEnd( ) * Handle the "end" of a block command, * i.e. is called at the end of the definition of the area of a block. * depending on the current block command, this command is executed * or parameters are initialized to prepare a call to HandleBlockPlace * in GetScreen()->m_BlockLocate * @return false if no item selected, or command finished, * true if some items found and HandleBlockPlace must be called later */ int WinEDA_GerberFrame::HandleBlockEnd( wxDC* DC ) bool WinEDA_GerberFrame::HandleBlockEnd( wxDC* DC ) { int endcommande = TRUE; bool zoom_command = FALSE; bool nextcmd = false; bool zoom_command = false; if( DrawPanel->ManageCurseur ) Loading @@ -177,15 +181,15 @@ int WinEDA_GerberFrame::HandleBlockEnd( wxDC* DC ) case BLOCK_COPY: /* Copy */ case BLOCK_PRESELECT_MOVE: /* Move with preselection list */ GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE; endcommande = FALSE; DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); nextcmd = true; DrawPanel->ManageCurseur( DrawPanel, DC, false ); DrawPanel->ManageCurseur = DrawMovingBlockOutlines; DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); break; case BLOCK_DELETE: /* Delete */ GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP; DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); Block_Delete( DC ); break; Loading @@ -197,7 +201,7 @@ int WinEDA_GerberFrame::HandleBlockEnd( wxDC* DC ) break; case BLOCK_ZOOM: /* Window Zoom */ zoom_command = TRUE; zoom_command = true; break; case BLOCK_ABORT: Loading @@ -206,7 +210,7 @@ int WinEDA_GerberFrame::HandleBlockEnd( wxDC* DC ) break; } if( endcommande == TRUE ) if( ! nextcmd ) { GetScreen()->m_BlockLocate.m_Flags = 0; GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK; Loading @@ -220,7 +224,7 @@ int WinEDA_GerberFrame::HandleBlockEnd( wxDC* DC ) if( zoom_command ) Window_Zoom( GetScreen()->m_BlockLocate ); return endcommande; return nextcmd ; } Loading Loading @@ -325,7 +329,7 @@ void WinEDA_GerberFrame::Block_Move( wxDC* DC ) gerb_item->MoveAB( delta ); } DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( true ); } Loading Loading
common/drawframe.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -462,9 +462,9 @@ void WinEDA_DrawFrame::HandleBlockPlace( wxDC* DC ) } int WinEDA_DrawFrame::HandleBlockEnd( wxDC* DC ) bool WinEDA_DrawFrame::HandleBlockEnd( wxDC* DC ) { return 0; return false; } Loading
eeschema/block.cpp +36 −34 Original line number Diff line number Diff line Loading @@ -101,19 +101,19 @@ void WinEDA_SchematicFrame::InitBlockPasteInfos() */ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC ) { bool err = FALSE; bool err = false; BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate; if( DrawPanel->ManageCurseur == NULL ) { err = TRUE; err = true; DisplayError( this, wxT( "HandleBlockPLace() : ManageCurseur = NULL" ) ); } if( block->GetCount() == 0 ) { wxString msg; err = TRUE; err = true; msg.Printf( wxT( "HandleBlockPLace() error : no items to place (cmd %d, state %d)" ), block->m_Command, block->m_State ); DisplayError( this, msg ); Loading @@ -124,7 +124,7 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC ) switch( block->m_Command ) { case BLOCK_IDLE: err = TRUE; err = true; break; case BLOCK_ROTATE: Loading @@ -133,7 +133,7 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC ) case BLOCK_DRAG: /* Drag */ case BLOCK_MOVE: /* Move */ if( DrawPanel->ManageCurseur ) DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); SaveCopyInUndoList( block->m_ItemsSelection, UR_MOVED, block->m_MoveVector ); MoveItemsInList( block->m_ItemsSelection, block->m_MoveVector ); Loading @@ -143,7 +143,7 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC ) case BLOCK_COPY: /* Copy */ case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ if( DrawPanel->ManageCurseur ) DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); DuplicateItemsInList( GetScreen(), block->m_ItemsSelection, block->m_MoveVector ); Loading @@ -155,7 +155,7 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC ) case BLOCK_PASTE: if( DrawPanel->ManageCurseur ) DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); PasteListOfItems( DC ); block->ClearItemsList(); break; Loading Loading @@ -194,16 +194,20 @@ void WinEDA_SchematicFrame::HandleBlockPlace( wxDC* DC ) } /* Manage end block command * Returns: * 0 if no features selected * 1 otherwise * -1 If control ended and components selection (block delete, block save) /** * Function HandleBlockEnd( ) * Handle the "end" of a block command, * i.e. is called at the end of the definition of the area of a block. * depending on the current block command, this command is executed * or parameters are initialized to prepare a call to HandleBlockPlace * in GetScreen()->m_BlockLocate * @return false if no item selected, or command finished, * true if some items found and HandleBlockPlace must be called later */ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC ) bool WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC ) { int ii = 0; bool zoom_command = FALSE; bool nextcmd = false; bool zoom_command = false; BLOCK_SELECTOR* block = &GetScreen()->m_BlockLocate; if( block->GetCount() ) Loading Loading @@ -241,16 +245,16 @@ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC ) case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ if( block->GetCount() ) { ii = 1; nextcmd = true; CollectStructsToDrag( GetScreen() ); DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); DrawPanel->ManageCurseur = DrawMovingBlockOutlines; DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); block->m_State = STATE_BLOCK_MOVE; } else { DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); DrawPanel->ManageCurseur = NULL; DrawPanel->ForceCloseManageCurseur = NULL; } Loading @@ -258,10 +262,9 @@ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC ) case BLOCK_DELETE: /* Delete */ PickItemsInBlock( GetScreen()->m_BlockLocate, GetScreen() ); DrawAndSizingBlockOutlines( DrawPanel, DC, FALSE ); DrawAndSizingBlockOutlines( DrawPanel, DC, false ); if( block->GetCount() ) { ii = -1; DeleteItemsInList( DrawPanel, block->m_ItemsSelection ); OnModify(); } Loading @@ -272,13 +275,12 @@ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC ) case BLOCK_SAVE: /* Save */ PickItemsInBlock( GetScreen()->m_BlockLocate, GetScreen() ); DrawAndSizingBlockOutlines( DrawPanel, DC, FALSE ); DrawAndSizingBlockOutlines( DrawPanel, DC, false ); if( block->GetCount() ) { wxPoint move_vector = -GetScreen()->m_BlockLocate.m_BlockLastCursorPosition; SaveStructListForPaste( block->m_ItemsSelection ); MoveItemsInList( g_BlockSaveDataList.m_ItemsSelection, move_vector ); ii = -1; } block->ClearItemsList(); break; Loading @@ -292,7 +294,7 @@ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC ) case BLOCK_ZOOM: /* Window Zoom */ zoom_command = TRUE; zoom_command = true; break; case BLOCK_SELECT_ITEMS_ONLY: /* Not used */ Loading @@ -305,7 +307,7 @@ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC ) GetScreen()->ClearDrawingState(); } if( ii <= 0 ) if( ! nextcmd ) { block->m_Flags = 0; block->m_State = STATE_NO_BLOCK; Loading @@ -319,7 +321,7 @@ int WinEDA_SchematicFrame::HandleBlockEnd( wxDC* DC ) if( zoom_command ) Window_Zoom( GetScreen()->m_BlockLocate ); return ii; return nextcmd ; } Loading Loading @@ -359,7 +361,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC ) case BLOCK_DRAG: /* move to Drag */ if( DrawPanel->ManageCurseur ) DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); // Clear list of items to move, and rebuild it with items to drag: block->ClearItemsList(); Loading @@ -371,14 +373,14 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC ) blockCmdFinished = false; CollectStructsToDrag( (SCH_SCREEN*) GetScreen() ); if( DrawPanel->ManageCurseur ) DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); block->m_State = STATE_BLOCK_MOVE; } break; case BLOCK_DELETE: /* move to Delete */ if( DrawPanel->ManageCurseur ) DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); if( block->GetCount() ) { DeleteItemsInList( DrawPanel, block->m_ItemsSelection ); Loading @@ -390,7 +392,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC ) case BLOCK_SAVE: /* Save list in paste buffer*/ if( DrawPanel->ManageCurseur ) DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); if( block->GetCount() ) { wxPoint move_vector = -GetScreen()->m_BlockLocate.m_BlockLastCursorPosition; Loading @@ -408,7 +410,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC ) case BLOCK_ROTATE: if( DrawPanel->ManageCurseur ) DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); if( block->GetCount() ) { // blockCmdFinished = true; Loading @@ -427,7 +429,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC ) case BLOCK_MIRROR_X: if( DrawPanel->ManageCurseur ) DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); if( block->GetCount() ) { // blockCmdFinished = true; Loading @@ -446,7 +448,7 @@ void WinEDA_SchematicFrame::HandleBlockEndByPopUp( int Command, wxDC* DC ) case BLOCK_MIRROR_Y: if( DrawPanel->ManageCurseur ) DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); if( block->GetCount() ) { // blockCmdFinished = true; Loading
eeschema/block_libedit.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -69,10 +69,10 @@ int WinEDA_LibeditFrame::ReturnBlockCommand( int key ) * 1 if HandleBlockPlace must follow (items found, and a block place * command must follow) */ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) bool WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) { int ItemCount = 0; int MustDoPlace = 0; int nextCmd = false; wxPoint pt; if( GetScreen()->m_BlockLocate.GetCount() ) Loading Loading @@ -104,7 +104,7 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) g_EditPinByPinIsOn ); if( ItemCount ) { MustDoPlace = 1; nextCmd = true; if( DrawPanel->ManageCurseur != NULL ) { DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); Loading @@ -117,7 +117,7 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) break; case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ MustDoPlace = 1; nextCmd = true; DrawPanel->ManageCurseur = DrawMovingBlockOutlines; GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE; break; Loading Loading @@ -165,7 +165,7 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) break; } if( MustDoPlace <= 0 ) if( ! nextCmd ) { if( GetScreen()->m_BlockLocate.m_Command != BLOCK_SELECT_ITEMS_ONLY ) if ( m_component ) Loading @@ -182,7 +182,7 @@ int WinEDA_LibeditFrame::HandleBlockEnd( wxDC* DC ) } return MustDoPlace; return nextCmd; } Loading
eeschema/libeditframe.h +78 −76 Original line number Diff line number Diff line Loading @@ -122,6 +122,7 @@ public: Close( false ); } /** * Function OnModify * Must be called after a schematic change Loading @@ -132,6 +133,7 @@ public: GetScreen()->SetModify(); } LIB_COMPONENT* GetComponent( void ) { return m_component; } CMP_LIBRARY* GetLibrary( void ) { return m_library; } Loading Loading @@ -252,9 +254,9 @@ private: public: /* Block commands: */ int ReturnBlockCommand( int key ); void HandleBlockPlace( wxDC* DC ); int HandleBlockEnd( wxDC* DC ); virtual int ReturnBlockCommand( int key ); virtual void HandleBlockPlace( wxDC* DC ); virtual bool HandleBlockEnd( wxDC* DC ); void PlacePin( wxDC* DC ); void GlobalSetPins( wxDC* DC, LIB_PIN* MasterPin, int id ); Loading
gerbview/block.cpp +25 −21 Original line number Diff line number Diff line Loading @@ -88,11 +88,11 @@ int WinEDA_GerberFrame::ReturnBlockCommand( int key ) /* Routine to handle the BLOCK PLACE command */ void WinEDA_GerberFrame::HandleBlockPlace( wxDC* DC ) { bool err = FALSE; bool err = false; if( DrawPanel->ManageCurseur == NULL ) { err = TRUE; err = true; DisplayError( this, wxT( "Error in HandleBlockPLace : ManageCurseur = NULL" ) ); } Loading @@ -101,21 +101,21 @@ void WinEDA_GerberFrame::HandleBlockPlace( wxDC* DC ) switch( GetScreen()->m_BlockLocate.m_Command ) { case BLOCK_IDLE: err = TRUE; err = true; break; case BLOCK_DRAG: /* Drag */ case BLOCK_MOVE: /* Move */ case BLOCK_PRESELECT_MOVE: /* Move with preselection list*/ if( DrawPanel->ManageCurseur ) DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); Block_Move( DC ); GetScreen()->m_BlockLocate.ClearItemsList(); break; case BLOCK_COPY: /* Copy */ if( DrawPanel->ManageCurseur ) DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); Block_Duplicate( DC ); GetScreen()->m_BlockLocate.ClearItemsList(); break; Loading Loading @@ -152,16 +152,20 @@ void WinEDA_GerberFrame::HandleBlockPlace( wxDC* DC ) } /* Routine management command END BLOCK * Returns: * 0 if no and selects compounds * 1 otherwise * -1 If order is completed and components found (block delete, block save) /** * Function HandleBlockEnd( ) * Handle the "end" of a block command, * i.e. is called at the end of the definition of the area of a block. * depending on the current block command, this command is executed * or parameters are initialized to prepare a call to HandleBlockPlace * in GetScreen()->m_BlockLocate * @return false if no item selected, or command finished, * true if some items found and HandleBlockPlace must be called later */ int WinEDA_GerberFrame::HandleBlockEnd( wxDC* DC ) bool WinEDA_GerberFrame::HandleBlockEnd( wxDC* DC ) { int endcommande = TRUE; bool zoom_command = FALSE; bool nextcmd = false; bool zoom_command = false; if( DrawPanel->ManageCurseur ) Loading @@ -177,15 +181,15 @@ int WinEDA_GerberFrame::HandleBlockEnd( wxDC* DC ) case BLOCK_COPY: /* Copy */ case BLOCK_PRESELECT_MOVE: /* Move with preselection list */ GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_MOVE; endcommande = FALSE; DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); nextcmd = true; DrawPanel->ManageCurseur( DrawPanel, DC, false ); DrawPanel->ManageCurseur = DrawMovingBlockOutlines; DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); break; case BLOCK_DELETE: /* Delete */ GetScreen()->m_BlockLocate.m_State = STATE_BLOCK_STOP; DrawPanel->ManageCurseur( DrawPanel, DC, FALSE ); DrawPanel->ManageCurseur( DrawPanel, DC, false ); Block_Delete( DC ); break; Loading @@ -197,7 +201,7 @@ int WinEDA_GerberFrame::HandleBlockEnd( wxDC* DC ) break; case BLOCK_ZOOM: /* Window Zoom */ zoom_command = TRUE; zoom_command = true; break; case BLOCK_ABORT: Loading @@ -206,7 +210,7 @@ int WinEDA_GerberFrame::HandleBlockEnd( wxDC* DC ) break; } if( endcommande == TRUE ) if( ! nextcmd ) { GetScreen()->m_BlockLocate.m_Flags = 0; GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK; Loading @@ -220,7 +224,7 @@ int WinEDA_GerberFrame::HandleBlockEnd( wxDC* DC ) if( zoom_command ) Window_Zoom( GetScreen()->m_BlockLocate ); return endcommande; return nextcmd ; } Loading Loading @@ -325,7 +329,7 @@ void WinEDA_GerberFrame::Block_Move( wxDC* DC ) gerb_item->MoveAB( delta ); } DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( true ); } Loading