Loading pcbnew/automove.cpp +5 −3 Original line number Original line Diff line number Diff line Loading @@ -57,6 +57,10 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event ) switch( id ) // Arret eventuel de la commande de dplacement en cours switch( id ) // Arret eventuel de la commande de dplacement en cours { { case ID_TOOLBARH_PCB_AUTOPLACE: case ID_TOOLBARH_PCB_AUTOROUTE: break; case ID_POPUP_CANCEL_CURRENT_COMMAND: case ID_POPUP_CANCEL_CURRENT_COMMAND: if( DrawPanel->ManageCurseur if( DrawPanel->ManageCurseur && DrawPanel->ForceCloseManageCurseur ) && DrawPanel->ForceCloseManageCurseur ) Loading @@ -71,9 +75,7 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event ) { { DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc ); DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc ); } } m_ID_current_state = 0; SetToolID( 0, wxCURSOR_ARROW, wxEmptyString ); DisplayToolMsg( wxEmptyString ); DrawPanel->SetCursor( wxCursor( wxCURSOR_ARROW ) ); break; break; } } Loading pcbnew/edit.cpp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -55,6 +55,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) case ID_ON_ZOOM_SELECT: case ID_ON_ZOOM_SELECT: case ID_PCB_USER_GRID_SETUP: case ID_PCB_USER_GRID_SETUP: case ID_TOOLBARH_PCB_SELECT_LAYER: case ID_TOOLBARH_PCB_SELECT_LAYER: case ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR: case ID_POPUP_PCB_ROTATE_TEXTEPCB: case ID_POPUP_PCB_ROTATE_TEXTEPCB: case ID_POPUP_PCB_EDIT_TEXTEPCB: case ID_POPUP_PCB_EDIT_TEXTEPCB: case ID_POPUP_PCB_EDIT_MIRE: case ID_POPUP_PCB_EDIT_MIRE: Loading pcbnew/onleftclick.cpp +65 −38 Original line number Original line Diff line number Diff line Loading @@ -14,7 +14,6 @@ #include "pcbnew_id.h" #include "pcbnew_id.h" /********************************************************************/ /********************************************************************/ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) /********************************************************************/ /********************************************************************/ Loading @@ -30,7 +29,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) DrawPanel->m_AutoPAN_Request = false; DrawPanel->m_AutoPAN_Request = false; if( DrawStruct && DrawStruct->m_Flags ) // "POPUP" in progress if( DrawStruct && DrawStruct->m_Flags ) // "POPUP" in progress { { DrawPanel->m_IgnoreMouseEvents = TRUE; DrawPanel->m_IgnoreMouseEvents = true; DrawPanel->CursorOff( DC ); DrawPanel->CursorOff( DC ); switch( DrawStruct->Type() ) switch( DrawStruct->Type() ) Loading Loading @@ -92,7 +91,9 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) if( m_ID_current_state == 0 ) if( m_ID_current_state == 0 ) { { DisplayError( this, DisplayError( this, wxT( "WinEDA_PcbFrame::OnLeftClick() err: DrawType %d m_Flags != 0" ), DrawStruct->Type() ); wxT( "WinEDA_PcbFrame::OnLeftClick() err: DrawType %d m_Flags != 0" ), DrawStruct->Type() ); exit = true; exit = true; } } break; break; Loading @@ -100,11 +101,11 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) DrawPanel->m_IgnoreMouseEvents = false; DrawPanel->m_IgnoreMouseEvents = false; DrawPanel->CursorOn( DC ); DrawPanel->CursorOn( DC ); if ( exit ) return; if( exit ) return; } } else if( !wxGetKeyState( WXK_SHIFT ) && !wxGetKeyState( WXK_ALT ) else if( !wxGetKeyState(WXK_SHIFT) && !wxGetKeyState(WXK_ALT) && && !wxGetKeyState( WXK_CONTROL ) ) !wxGetKeyState(WXK_CONTROL) ) { { DrawStruct = PcbGeneralLocateAndDisplay(); DrawStruct = PcbGeneralLocateAndDisplay(); if( DrawStruct ) if( DrawStruct ) Loading Loading @@ -184,7 +185,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) { { DrawStruct = Begin_DrawSegment( NULL, shape, DC ); DrawStruct = Begin_DrawSegment( NULL, shape, DC ); SetCurItem( DrawStruct ); SetCurItem( DrawStruct ); DrawPanel->m_AutoPAN_Request = TRUE; DrawPanel->m_AutoPAN_Request = true; } } else if( DrawStruct else if( DrawStruct && (DrawStruct->Type() == TYPE_DRAWSEGMENT) && (DrawStruct->Type() == TYPE_DRAWSEGMENT) Loading @@ -192,7 +193,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) { { DrawStruct = Begin_DrawSegment( (DRAWSEGMENT*) DrawStruct, shape, DC ); DrawStruct = Begin_DrawSegment( (DRAWSEGMENT*) DrawStruct, shape, DC ); SetCurItem( DrawStruct ); SetCurItem( DrawStruct ); DrawPanel->m_AutoPAN_Request = TRUE; DrawPanel->m_AutoPAN_Request = true; } } break; break; } } Loading @@ -209,22 +210,48 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) DrawStruct = Begin_Route( NULL, DC ); DrawStruct = Begin_Route( NULL, DC ); SetCurItem( DrawStruct ); SetCurItem( DrawStruct ); if( DrawStruct ) if( DrawStruct ) DrawPanel->m_AutoPAN_Request = TRUE; DrawPanel->m_AutoPAN_Request = true; } } else if( DrawStruct && (DrawStruct->m_Flags & IS_NEW) ) else if( DrawStruct && (DrawStruct->m_Flags & IS_NEW) ) { { TRACK* track = Begin_Route( (TRACK*) DrawStruct, DC ); TRACK* track = Begin_Route( (TRACK*) DrawStruct, DC ); if( track ) // c'est a dire si OK if( track ) // c'est a dire si OK SetCurItem( DrawStruct = track ); SetCurItem( DrawStruct = track ); DrawPanel->m_AutoPAN_Request = TRUE; DrawPanel->m_AutoPAN_Request = true; } } break; break; case ID_PCB_ZONES_BUTT: case ID_PCB_ZONES_BUTT: /* ZONE Tool is selected. Determine action for a left click: * this can be start a new zone or select and move an existing zone outline corner * if found near the mouse cursor */ if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) ) if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) ) { { if ( Begin_Zone( DC ) ) // there is no current item, try to find something under mouse DrawStruct = PcbGeneralLocateAndDisplay(); bool hit_on_corner = false; if( DrawStruct && (DrawStruct->Type() == TYPE_ZONE_CONTAINER) ) { // We have a hit under mouse (a zone outline corner or segment) // test for a corner only because want to move corners only. ZONE_CONTAINER* edge_zone = (ZONE_CONTAINER*) DrawStruct; if( edge_zone->HitTestForCorner( GetScreen()->RefPos( true ) ) >= 0 ) // corner located! hit_on_corner = true; } if( hit_on_corner ) { DrawPanel->MouseToCursorSchema(); ZONE_CONTAINER* zone_cont = (ZONE_CONTAINER*) GetCurItem(); DrawPanel->m_AutoPAN_Request = true; Start_Move_Zone_Corner( DC, zone_cont, zone_cont->m_CornerSelection, false ); } else if( Begin_Zone( DC ) ) { { DrawPanel->m_AutoPAN_Request = true; DrawPanel->m_AutoPAN_Request = true; DrawStruct = GetBoard()->m_CurrentZoneContour; DrawStruct = GetBoard()->m_CurrentZoneContour; Loading @@ -234,14 +261,14 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) else if( DrawStruct else if( DrawStruct && (DrawStruct->Type() == TYPE_ZONE_CONTAINER) && (DrawStruct->Type() == TYPE_ZONE_CONTAINER) && (DrawStruct->m_Flags & IS_NEW) ) && (DrawStruct->m_Flags & IS_NEW) ) { { // Add a new corner to the current outline beeing created: DrawPanel->m_AutoPAN_Request = true; DrawPanel->m_AutoPAN_Request = true; Begin_Zone( DC ); Begin_Zone( DC ); DrawStruct = GetBoard()->m_CurrentZoneContour; DrawStruct = GetBoard()->m_CurrentZoneContour; GetScreen()->SetCurItem( DrawStruct ); GetScreen()->SetCurItem( DrawStruct ); } } else else DisplayError( this, wxT( "Edit: zone internal error" ) ); DisplayError( this, wxT( "WinEDA_PcbFrame::OnLeftClick() zone internal error" ) ); break; break; case ID_PCB_ADD_TEXT_BUTT: case ID_PCB_ADD_TEXT_BUTT: Loading @@ -249,7 +276,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) { { SetCurItem( Create_Texte_Pcb( DC ) ); SetCurItem( Create_Texte_Pcb( DC ) ); DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema(); DrawPanel->m_AutoPAN_Request = TRUE; DrawPanel->m_AutoPAN_Request = true; } } else if( DrawStruct->Type() == TYPE_TEXTE ) else if( DrawStruct->Type() == TYPE_TEXTE ) { { Loading Loading @@ -288,7 +315,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) { { DrawStruct = Begin_Cotation( NULL, DC ); DrawStruct = Begin_Cotation( NULL, DC ); SetCurItem( DrawStruct ); SetCurItem( DrawStruct ); DrawPanel->m_AutoPAN_Request = TRUE; DrawPanel->m_AutoPAN_Request = true; } } else if( DrawStruct else if( DrawStruct && (DrawStruct->Type() == TYPE_COTATION) && (DrawStruct->Type() == TYPE_COTATION) Loading @@ -296,7 +323,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) { { DrawStruct = Begin_Cotation( (COTATION*) DrawStruct, DC ); DrawStruct = Begin_Cotation( (COTATION*) DrawStruct, DC ); SetCurItem( DrawStruct ); SetCurItem( DrawStruct ); DrawPanel->m_AutoPAN_Request = TRUE; DrawPanel->m_AutoPAN_Request = true; } } else else DisplayError( this, wxT( "Internal err: Struct not COTATION" ) ); DisplayError( this, wxT( "Internal err: Struct not COTATION" ) ); Loading Loading
pcbnew/automove.cpp +5 −3 Original line number Original line Diff line number Diff line Loading @@ -57,6 +57,10 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event ) switch( id ) // Arret eventuel de la commande de dplacement en cours switch( id ) // Arret eventuel de la commande de dplacement en cours { { case ID_TOOLBARH_PCB_AUTOPLACE: case ID_TOOLBARH_PCB_AUTOROUTE: break; case ID_POPUP_CANCEL_CURRENT_COMMAND: case ID_POPUP_CANCEL_CURRENT_COMMAND: if( DrawPanel->ManageCurseur if( DrawPanel->ManageCurseur && DrawPanel->ForceCloseManageCurseur ) && DrawPanel->ForceCloseManageCurseur ) Loading @@ -71,9 +75,7 @@ void WinEDA_PcbFrame::AutoPlace( wxCommandEvent& event ) { { DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc ); DrawPanel->ForceCloseManageCurseur( DrawPanel, &dc ); } } m_ID_current_state = 0; SetToolID( 0, wxCURSOR_ARROW, wxEmptyString ); DisplayToolMsg( wxEmptyString ); DrawPanel->SetCursor( wxCursor( wxCURSOR_ARROW ) ); break; break; } } Loading
pcbnew/edit.cpp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -55,6 +55,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) case ID_ON_ZOOM_SELECT: case ID_ON_ZOOM_SELECT: case ID_PCB_USER_GRID_SETUP: case ID_PCB_USER_GRID_SETUP: case ID_TOOLBARH_PCB_SELECT_LAYER: case ID_TOOLBARH_PCB_SELECT_LAYER: case ID_AUX_TOOLBAR_PCB_SELECT_LAYER_PAIR: case ID_POPUP_PCB_ROTATE_TEXTEPCB: case ID_POPUP_PCB_ROTATE_TEXTEPCB: case ID_POPUP_PCB_EDIT_TEXTEPCB: case ID_POPUP_PCB_EDIT_TEXTEPCB: case ID_POPUP_PCB_EDIT_MIRE: case ID_POPUP_PCB_EDIT_MIRE: Loading
pcbnew/onleftclick.cpp +65 −38 Original line number Original line Diff line number Diff line Loading @@ -14,7 +14,6 @@ #include "pcbnew_id.h" #include "pcbnew_id.h" /********************************************************************/ /********************************************************************/ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) /********************************************************************/ /********************************************************************/ Loading @@ -30,7 +29,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) DrawPanel->m_AutoPAN_Request = false; DrawPanel->m_AutoPAN_Request = false; if( DrawStruct && DrawStruct->m_Flags ) // "POPUP" in progress if( DrawStruct && DrawStruct->m_Flags ) // "POPUP" in progress { { DrawPanel->m_IgnoreMouseEvents = TRUE; DrawPanel->m_IgnoreMouseEvents = true; DrawPanel->CursorOff( DC ); DrawPanel->CursorOff( DC ); switch( DrawStruct->Type() ) switch( DrawStruct->Type() ) Loading Loading @@ -92,7 +91,9 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) if( m_ID_current_state == 0 ) if( m_ID_current_state == 0 ) { { DisplayError( this, DisplayError( this, wxT( "WinEDA_PcbFrame::OnLeftClick() err: DrawType %d m_Flags != 0" ), DrawStruct->Type() ); wxT( "WinEDA_PcbFrame::OnLeftClick() err: DrawType %d m_Flags != 0" ), DrawStruct->Type() ); exit = true; exit = true; } } break; break; Loading @@ -100,11 +101,11 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) DrawPanel->m_IgnoreMouseEvents = false; DrawPanel->m_IgnoreMouseEvents = false; DrawPanel->CursorOn( DC ); DrawPanel->CursorOn( DC ); if ( exit ) return; if( exit ) return; } } else if( !wxGetKeyState( WXK_SHIFT ) && !wxGetKeyState( WXK_ALT ) else if( !wxGetKeyState(WXK_SHIFT) && !wxGetKeyState(WXK_ALT) && && !wxGetKeyState( WXK_CONTROL ) ) !wxGetKeyState(WXK_CONTROL) ) { { DrawStruct = PcbGeneralLocateAndDisplay(); DrawStruct = PcbGeneralLocateAndDisplay(); if( DrawStruct ) if( DrawStruct ) Loading Loading @@ -184,7 +185,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) { { DrawStruct = Begin_DrawSegment( NULL, shape, DC ); DrawStruct = Begin_DrawSegment( NULL, shape, DC ); SetCurItem( DrawStruct ); SetCurItem( DrawStruct ); DrawPanel->m_AutoPAN_Request = TRUE; DrawPanel->m_AutoPAN_Request = true; } } else if( DrawStruct else if( DrawStruct && (DrawStruct->Type() == TYPE_DRAWSEGMENT) && (DrawStruct->Type() == TYPE_DRAWSEGMENT) Loading @@ -192,7 +193,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) { { DrawStruct = Begin_DrawSegment( (DRAWSEGMENT*) DrawStruct, shape, DC ); DrawStruct = Begin_DrawSegment( (DRAWSEGMENT*) DrawStruct, shape, DC ); SetCurItem( DrawStruct ); SetCurItem( DrawStruct ); DrawPanel->m_AutoPAN_Request = TRUE; DrawPanel->m_AutoPAN_Request = true; } } break; break; } } Loading @@ -209,22 +210,48 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) DrawStruct = Begin_Route( NULL, DC ); DrawStruct = Begin_Route( NULL, DC ); SetCurItem( DrawStruct ); SetCurItem( DrawStruct ); if( DrawStruct ) if( DrawStruct ) DrawPanel->m_AutoPAN_Request = TRUE; DrawPanel->m_AutoPAN_Request = true; } } else if( DrawStruct && (DrawStruct->m_Flags & IS_NEW) ) else if( DrawStruct && (DrawStruct->m_Flags & IS_NEW) ) { { TRACK* track = Begin_Route( (TRACK*) DrawStruct, DC ); TRACK* track = Begin_Route( (TRACK*) DrawStruct, DC ); if( track ) // c'est a dire si OK if( track ) // c'est a dire si OK SetCurItem( DrawStruct = track ); SetCurItem( DrawStruct = track ); DrawPanel->m_AutoPAN_Request = TRUE; DrawPanel->m_AutoPAN_Request = true; } } break; break; case ID_PCB_ZONES_BUTT: case ID_PCB_ZONES_BUTT: /* ZONE Tool is selected. Determine action for a left click: * this can be start a new zone or select and move an existing zone outline corner * if found near the mouse cursor */ if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) ) if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) ) { { if ( Begin_Zone( DC ) ) // there is no current item, try to find something under mouse DrawStruct = PcbGeneralLocateAndDisplay(); bool hit_on_corner = false; if( DrawStruct && (DrawStruct->Type() == TYPE_ZONE_CONTAINER) ) { // We have a hit under mouse (a zone outline corner or segment) // test for a corner only because want to move corners only. ZONE_CONTAINER* edge_zone = (ZONE_CONTAINER*) DrawStruct; if( edge_zone->HitTestForCorner( GetScreen()->RefPos( true ) ) >= 0 ) // corner located! hit_on_corner = true; } if( hit_on_corner ) { DrawPanel->MouseToCursorSchema(); ZONE_CONTAINER* zone_cont = (ZONE_CONTAINER*) GetCurItem(); DrawPanel->m_AutoPAN_Request = true; Start_Move_Zone_Corner( DC, zone_cont, zone_cont->m_CornerSelection, false ); } else if( Begin_Zone( DC ) ) { { DrawPanel->m_AutoPAN_Request = true; DrawPanel->m_AutoPAN_Request = true; DrawStruct = GetBoard()->m_CurrentZoneContour; DrawStruct = GetBoard()->m_CurrentZoneContour; Loading @@ -234,14 +261,14 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) else if( DrawStruct else if( DrawStruct && (DrawStruct->Type() == TYPE_ZONE_CONTAINER) && (DrawStruct->Type() == TYPE_ZONE_CONTAINER) && (DrawStruct->m_Flags & IS_NEW) ) && (DrawStruct->m_Flags & IS_NEW) ) { { // Add a new corner to the current outline beeing created: DrawPanel->m_AutoPAN_Request = true; DrawPanel->m_AutoPAN_Request = true; Begin_Zone( DC ); Begin_Zone( DC ); DrawStruct = GetBoard()->m_CurrentZoneContour; DrawStruct = GetBoard()->m_CurrentZoneContour; GetScreen()->SetCurItem( DrawStruct ); GetScreen()->SetCurItem( DrawStruct ); } } else else DisplayError( this, wxT( "Edit: zone internal error" ) ); DisplayError( this, wxT( "WinEDA_PcbFrame::OnLeftClick() zone internal error" ) ); break; break; case ID_PCB_ADD_TEXT_BUTT: case ID_PCB_ADD_TEXT_BUTT: Loading @@ -249,7 +276,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) { { SetCurItem( Create_Texte_Pcb( DC ) ); SetCurItem( Create_Texte_Pcb( DC ) ); DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema(); DrawPanel->m_AutoPAN_Request = TRUE; DrawPanel->m_AutoPAN_Request = true; } } else if( DrawStruct->Type() == TYPE_TEXTE ) else if( DrawStruct->Type() == TYPE_TEXTE ) { { Loading Loading @@ -288,7 +315,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) { { DrawStruct = Begin_Cotation( NULL, DC ); DrawStruct = Begin_Cotation( NULL, DC ); SetCurItem( DrawStruct ); SetCurItem( DrawStruct ); DrawPanel->m_AutoPAN_Request = TRUE; DrawPanel->m_AutoPAN_Request = true; } } else if( DrawStruct else if( DrawStruct && (DrawStruct->Type() == TYPE_COTATION) && (DrawStruct->Type() == TYPE_COTATION) Loading @@ -296,7 +323,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) { { DrawStruct = Begin_Cotation( (COTATION*) DrawStruct, DC ); DrawStruct = Begin_Cotation( (COTATION*) DrawStruct, DC ); SetCurItem( DrawStruct ); SetCurItem( DrawStruct ); DrawPanel->m_AutoPAN_Request = TRUE; DrawPanel->m_AutoPAN_Request = true; } } else else DisplayError( this, wxT( "Internal err: Struct not COTATION" ) ); DisplayError( this, wxT( "Internal err: Struct not COTATION" ) ); Loading