From 1ea001d497f67e88c927f1b844c0d3ddb9882eab Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 4 Jun 2019 13:46:02 +0100 Subject: [PATCH] Go back to event-loop zooming for new frames. The immediate mode appears to have made things worse not better. --- eeschema/dialogs/dialog_migrate_buses.cpp | 2 +- eeschema/files-io.cpp | 12 ++++++------ eeschema/hierarch.cpp | 2 +- eeschema/libedit/lib_edit_frame.cpp | 4 ++-- eeschema/libedit/libedit.cpp | 4 ++-- eeschema/sch_edit_frame.cpp | 2 +- eeschema/viewlib_frame.cpp | 6 +++--- gerbview/gerbview_frame.cpp | 2 +- pcbnew/footprint_edit_frame.cpp | 2 +- pcbnew/footprint_wizard_frame.cpp | 2 +- pcbnew/pcb_edit_frame.cpp | 2 +- 11 files changed, 20 insertions(+), 20 deletions(-) diff --git a/eeschema/dialogs/dialog_migrate_buses.cpp b/eeschema/dialogs/dialog_migrate_buses.cpp index 59f721136a..9d68d18e72 100644 --- a/eeschema/dialogs/dialog_migrate_buses.cpp +++ b/eeschema/dialogs/dialog_migrate_buses.cpp @@ -65,7 +65,7 @@ DIALOG_MIGRATE_BUSES::DIALOG_MIGRATE_BUSES( SCH_EDIT_FRAME* aParent ) : loadGraphData(); updateUi(); - aParent->GetToolManager()->RunAction( "common.Control.zoomFitScreen", true ); + aParent->GetToolManager()->RunAction( ACTIONS::zoomFitScreen, true ); } diff --git a/eeschema/files-io.cpp b/eeschema/files-io.cpp index 7ad7bd9849..64be90fcb6 100644 --- a/eeschema/files-io.cpp +++ b/eeschema/files-io.cpp @@ -50,7 +50,7 @@ #include #include #include - +#include bool SCH_EDIT_FRAME::SaveEEFile( SCH_SCREEN* aScreen, bool aSaveUnderNewName, bool aCreateBackupFile ) @@ -309,7 +309,7 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in // Do not leave g_RootSheet == NULL because it is expected to be // a valid sheet. Therefore create a dummy empty root sheet and screen. CreateScreens(); - m_toolManager->RunAction( "common.Control.zoomFitScreen", true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); wxString msg; msg.Printf( _( "Error loading schematic file \"%s\".\n%s" ), @@ -382,7 +382,7 @@ bool SCH_EDIT_FRAME::OpenProjectFiles( const std::vector& aFileSet, in } GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId ); - m_toolManager->RunAction( "common.Control.zoomFitScreen", true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); SetSheetNumberAndCount(); SyncView(); GetScreen()->ClearDrawingState(); @@ -645,7 +645,7 @@ bool SCH_EDIT_FRAME::AppendSchematic() screens.TestDanglingEnds(); GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId ); - m_toolManager->RunAction( "common.Control.zoomFitScreen", true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); SetSheetNumberAndCount(); SyncView(); @@ -868,7 +868,7 @@ bool SCH_EDIT_FRAME::importFile( const wxString& aFileName, int aFileType ) RecalculateConnections(); GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId ); - m_toolManager->RunAction( "common.Control.zoomFitScreen", true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); SetSheetNumberAndCount(); SyncView(); UpdateTitle(); @@ -878,7 +878,7 @@ bool SCH_EDIT_FRAME::importFile( const wxString& aFileName, int aFileType ) // Do not leave g_RootSheet == NULL because it is expected to be // a valid sheet. Therefore create a dummy empty root sheet and screen. CreateScreens(); - m_toolManager->RunAction( "common.Control.zoomFitScreen", true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); wxString msg; msg.Printf( _( "Error loading schematic \"%s\".\n%s" ), aFileName, ioe.What() ); diff --git a/eeschema/hierarch.cpp b/eeschema/hierarch.cpp index 4f914bf406..c4a49063b9 100644 --- a/eeschema/hierarch.cpp +++ b/eeschema/hierarch.cpp @@ -273,7 +273,7 @@ void SCH_EDIT_FRAME::DisplayCurrentSheet() if( !screen->m_Initialized ) { - m_toolManager->RunAction( "common.Control.zoomFitScreen", true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); screen->m_Initialized = true; screen->ClearUndoORRedoList( screen->m_UndoList, 1 ); } diff --git a/eeschema/libedit/lib_edit_frame.cpp b/eeschema/libedit/lib_edit_frame.cpp index a71cd90f24..5bef4d7235 100644 --- a/eeschema/libedit/lib_edit_frame.cpp +++ b/eeschema/libedit/lib_edit_frame.cpp @@ -204,7 +204,7 @@ LIB_EDIT_FRAME::LIB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : Raise(); Show( true ); - m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen, false ); SyncView(); GetGalCanvas()->GetViewControls()->SetSnapping( true ); @@ -760,7 +760,7 @@ void LIB_EDIT_FRAME::emptyScreen() SetCurPart( nullptr ); SetScreen( m_dummyScreen ); m_dummyScreen->ClearUndoRedoList(); - m_toolManager->RunAction( "common.Control.zoomFitScreen", true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); Refresh(); } diff --git a/eeschema/libedit/libedit.cpp b/eeschema/libedit/libedit.cpp index 8d0b692781..9a76052984 100644 --- a/eeschema/libedit/libedit.cpp +++ b/eeschema/libedit/libedit.cpp @@ -193,7 +193,7 @@ bool LIB_EDIT_FRAME::LoadComponentFromCurrentLib( const wxString& aAliasName, in m_SyncPinEdit = !GetCurPart()->UnitsLocked(); GetScreen()->ClearUndoRedoList(); - m_toolManager->RunAction( "common.Control.zoomFitScreen", true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); SetShowDeMorgan( GetCurPart()->HasConversion() ); if( aUnit > 0 ) @@ -254,7 +254,7 @@ bool LIB_EDIT_FRAME::LoadOneLibraryPartAux( LIB_ALIAS* aEntry, const wxString& a SetCurPart( new LIB_PART( *lib_part ) ); SetCurLib( aLibrary ); - m_toolManager->RunAction( "common.Control.zoomFitScreen", true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); updateTitle(); RebuildSymbolUnitsList(); SetShowDeMorgan( GetCurPart()->HasConversion() ); diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index e32d3750f7..28f542e862 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -307,7 +307,7 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ): m_auimgr.Update(); GetToolManager()->RunAction( ACTIONS::gridPreset, true, m_LastGridSizeId ); - GetToolManager()->RunAction( ACTIONS::zoomFitScreen, true ); + GetToolManager()->RunAction( ACTIONS::zoomFitScreen, false ); if( GetGalCanvas() ) GetGalCanvas()->GetGAL()->SetGridVisibility( IsGridVisible() ); diff --git a/eeschema/viewlib_frame.cpp b/eeschema/viewlib_frame.cpp index f93877d0ac..e2332479fb 100644 --- a/eeschema/viewlib_frame.cpp +++ b/eeschema/viewlib_frame.cpp @@ -189,8 +189,8 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame m_auimgr.Update(); - GetToolManager()->RunAction( "common.Control.gridPreset", true, m_LastGridSizeId ); - GetToolManager()->RunAction( "common.Control.zoomFitScreen", true ); + GetToolManager()->RunAction( ACTIONS::gridPreset, true, m_LastGridSizeId ); + GetToolManager()->RunAction( ACTIONS::zoomFitScreen, false ); if( !IsModal() ) // For modal mode, calling ShowModal() will show this frame { @@ -642,7 +642,7 @@ void LIB_VIEW_FRAME::SetSelectedComponent( const wxString& aComponentName ) } updatePreviewSymbol(); - m_toolManager->RunAction( "common.Control.zoomFitScreen", true ); + m_toolManager->RunAction( ACTIONS::zoomFitScreen, true ); } } diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index 8ee9378c80..d2c7d22e77 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -161,7 +161,7 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ): m_auimgr.Update(); SetActiveLayer( 0, true ); - GetToolManager()->RunAction( ACTIONS::zoomFitScreen, true ); + GetToolManager()->RunAction( ACTIONS::zoomFitScreen, false ); EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = LoadCanvasTypeSetting(); diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 0307edaad1..2933bd93eb 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -239,7 +239,7 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent, m_auimgr.Update(); GetToolManager()->RunAction( ACTIONS::gridPreset, true, m_LastGridSizeId ); - GetToolManager()->RunAction( ACTIONS::zoomFitScreen, true ); + GetToolManager()->RunAction( ACTIONS::zoomFitScreen, false ); updateTitle(); Raise(); // On some window managers, this is needed diff --git a/pcbnew/footprint_wizard_frame.cpp b/pcbnew/footprint_wizard_frame.cpp index 3522320315..816f087870 100644 --- a/pcbnew/footprint_wizard_frame.cpp +++ b/pcbnew/footprint_wizard_frame.cpp @@ -227,7 +227,7 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, wxWindow* aParent updateView(); SetActiveLayer( F_Cu ); - GetToolManager()->RunAction( ACTIONS::zoomFitScreen, true ); + GetToolManager()->RunAction( ACTIONS::zoomFitScreen, false ); // Do not Run a dialog here: on some Window Managers, it creates issues. // Reason: the FOOTPRINT_WIZARD_FRAME is run as modal; diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index 33d1b33185..406a20519a 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -301,7 +301,7 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) : m_auimgr.Update(); GetToolManager()->RunAction( ACTIONS::gridPreset, true, m_LastGridSizeId ); - GetToolManager()->RunAction( ACTIONS::zoomFitScreen, true ); + GetToolManager()->RunAction( ACTIONS::zoomFitScreen, false ); m_canvasType = LoadCanvasTypeSetting();