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 ...@@ -137,6 +137,11 @@ struct TOOL_MANAGER::TOOL_STATE
return aRhs.theTool != this->theTool; 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() void Push()
{ {
stateStack.push( *this ); stateStack.push( *this );
...@@ -144,6 +149,12 @@ struct TOOL_MANAGER::TOOL_STATE ...@@ -144,6 +149,12 @@ struct TOOL_MANAGER::TOOL_STATE
clear(); 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() bool Pop()
{ {
delete cofunc; delete cofunc;
...@@ -603,7 +614,7 @@ bool TOOL_MANAGER::SaveClipboard( const std::string& aText ) ...@@ -603,7 +614,7 @@ bool TOOL_MANAGER::SaveClipboard( const std::string& aText )
{ {
if( wxTheClipboard->Open() ) if( wxTheClipboard->Open() )
{ {
wxTheClipboard->SetData( new wxTextDataObject( aText ) ); wxTheClipboard->SetData( new wxTextDataObject( wxString( aText.c_str(), wxConvUTF8 ) ) );
wxTheClipboard->Close(); wxTheClipboard->Close();
return true; return true;
......
...@@ -688,10 +688,12 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, int aControl ) ...@@ -688,10 +688,12 @@ void BOARD::Add( BOARD_ITEM* aBoardItem, int aControl )
m_Status_Pcb = 0; m_Status_Pcb = 0;
break; 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_DIMENSION_T:
case PCB_LINE_T: case PCB_LINE_T:
case PCB_TEXT_T: case PCB_TEXT_T:
case PCB_MODULE_EDGE_T:
case PCB_TARGET_T: case PCB_TARGET_T:
if( aControl & ADD_APPEND ) if( aControl & ADD_APPEND )
m_Drawings.PushBack( aBoardItem ); m_Drawings.PushBack( aBoardItem );
......
...@@ -305,7 +305,7 @@ void RN_NET::clearNode( const RN_NODE_PTR& aNode ) ...@@ -305,7 +305,7 @@ void RN_NET::clearNode( const RN_NODE_PTR& aNode )
// Remove all ratsnest edges for associated with the node // Remove all ratsnest edges for associated with the node
newEnd = std::remove_if( m_rnEdges->begin(), m_rnEdges->end(), 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 ) ); 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 ...@@ -629,7 +629,7 @@ std::list<RN_NODE_PTR> RN_NET::GetClosestNodes( const RN_NODE_PTR& aNode, int aN
closest.push_back( node ); closest.push_back( node );
// Sort by the distance from aNode // 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 // Remove the first node (==aNode), as it is surely located within the smallest distance
closest.pop_front(); closest.pop_front();
...@@ -653,7 +653,7 @@ std::list<RN_NODE_PTR> RN_NET::GetClosestNodes( const RN_NODE_PTR& aNode, ...@@ -653,7 +653,7 @@ std::list<RN_NODE_PTR> RN_NET::GetClosestNodes( const RN_NODE_PTR& aNode,
closest.push_back( node ); closest.push_back( node );
// Sort by the distance from aNode // 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 // Remove the first node (==aNode), as it is surely located within the smallest distance
closest.pop_front(); closest.pop_front();
......
...@@ -483,7 +483,7 @@ int EDIT_TOOL::PasteItems( TOOL_EVENT& aEvent ) ...@@ -483,7 +483,7 @@ int EDIT_TOOL::PasteItems( TOOL_EVENT& aEvent )
try 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 ); assert( item->Type() == PCB_MODULE_T );
pastedModule = dyn_cast<MODULE*>( item ); 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