Fix intermittent canvas revert to default
The attached patch fixes a minor bug where opening the 'View' menu will sometimes revert the canvas to the default canvas. The problem is that wxMenuItem::Check will cause a menu event when the status is changed even if the checkmark is being *unset*. The workaround is to only call Check with a true argument. This works because the menu items are radio buttons.
This commit is contained in:
parent
dd5b024903
commit
a54830897b
|
@ -4,7 +4,7 @@
|
|||
* Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
|
||||
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
|
||||
* Copyright (C) 1992-2011 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -1048,6 +1048,7 @@ void PCB_BASE_FRAME::OnUpdateSwitchCanvas( wxUpdateUIEvent& aEvent )
|
|||
for( auto ii: menuList )
|
||||
{
|
||||
wxMenuItem* item = menuBar->FindItem( ii.menuId );
|
||||
item->Check( ii.galType == canvasType );
|
||||
if( ii.galType == canvasType )
|
||||
item->Check( true );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue