Fix a (minor) issue in Kicad manager: when the schematic editor or the board editor are run from the project tree frame to edit files of the current project, editors are opened on the background.

This commit is contained in:
jean-pierre charras 2016-06-21 11:26:59 -04:00 committed by Wayne Stambaugh
parent 90ed0183c8
commit 535f3ae006
3 changed files with 17 additions and 5 deletions

View File

@ -124,7 +124,10 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id,
m_panScrollbarLimits = false;
m_enableAutoPan = true;
m_ignoreMouseEvents = false;
m_ignoreNextLeftButtonRelease = false;
// Be sure a mouse release button event will be ignored when creating the canvas
// if the mouse click was not made inside the canvas (can happen sometimes, when
// launching an editor from a double click made in an other frame)
m_ignoreNextLeftButtonRelease = true;
m_mouseCaptureCallback = NULL;
m_endMouseCaptureCallback = NULL;

View File

@ -189,7 +189,12 @@ void TREEPROJECT_ITEM::Activate( TREE_PROJECT_FRAME* prjframe )
if( fullFileName == frame->SchFileName() )
{
// the project's schematic is opened using the *.kiface as part of this process.
frame->RunEeschema( fullFileName );
// We do not call frame->RunEeschema( fullFileName ),
// because after the double click, for some reason,
// the tree project frame is brought to the foreground after Eeschema is called from here.
// Instead, we post an event, equivalent to click on the eeschema tool in command frame
wxCommandEvent evt( wxEVT_COMMAND_TOOL_CLICKED, ID_TO_SCH );
wxPostEvent( frame, evt );
}
else
{
@ -203,7 +208,12 @@ void TREEPROJECT_ITEM::Activate( TREE_PROJECT_FRAME* prjframe )
if( fullFileName == frame->PcbFileName() || fullFileName == frame->PcbLegacyFileName() )
{
// the project's BOARD is opened using the *.kiface as part of this process.
frame->RunPcbNew( fullFileName );
// We do not call frame->RunPcbNew( fullFileName ),
// because after the double click, for some reason,
// the tree project frame is brought to the foreground after PcbNew is called from here.
// Instead, we post an event, equivalent to simple click on the pcb editor tool in command frame
wxCommandEvent evt( wxEVT_COMMAND_TOOL_CLICKED, ID_TO_PCB );
wxPostEvent( frame, evt );
}
else
{

View File

@ -30,6 +30,7 @@
#include <fctsys.h>
#include <pgm_kicad.h>
#include <draw_frame.h>
#include <kiway.h>
#include <kiway_player.h>
#include <confirm.h>
@ -325,9 +326,7 @@ void KICAD_MANAGER_FRAME::RunEeschema( const wxString& aProjectSchematicFileName
void KICAD_MANAGER_FRAME::OnRunEeschema( wxCommandEvent& event )
{
wxFileName fn( GetProjectFileName() );
fn.SetExt( SchematicFileExtension );
RunEeschema( fn.GetFullPath() );
}