Commit 95a4f61e authored by Maciej Suminski's avatar Maciej Suminski

wxWidgets 2.8 compatibility fix.

parent 5e48a796
......@@ -137,6 +137,11 @@ struct TOOL_MANAGER::TOOL_STATE
return aRhs.theTool != this->theTool;
}
/**
* Function Push()
* Stores the current state of the tool on stack. Stacks are stored internally and are not
* shared between different TOOL_STATE objects.
*/
void Push()
{
stateStack.push( *this );
......@@ -144,6 +149,12 @@ struct TOOL_MANAGER::TOOL_STATE
clear();
}
/**
* Function Pop()
* Restores state of the tool from stack. Stacks are stored internally and are not
* shared between different TOOL_STATE objects.
* @return True if state was restored, false if the stack was empty.
*/
bool Pop()
{
delete cofunc;
......@@ -603,7 +614,7 @@ bool TOOL_MANAGER::SaveClipboard( const std::string& aText )
{
if( wxTheClipboard->Open() )
{
wxTheClipboard->SetData( new wxTextDataObject( aText ) );
wxTheClipboard->SetData( new wxTextDataObject( wxString( aText.c_str(), wxConvUTF8 ) ) );
wxTheClipboard->Close();
return true;
......
......@@ -688,10 +688,12 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, int aControl )
m_Status_Pcb = 0;
break;
case PCB_MODULE_EDGE_T:
assert( false ); // TODO Orson: I am just checking if it is supposed to be here
case PCB_DIMENSION_T:
case PCB_LINE_T:
case PCB_TEXT_T:
case PCB_MODULE_EDGE_T:
case PCB_TARGET_T:
if( aControl & ADD_APPEND )
m_Drawings.PushBack( aBoardItem );
......
......@@ -305,7 +305,7 @@ void RN_NET::clearNode( const RN_NODE_PTR& aNode )
// Remove all ratsnest edges for associated with the node
newEnd = std::remove_if( m_rnEdges->begin(), m_rnEdges->end(),
boost::bind( isEdgeConnectingNode, _1, aNode ) );
boost::bind( isEdgeConnectingNode, _1, boost::ref( aNode ) ) );
m_rnEdges->resize( std::distance( m_rnEdges->begin(), newEnd ) );
}
......@@ -629,7 +629,7 @@ std::list<RN_NODE_PTR> RN_NET::GetClosestNodes( const RN_NODE_PTR& aNode, int aN
closest.push_back( node );
// Sort by the distance from aNode
closest.sort( boost::bind( sortDistance, aNode, _1, _2 ) );
closest.sort( boost::bind( sortDistance, boost::ref( aNode ), _1, _2 ) );
// Remove the first node (==aNode), as it is surely located within the smallest distance
closest.pop_front();
......@@ -653,7 +653,7 @@ std::list<RN_NODE_PTR> RN_NET::GetClosestNodes( const RN_NODE_PTR& aNode,
closest.push_back( node );
// Sort by the distance from aNode
closest.sort( boost::bind( sortDistance, aNode, _1, _2 ) );
closest.sort( boost::bind( sortDistance, boost::ref( aNode ), _1, _2 ) );
// Remove the first node (==aNode), as it is surely located within the smallest distance
closest.pop_front();
......
......@@ -483,7 +483,7 @@ int EDIT_TOOL::PasteItems( TOOL_EVENT& aEvent )
try
{
BOARD_ITEM* item = io.Parse( m_toolMgr->GetClipboard() );
BOARD_ITEM* item = io.Parse( wxString( m_toolMgr->GetClipboard().c_str(), wxConvUTF8 ) );
assert( item->Type() == PCB_MODULE_T );
pastedModule = dyn_cast<MODULE*>( item );
}
......
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