diff --git a/pcbnew/dialogs/dialog_set_grid.cpp b/pcbnew/dialogs/dialog_set_grid.cpp index 689b803699..ad0323476a 100644 --- a/pcbnew/dialogs/dialog_set_grid.cpp +++ b/pcbnew/dialogs/dialog_set_grid.cpp @@ -5,7 +5,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 1992-2013 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2015 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 @@ -34,6 +34,8 @@ #include #include #include +#include +#include class DIALOG_SET_GRID : public DIALOG_SET_GRID_BASE @@ -155,7 +157,7 @@ void DIALOG_SET_GRID::setGridOrigin( const wxPoint& grid ) } -void DIALOG_SET_GRID::setGridForFastSwitching( const wxArrayString& aGrids, int aGrid1, int aGrid2 ) +void DIALOG_SET_GRID::setGridForFastSwitching( const wxArrayString& aGrids, int aGrid1, int aGrid2 ) { m_comboBoxGrid1->Append( aGrids ); m_comboBoxGrid2->Append( aGrids ); @@ -216,12 +218,21 @@ bool PCB_BASE_FRAME::InvokeDialogGrid() SetGridOrigin( grid_origin ); - GetScreen()->AddGrid( m_UserGridSize, m_UserGridUnit, ID_POPUP_GRID_USER ); + BASE_SCREEN* screen = GetScreen(); + + screen->AddGrid( m_UserGridSize, m_UserGridUnit, ID_POPUP_GRID_USER ); // If the user grid is the current option, recall SetGrid() // to force new values put in list as current grid value - if( GetScreen()->GetGridId() == ID_POPUP_GRID_USER ) - GetScreen()->SetGrid( ID_POPUP_GRID_USER ); + if( screen->GetGridId() == ID_POPUP_GRID_USER ) + screen->SetGrid( ID_POPUP_GRID_USER ); + + if( IsGalCanvasActive() ) + { + GetGalCanvas()->GetGAL()->SetGridSize( VECTOR2D( screen->GetGrid().m_Size.x, + screen->GetGrid().m_Size.y ) ); + GetGalCanvas()->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED ); + } m_canvas->Refresh(); diff --git a/pcbnew/dialogs/dialog_set_grid_base.cpp b/pcbnew/dialogs/dialog_set_grid_base.cpp index 3530f39de9..9f1207820a 100644 --- a/pcbnew/dialogs/dialog_set_grid_base.cpp +++ b/pcbnew/dialogs/dialog_set_grid_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 8 2012) +// C++ code generated with wxFormBuilder (version Mar 13 2015) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! diff --git a/pcbnew/dialogs/dialog_set_grid_base.fbp b/pcbnew/dialogs/dialog_set_grid_base.fbp index ac115f7829..0679f75ab6 100644 --- a/pcbnew/dialogs/dialog_set_grid_base.fbp +++ b/pcbnew/dialogs/dialog_set_grid_base.fbp @@ -1,6 +1,6 @@ - + C++ @@ -20,8 +20,10 @@ . 1 + 1 1 1 + UI 0 0 diff --git a/pcbnew/dialogs/dialog_set_grid_base.h b/pcbnew/dialogs/dialog_set_grid_base.h index 9bb3e86b55..32a92c29ed 100644 --- a/pcbnew/dialogs/dialog_set_grid_base.h +++ b/pcbnew/dialogs/dialog_set_grid_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 8 2012) +// C++ code generated with wxFormBuilder (version Mar 13 2015) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE!