There is no direct support - perhaps because the only hard part is the format, which cannot be preimplemented (you have to decide), putting on clipboard is then simple.
A sample that works for me is in GridCtrl.cpp, function GridCtrl::SetClipboard, where the separation between rows is with \r\n and between columns is with \t.
This way the cells are pasted well in MS Excel and in Open Office.
A thing to care with is not to add aditional tabs per row as in GridCtrl. This additional tab deletes the next column in Excel.
A sample that works for me is in GridCtrl.cpp, function GridCtrl::SetClipboard, where the separation between rows is with \r\n and between columns is with \t.
This way the cells are pasted well in MS Excel and in Open Office.
A thing to care with is not to add aditional tabs per row as in GridCtrl. This additional tab deletes the next column in Excel.
So to copy this:
First Row
Second Row
it has to be passed to the clipboard this:
"First\tRow\r\nSecond\tRow"
instead of this:
"First\tRow\t\r\nSecond\tRow\t"
Thank you very much
Koldo
String s;
for(int i = 0; i < array.GetCount(); i++) {
for(int j = 0; j < columns; j++) {
if(j) s << '\t';
s << AsString(array.Get(i,j);
}
s << "\r\n";
}
WriteClipboardText(s);