Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: Mon May 13 13:33:07 CEST 2024

Total time taken to generate the page: 0.02415 seconds