U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Range paste for GridCtrl
Re: Range paste for GridCtrl [message #8554 is a reply to message #8551] Fri, 16 March 2007 23:07 Go to previous messageGo to previous message
nixnixnix is currently offline  nixnixnix
Messages: 415
Registered: February 2007
Location: Kelowna, British Columbia
Senior Member
ok here is my code


void GridCtrl::Paste(int mode)
{
if(!clipboard)
return;

GridClipboard gc = GetClipboard();
if(gc.data.IsEmpty())
{
if(IsClipboardAvailableText())
{
Point start(curpos);
int ncol,nrow;

Vector<String> lines = Upp::Split(ReadClipboardText(), '\n');
for(int i = 0; i < lines.GetCount(); i++)
{
Vector<String> cells = Upp::Split(lines[i], '\t'); // tab not space
for(int j=0;j<cells.GetCount();j++)
{
ncol = start.x + j - 1;
nrow = start.y + i - 1;

this->Set(nrow, ncol, cells[j]);
}
}
}
return;
}


seems to work fine

Nick
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to change GridCtrl background color
Next Topic: How to do column resizing after ShowColumn() or HideColumn()?
Goto Forum:
  


Current Time: Sat Jul 04 10:41:14 GMT+2 2026

Total time taken to generate the page: 0.00618 seconds