in my wxWidgets Application i use Copy & Paste to copy Files from outside my Application into it.
So, Copy & Paste works very fine, but i never find informations to make Cut & Paste working.
Is there an possible automatism in wxWidgets or must i delete the cutted Files on my own if there are
pasted into my Application? And if so, how can i get the information that it is an Cut & Paste operation
and not an Copy & Paste.
To Paste Files into my Application in use following Code:
Code: Select all
void MainWindow::onPasteFile(wxCommandEvent &event) {
wxClipboard cifeClipboard;
if (cifeClipboard.Open()) {
if (cifeClipboard.IsSupported(wxDF_FILENAME)) {
wxFileDataObject data;
cifeClipboard.GetData(data);
int defaultUserNumber = cifeSettings->readInteger("CpmOptions", "DefaultUserNumber", 0);
wxString textFileEndings = cifeSettings->readString("CpmOptions", "TextfileEndings", "txt pip pas");
wxArrayString files = data.GetFilenames();
for (size_t i = 0; i < files.Count(); i++) {
wxFileName fileName(files[i]);
wxString fileExt = fileName.GetExt();
bool isTextFile = textFileEndings.Matches("*" + fileExt + "*");
cpmtools->writeFileToImage(files[i], defaultUserNumber, isTextFile, true);
}
onViewRefresh(event);
}
cifeClipboard.Close();
}
}
Greetings
Netzschleicher