Commit 4da839f3 authored by Tomasz Włostowski's avatar Tomasz Włostowski

groundwork for invoking module editor on selected footprint in GAL mode

parent da9fc844
......@@ -28,6 +28,8 @@
* @brief Footprints selection and loading functions.
*/
#include <boost/bind.hpp>
#include <fctsys.h>
#include <class_drawpanel.h>
#include <pcb_draw_panel_gal.h>
......@@ -61,6 +63,10 @@ static void DisplayCmpDoc( wxString& aName, void* aData );
static FOOTPRINT_LIST MList;
static void clearModuleItemFlags ( BOARD_ITEM *aItem )
{
aItem->ClearFlags();
}
bool FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD( MODULE* aModule )
{
......@@ -92,9 +98,10 @@ bool FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD( MODULE* aModule )
aModule = newModule;
GetBoard()->Add( newModule );
newModule->ClearFlags();
newModule->RunOnChildren( boost::bind( &clearModuleItemFlags, _1 ) );
GetBoard()->Add( newModule );
// Clear references to any net info, because the footprint editor
// does know any thing about nets handled by the current edited board.
......
......@@ -53,6 +53,7 @@
#include <modview_frame.h>
#include <collectors.h>
#include <tool/tool_manager.h>
#include <tools/common_actions.h>
#include <dialog_edit_module_for_Modedit.h>
#include <wildcards_and_files_ext.h>
......@@ -428,6 +429,8 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
break;
}
m_toolManager->RunAction( COMMON_ACTIONS::selectionClear, true );
// Create the "new" module
MODULE* newmodule = new MODULE( *module_in_edit );
newmodule->SetParent( mainpcb );
......@@ -480,6 +483,7 @@ void FOOTPRINT_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
RN_DATA* ratsnest = pcbframe->GetBoard()->GetRatsnest();
ratsnest->Update( newmodule );
ratsnest->Recalculate();
GetGalCanvas()->ForceRefresh();
}
}
break;
......
......@@ -45,6 +45,8 @@
#include <wildcards_and_files_ext.h>
#include <boost/bind.hpp>
#include <tool/tool_manager.h>
#include <tools/common_actions.h>
static bool RecreateCmpFile( BOARD * aBrd, const wxString& aFullCmpFileName );
......@@ -481,6 +483,10 @@ void PCB_EDIT_FRAME::Exchange_Module( MODULE* aOldModule,
aNewModule->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, view, _1 ) );
view->Add( aNewModule );
m_toolManager->RunAction( COMMON_ACTIONS::selectionClear, true );
GetGalCanvas()->ForceRefresh();
}
}
else
......
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