From 2ce4f404bec53627c5c935841705451c55422a1e Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sun, 13 Feb 2011 10:07:30 +0100 Subject: [PATCH] Pcbnew: add missing call to SetMouseCapture( NULL, NULL ) in abort functions. --- pcbnew/edit_pcb_text.cpp | 2 ++ pcbnew/edtxtmod.cpp | 2 ++ pcbnew/mirepcb.cpp | 2 ++ pcbnew/modules.cpp | 1 + pcbnew/move-drag_pads.cpp | 2 ++ pcbnew/move_or_drag_track.cpp | 1 + pcbnew/zones_by_polygon.cpp | 2 ++ 7 files changed, 12 insertions(+) diff --git a/pcbnew/edit_pcb_text.cpp b/pcbnew/edit_pcb_text.cpp index d43b678eda..3258ee447c 100644 --- a/pcbnew/edit_pcb_text.cpp +++ b/pcbnew/edit_pcb_text.cpp @@ -35,6 +35,8 @@ void Abort_Edit_Pcb_Text( EDA_DRAW_PANEL* Panel, wxDC* DC ) TEXTE_PCB* TextePcb = (TEXTE_PCB*) Panel->GetScreen()->GetCurItem(); ( (WinEDA_PcbFrame*) Panel->GetParent() )->SetCurItem( NULL ); + Panel->SetMouseCapture( NULL, NULL ); + if( TextePcb == NULL ) // Should not occur return; diff --git a/pcbnew/edtxtmod.cpp b/pcbnew/edtxtmod.cpp index 93a1f37a36..b92a057c14 100644 --- a/pcbnew/edtxtmod.cpp +++ b/pcbnew/edtxtmod.cpp @@ -130,6 +130,8 @@ static void AbortMoveTextModule( EDA_DRAW_PANEL* Panel, wxDC* DC ) TEXTE_MODULE* Text = (TEXTE_MODULE*) screen->GetCurItem(); MODULE* Module; + Panel->SetMouseCapture( NULL, NULL ); + if( Text == NULL ) return; diff --git a/pcbnew/mirepcb.cpp b/pcbnew/mirepcb.cpp index bed7a3a401..edfb79be28 100644 --- a/pcbnew/mirepcb.cpp +++ b/pcbnew/mirepcb.cpp @@ -177,6 +177,8 @@ static void AbortMoveAndEditTarget( EDA_DRAW_PANEL* Panel, wxDC* DC ) ( (WinEDA_PcbFrame*) Panel->GetParent() )->SetCurItem( NULL ); + Panel->SetMouseCapture( NULL, NULL ); + if( MirePcb == NULL ) return; diff --git a/pcbnew/modules.cpp b/pcbnew/modules.cpp index d488ba9511..042eee092e 100644 --- a/pcbnew/modules.cpp +++ b/pcbnew/modules.cpp @@ -121,6 +121,7 @@ void Abort_MoveOrCopyModule( EDA_DRAW_PANEL* Panel, wxDC* DC ) module = (MODULE*) pcbframe->GetScreen()->GetCurItem(); pcbframe->GetBoard()->m_Status_Pcb &= ~RATSNEST_ITEM_LOCAL_OK; + Panel->SetMouseCapture( NULL, NULL ); if( module ) { diff --git a/pcbnew/move-drag_pads.cpp b/pcbnew/move-drag_pads.cpp index a17e701860..d133b7e136 100644 --- a/pcbnew/move-drag_pads.cpp +++ b/pcbnew/move-drag_pads.cpp @@ -26,6 +26,8 @@ static void Abort_Move_Pad( EDA_DRAW_PANEL* Panel, wxDC* DC ) { D_PAD* pad = s_CurrentSelectedPad; + Panel->SetMouseCapture( NULL, NULL ); + if( pad == NULL ) return; diff --git a/pcbnew/move_or_drag_track.cpp b/pcbnew/move_or_drag_track.cpp index 91f9a9f418..6e7a8d3f64 100644 --- a/pcbnew/move_or_drag_track.cpp +++ b/pcbnew/move_or_drag_track.cpp @@ -129,6 +129,7 @@ static void Abort_MoveTrack( EDA_DRAW_PANEL* Panel, wxDC* DC ) Panel, DC, g_HighLight_NetCode ); EraseDragList(); + Panel->SetMouseCapture( NULL, NULL ); } diff --git a/pcbnew/zones_by_polygon.cpp b/pcbnew/zones_by_polygon.cpp index b976ebcd0a..feb2091c95 100644 --- a/pcbnew/zones_by_polygon.cpp +++ b/pcbnew/zones_by_polygon.cpp @@ -155,6 +155,7 @@ static void Abort_Zone_Create_Outline( EDA_DRAW_PANEL* Panel, wxDC* DC ) pcbframe->SetCurItem( NULL ); s_AddCutoutToCurrentZone = false; s_CurrentZone = NULL; + Panel->SetMouseCapture( NULL, NULL ); } @@ -413,6 +414,7 @@ void Abort_Zone_Move_Corner_Or_Outlines( EDA_DRAW_PANEL* Panel, wxDC* DC ) } } + Panel->SetMouseCapture( NULL, NULL ); _AuxiliaryList.ClearListAndDeleteItems(); s_PickedList. ClearListAndDeleteItems(); Panel->Refresh();