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 » GridCtrl - copy all [Feature Request]
GridCtrl - copy all [Feature Request] [message #16154] Thu, 29 May 2008 20:33 Go to next message
nixnixnix is currently offline  nixnixnix
Messages: 415
Registered: February 2007
Location: Kelowna, British Columbia
Senior Member
Hey Daniel,

I use very large grids and I'd like my users to be able to copy and paste the whole thing to excel or openoffice. Would it be a lot of work for you to add a CopyAll() function which would look at the current size of the grid and copy everything in it (text and values) to the clipboard please?

Nick
Re: GridCtrl - copy all [Feature Request] [message #16156 is a reply to message #16154] Thu, 29 May 2008 22:58 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Ok, but this must wait until next weekend (I have planned small vacations).
Re: GridCtrl - copy all [Feature Request] [message #16161 is a reply to message #16156] Fri, 30 May 2008 04:23 Go to previous messageGo to next message
nixnixnix is currently offline  nixnixnix
Messages: 415
Registered: February 2007
Location: Kelowna, British Columbia
Senior Member
Quote:

Ok, but this must wait until next weekend (I have planned small vacations).


LOL - ok I guess I can wait till then Wink
Re: GridCtrl - copy all [Feature Request] [message #16165 is a reply to message #16161] Fri, 30 May 2008 08:56 Go to previous messageGo to next message
pepe11 is currently offline  pepe11
Messages: 16
Registered: June 2006
Location: Slovakia
Promising Member

Maybe this help to you :

.....
GridCtrl ar;
.....
vmr2.ar.WhenMenuBar=THISBACK1(SubMenuGC,&(vmr2.ar));
.....

void SubMenuGC(Bar& bar,GridCtrl* pod1) { bar.Add(pod1->GetCount(),"Export to clipboard",TImgVaV::copy() , THISBACK1(KopirovanieGC,pod1)).Help("Export to clipboard").Key(K_CTRL_C);
.....
bar.Add(IsClipboardAvailableText(),"Paste from clipboard",TImgVaV::paste() , THISBACK2(PasteGC,pod1,false)).Help("Paste from clipboard").Key(K_CTRL_V);
.....
}

void CopyAllGC(GridCtrl* pod1)
{
WString txt;
int i,first=0;

if(pod1->GetCount()>0)
{
i=pod1->GetColumnCount();
if(!pod1->IsSelection() && pod1->GetSelectedItemsCount()>0)
{
for(int y=0;y<i;y++)
{
txt.Cat((first?"\t":""));
first=1;
txt.Cat(pod1->GetColumn(y).GetName().ToWString());
}
txt.Cat("\r\n");
}
for(int z=0;z<pod1->GetCount();z++)
{
first=0;
for(int y=0;y<i;y++) // if(pod1->IsSelected(z,y))
{
txt.Cat((first?"\t":""));
first=1;
txt.Cat(pod1->Get(z,y).ToString().ToWString());
}
if(first) txt.Cat("\r\n");
}
WriteClipboardUnicodeText(txt);// WriteClipboardText(txt.ToString());
}
}


Pepe
Re: GridCtrl - copy all [Feature Request] [message #16192 is a reply to message #16165] Sun, 01 June 2008 05:44 Go to previous messageGo to next message
nixnixnix is currently offline  nixnixnix
Messages: 415
Registered: February 2007
Location: Kelowna, British Columbia
Senior Member
Thanks Pepe,

I'll give it a shot.

Cheers,

Nick
Re: GridCtrl - copy all [Feature Request] [message #16346 is a reply to message #16154] Mon, 09 June 2008 18:32 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

nixnixnix wrote on Thu, 29 May 2008 14:33

Hey Daniel,

I use very large grids and I'd like my users to be able to copy and paste the whole thing to excel or openoffice. Would it be a lot of work for you to add a CopyAll() function which would look at the current size of the grid and copy everything in it (text and values) to the clipboard please?

Nick

Done. I added Copy(bool all) and CopyAll(). If all is not true only selected cells are copied to the clipboard.
Re: GridCtrl - copy all [Feature Request] [message #16467 is a reply to message #16346] Tue, 17 June 2008 07:12 Go to previous message
nixnixnix is currently offline  nixnixnix
Messages: 415
Registered: February 2007
Location: Kelowna, British Columbia
Senior Member
Thanks Daniel,

Will check it out on the next beta.

Nick
Previous Topic: How to create a GridCtrl with fixed cell size
Next Topic: GridCtrl sorting and segfaults
Goto Forum:
  


Current Time: Tue Apr 23 14:46:43 CEST 2024

Total time taken to generate the page: 0.01384 seconds