Commit c63908b5 authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew, Module Editor: fix bug 707692 and other potential crashes (when having...

Pcbnew, Module Editor: fix bug 707692 and other potential crashes (when having a block command in progress and try to make an edit command)
parent 4f3708c1
......@@ -6,7 +6,7 @@
#endif
#ifndef KICAD_BUILD_VERSION
#define KICAD_BUILD_VERSION "(2011-01-25 BZR 2758)"
#define KICAD_BUILD_VERSION "(2011-01-26 BZR 2759)"
#endif
//#define VERSION_STABILITY "stable"
......
......@@ -17,7 +17,7 @@
; General Product Description Definitions
!define PRODUCT_NAME "KiCad"
!define PRODUCT_VERSION "2011.01.25"
!define PRODUCT_VERSION "2011.01.26"
!define PRODUCT_WEB_SITE "http://iut-tice.ujf-grenoble.fr/kicad/"
!define SOURCEFORGE_WEB_SITE "http://kicad.sourceforge.net/"
!define COMPANY_NAME ""
......
......@@ -22,16 +22,16 @@
/*****************************************************************************************/
void WinEDA_ModuleEditFrame::OnHotKey( wxDC* aDC, int hotkey, EDA_ITEM* DrawStruct )
{
/*****************************************************************************************/
/* Hot keys. Some commands are relative to the item under the mouse cursor
* Commands are case insensitive
*/
{
if( hotkey == 0 )
return;
BOARD_ITEM* item = GetCurItem();
bool blockActive = GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE;
BOARD_ITEM* item = GetCurItem();
bool ItemFree = (item == 0) || (item->m_Flags == 0);
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
cmd.SetEventObject( this );
......@@ -60,7 +60,8 @@ void WinEDA_ModuleEditFrame::OnHotKey( wxDC* aDC, int hotkey, EDA_ITEM* DrawStru
break;
case HK_RESET_LOCAL_COORD: /*Reset the relative coord */
GetScreen()->m_O_Curseur = GetScreen()->m_Curseur;
if( !blockActive )
GetScreen()->m_O_Curseur = GetScreen()->m_Curseur;
break;
case HK_SWITCH_UNITS:
......@@ -89,7 +90,7 @@ void WinEDA_ModuleEditFrame::OnHotKey( wxDC* aDC, int hotkey, EDA_ITEM* DrawStru
case HK_UNDO:
case HK_REDO:
if( ItemFree )
if( ItemFree && !blockActive )
{
wxCommandEvent event( wxEVT_COMMAND_TOOL_CLICKED,
HK_Descr->m_IdMenuEvent );
......@@ -120,12 +121,14 @@ void WinEDA_ModuleEditFrame::OnHotKey( wxDC* aDC, int hotkey, EDA_ITEM* DrawStru
}
}
bool WinEDA_ModuleEditFrame::OnHotkeyEditItem( int aIdCommand )
{
BOARD_ITEM* item = GetCurItem();
bool itemCurrentlyEdited = item && item->m_Flags;
bool itemCurrentlyEdited = item && item->m_Flags;
bool blockActive = GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE;
if( itemCurrentlyEdited )
if( itemCurrentlyEdited || blockActive )
return false;
item = ModeditLocateAndDisplay();
......@@ -170,12 +173,14 @@ bool WinEDA_ModuleEditFrame::OnHotkeyEditItem( int aIdCommand )
return false;
}
bool WinEDA_ModuleEditFrame::OnHotkeyDeleteItem( int aIdCommand )
{
BOARD_ITEM* item = GetCurItem();
bool itemCurrentlyEdited = item && item->m_Flags;
bool itemCurrentlyEdited = item && item->m_Flags;
bool blockActive = GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE;
if( itemCurrentlyEdited )
if( itemCurrentlyEdited || blockActive )
return false;
item = ModeditLocateAndDisplay();
......@@ -220,12 +225,14 @@ bool WinEDA_ModuleEditFrame::OnHotkeyDeleteItem( int aIdCommand )
return false;
}
bool WinEDA_ModuleEditFrame::OnHotkeyMoveItem( int aIdCommand )
{
BOARD_ITEM* item = GetCurItem();
bool itemCurrentlyEdited = item && item->m_Flags;
bool itemCurrentlyEdited = item && item->m_Flags;
bool blockActive = GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE;
if( itemCurrentlyEdited )
if( itemCurrentlyEdited || blockActive )
return false;
item = ModeditLocateAndDisplay();
......@@ -270,11 +277,16 @@ bool WinEDA_ModuleEditFrame::OnHotkeyMoveItem( int aIdCommand )
return false;
}
bool WinEDA_ModuleEditFrame::OnHotkeyRotateItem( int aIdCommand )
{
BOARD_ITEM* item = GetCurItem();
bool itemCurrentlyEdited = item && item->m_Flags;
int evt_type = 0; // Used to post a wxCommandEvent on demand
int evt_type = 0; // Used to post a wxCommandEvent on demand
bool blockActive = GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE;
if( blockActive )
return false;
if( !itemCurrentlyEdited )
item = ModeditLocateAndDisplay();
......
This diff is collapsed.
......@@ -30,7 +30,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
wxString msg;
int flags = 0;
bool locate_track = FALSE;
bool BlockActive = (GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE);
bool blockActive = (GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE);
wxClientDC dc( DrawPanel );
......@@ -42,7 +42,7 @@ bool WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
// If a command or a block is in progress:
// Put the Cancel command (if needed) and the End command
if( BlockActive )
if( blockActive )
{
createPopUpBlockMenu( aPopMenu );
aPopMenu->AppendSeparator();
......
release version:
2011 jan 25
2011 jan 26
files (.zip,.tgz):
kicad-2011-01-25
kicad-2011-01-26
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment