Ensure clipboard data is available after KiCad closes
Always Flush() after SetData()
This commit is contained in:
parent
5822cd85c4
commit
ae009e0758
|
@ -696,6 +696,7 @@ void BM2CMP_FRAME::OnExportToClipboard( wxCommandEvent& event )
|
||||||
// This data objects are held by the clipboard,
|
// This data objects are held by the clipboard,
|
||||||
// so do not delete them in the app.
|
// so do not delete them in the app.
|
||||||
wxTheClipboard->SetData( new wxTextDataObject( buffer.c_str() ) );
|
wxTheClipboard->SetData( new wxTextDataObject( buffer.c_str() ) );
|
||||||
|
wxTheClipboard->Flush(); // Allow data to be available after closing KiCad
|
||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -150,6 +150,7 @@ void HTML_MESSAGE_BOX::OnCharHook( wxKeyEvent& aEvent )
|
||||||
if( wxTheClipboard->Open() )
|
if( wxTheClipboard->Open() )
|
||||||
{
|
{
|
||||||
wxTheClipboard->SetData( new wxTextDataObject( m_htmlWindow->SelectionToText() ) );
|
wxTheClipboard->SetData( new wxTextDataObject( m_htmlWindow->SelectionToText() ) );
|
||||||
|
wxTheClipboard->Flush(); // Allow data to be available after closing KiCad
|
||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -236,6 +236,7 @@ void WX_HTML_REPORT_PANEL::onMenuEvent( wxMenuEvent& event )
|
||||||
bool primarySelection = wxTheClipboard->IsUsingPrimarySelection();
|
bool primarySelection = wxTheClipboard->IsUsingPrimarySelection();
|
||||||
wxTheClipboard->UsePrimarySelection( false ); // required to use the main clipboard
|
wxTheClipboard->UsePrimarySelection( false ); // required to use the main clipboard
|
||||||
wxTheClipboard->SetData( new wxTextDataObject( m_htmlView->SelectionToText() ) );
|
wxTheClipboard->SetData( new wxTextDataObject( m_htmlView->SelectionToText() ) );
|
||||||
|
wxTheClipboard->Flush(); // Allow data to be available after closing KiCad
|
||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
wxTheClipboard->UsePrimarySelection( primarySelection );
|
wxTheClipboard->UsePrimarySelection( primarySelection );
|
||||||
}
|
}
|
||||||
|
|
|
@ -636,6 +636,7 @@ void GRID_TRICKS::cutcopy( bool doCopy, bool doDelete )
|
||||||
if( doCopy )
|
if( doCopy )
|
||||||
{
|
{
|
||||||
wxTheClipboard->SetData( new wxTextDataObject( txt ) );
|
wxTheClipboard->SetData( new wxTextDataObject( txt ) );
|
||||||
|
wxTheClipboard->Flush(); // Allow data to be available after closing KiCad
|
||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -980,6 +980,8 @@ bool TOOL_MANAGER::SaveClipboard( const std::string& aTextUTF8 )
|
||||||
// Store the UTF8 string as unicode string in clipboard:
|
// Store the UTF8 string as unicode string in clipboard:
|
||||||
wxTheClipboard->SetData( new wxTextDataObject( wxString( aTextUTF8.c_str(),
|
wxTheClipboard->SetData( new wxTextDataObject( wxString( aTextUTF8.c_str(),
|
||||||
wxConvUTF8 ) ) );
|
wxConvUTF8 ) ) );
|
||||||
|
|
||||||
|
wxTheClipboard->Flush(); // Allow data to be available after closing KiCad
|
||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -332,6 +332,7 @@ void DIALOG_CHOOSE_SYMBOL::OnCharHook( wxKeyEvent& e )
|
||||||
if( wxTheClipboard->Open() )
|
if( wxTheClipboard->Open() )
|
||||||
{
|
{
|
||||||
wxTheClipboard->SetData( new wxTextDataObject( txt ) );
|
wxTheClipboard->SetData( new wxTextDataObject( txt ) );
|
||||||
|
wxTheClipboard->Flush(); // Allow data to be available after closing KiCad
|
||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -541,6 +541,7 @@ void SCH_EDIT_FRAME::DrawCurrentSheetToClipboard()
|
||||||
// This data objects are held by the clipboard, so do not delete them in the app.
|
// This data objects are held by the clipboard, so do not delete them in the app.
|
||||||
wxBitmapDataObject* clipbrd_data = new wxBitmapDataObject( image );
|
wxBitmapDataObject* clipbrd_data = new wxBitmapDataObject( image );
|
||||||
wxTheClipboard->SetData( clipbrd_data );
|
wxTheClipboard->SetData( clipbrd_data );
|
||||||
|
wxTheClipboard->Flush(); // Allow data to be available after closing KiCad
|
||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -299,6 +299,7 @@ void PANEL_SETUP_BOARD_STACKUP::onExportToClipboard( wxCommandEvent& event )
|
||||||
// This data objects are held by the clipboard,
|
// This data objects are held by the clipboard,
|
||||||
// so do not delete them in the app.
|
// so do not delete them in the app.
|
||||||
wxTheClipboard->SetData( new wxTextDataObject( report ) );
|
wxTheClipboard->SetData( new wxTextDataObject( report ) );
|
||||||
|
wxTheClipboard->Flush(); // Allow data to be available after closing KiCad
|
||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -510,6 +510,7 @@ void PNS_LOG_VIEWER_FRAME::onListCopy( wxCommandEvent& event )
|
||||||
// This data objects are held by the clipboard,
|
// This data objects are held by the clipboard,
|
||||||
// so do not delete them in the app.
|
// so do not delete them in the app.
|
||||||
wxTheClipboard->SetData( new wxTextDataObject(s) );
|
wxTheClipboard->SetData( new wxTextDataObject(s) );
|
||||||
|
wxTheClipboard->Flush(); // Allow data to be available after closing KiCad
|
||||||
wxTheClipboard->Close();
|
wxTheClipboard->Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue