Commit b6aa832f authored by Maciej Suminski's avatar Maciej Suminski

Converted std::bind1st to boost::bind.

parent 5de41eab
......@@ -23,6 +23,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <boost/bind.hpp>
#include <fctsys.h>
#include <class_drawpanel.h>
#include <class_drawpanel_gal.h>
......@@ -522,7 +523,7 @@ void PCB_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed
if( item->Type() == PCB_MODULE_T )
{
MODULE* oldModule = static_cast<MODULE*>( item );
oldModule->RunOnChildren( std::bind1st( std::mem_fun( &KIGFX::VIEW::Remove ), view ) );
oldModule->RunOnChildren( boost::bind( &KIGFX::VIEW::Remove, view, _1 ) );
}
ratsnest->Remove( item );
......@@ -533,7 +534,7 @@ void PCB_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed
if( item->Type() == PCB_MODULE_T )
{
MODULE* newModule = static_cast<MODULE*>( item );
newModule->RunOnChildren( std::bind1st( std::mem_fun( &KIGFX::VIEW::Add ), view ) );
newModule->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, view, _1 ) );
}
ratsnest->Add( item );
......@@ -549,7 +550,7 @@ void PCB_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed
if( item->Type() == PCB_MODULE_T )
{
MODULE* module = static_cast<MODULE*>( item );
module->RunOnChildren( std::bind1st( std::mem_fun( &KIGFX::VIEW::Remove ), view ) );
module->RunOnChildren( boost::bind( &KIGFX::VIEW::Remove, view, _1 ) );
}
view->Remove( item );
......@@ -563,7 +564,7 @@ void PCB_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed
if( item->Type() == PCB_MODULE_T )
{
MODULE* module = static_cast<MODULE*>( item );
module->RunOnChildren( std::bind1st( std::mem_fun( &KIGFX::VIEW::Add ), view ) );
module->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, view, _1) );
}
view->Add( item );
......
......@@ -75,6 +75,7 @@
#endif
#include <class_drawpanel_gal.h>
#include <boost/bind.hpp>
// Keys used in read/write config
#define OPTKEY_DEFAULT_LINEWIDTH_VALUE wxT( "PlotLineWidth_mm" )
......@@ -524,7 +525,7 @@ void PCB_EDIT_FRAME::ViewReloadBoard( const BOARD* aBoard ) const
// Load modules and its additional elements
for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
{
module->RunOnChildren( std::bind1st( std::mem_fun( &KIGFX::VIEW::Add ), view ) );
module->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, view, _1 ) );
view->Add( module );
}
......
......@@ -22,6 +22,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <boost/bind.hpp>
#include "drawing_tool.h"
#include "common_actions.h"
......@@ -706,14 +707,13 @@ int DRAWING_TOOL::PlaceModule( TOOL_EVENT& aEvent )
// Add all the drawable parts to preview
preview.Add( module );
module->RunOnChildren( std::bind1st( std::mem_fun( &KIGFX::VIEW_GROUP::Add ),
&preview ) );
module->RunOnChildren( boost::bind( &KIGFX::VIEW_GROUP::Add, &preview, _1 ) );
preview.ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
}
else
{
module->RunOnChildren( std::bind1st( std::mem_fun( &KIGFX::VIEW::Add ), m_view ) );
module->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, m_view, _1 ) );
m_view->Add( module );
module->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
......@@ -722,8 +722,7 @@ int DRAWING_TOOL::PlaceModule( TOOL_EVENT& aEvent )
// Remove from preview
preview.Remove( module );
module->RunOnChildren( std::bind1st( std::mem_fun( &KIGFX::VIEW_GROUP::Remove ),
&preview ) );
module->RunOnChildren( boost::bind( &KIGFX::VIEW_GROUP::Remove, &preview, _1 ) );
module = NULL; // to indicate that there is no module that we currently modify
m_controls->ShowCursor( true );
......
......@@ -30,16 +30,15 @@
#include <view/view_controls.h>
#include <ratsnest_data.h>
#include <confirm.h>
#include <cassert>
#include <boost/foreach.hpp>
#include <boost/bind.hpp>
#include "common_actions.h"
#include "selection_tool.h"
#include "edit_tool.h"
using namespace KIGFX;
using boost::optional;
EDIT_TOOL::EDIT_TOOL() :
TOOL_INTERACTIVE( "pcbnew.InteractiveEdit" ), m_selectionTool( NULL )
{
......@@ -96,7 +95,7 @@ int EDIT_TOOL::Main( TOOL_EVENT& aEvent )
// Offset from the dragged item's center (anchor)
wxPoint offset;
VIEW_CONTROLS* controls = getViewControls();
KIGFX::VIEW_CONTROLS* controls = getViewControls();
PCB_EDIT_FRAME* editFrame = static_cast<PCB_EDIT_FRAME*>( m_toolMgr->GetEditFrame() );
controls->ShowCursor( true );
controls->SetSnapping( true );
......@@ -163,7 +162,7 @@ int EDIT_TOOL::Main( TOOL_EVENT& aEvent )
m_dragging = true;
}
selection.group->ViewUpdate( VIEW_ITEM::GEOMETRY );
selection.group->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
m_toolMgr->RunAction( COMMON_ACTIONS::pointEditorUpdate );
}
......@@ -399,7 +398,7 @@ void EDIT_TOOL::remove( BOARD_ITEM* aItem )
{
MODULE* module = static_cast<MODULE*>( aItem );
module->ClearFlags();
module->RunOnChildren( std::bind1st( std::mem_fun( &KIGFX::VIEW::Remove ), getView() ) );
module->RunOnChildren( boost::bind( &KIGFX::VIEW::Remove, getView(), _1 ) );
// Module itself is deleted after the switch scope is finished
// list of pads is rebuild by BOARD::BuildListOfNets()
......
......@@ -25,6 +25,7 @@
#include <boost/foreach.hpp>
#include <boost/optional.hpp>
#include <boost/bind.hpp>
#include <cassert>
#include <class_drawpanel_gal.h>
......@@ -556,7 +557,7 @@ void SELECTION_TOOL::select( BOARD_ITEM* aItem )
if( aItem->Type() == PCB_MODULE_T )
{
MODULE* module = static_cast<MODULE*>( aItem );
module->RunOnChildren( std::bind1st( std::mem_fun( &SELECTION_TOOL::selectVisually ), this ) );
module->RunOnChildren( boost::bind( &SELECTION_TOOL::selectVisually, this, _1 ) );
}
selectVisually( aItem );
......@@ -587,7 +588,7 @@ void SELECTION_TOOL::deselect( BOARD_ITEM* aItem )
if( aItem->Type() == PCB_MODULE_T )
{
MODULE* module = static_cast<MODULE*>( aItem );
module->RunOnChildren( std::bind1st( std::mem_fun( &SELECTION_TOOL::deselectVisually ), this ) );
module->RunOnChildren( boost::bind( &SELECTION_TOOL::deselectVisually, this, _1 ) );
}
deselectVisually( aItem );
......
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