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]
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 previous 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
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to create a GridCtrl with fixed cell size
Next Topic: GridCtrl sorting and segfaults
Goto Forum:
  


Current Time: Tue Apr 29 14:01:13 CEST 2025

Total time taken to generate the page: 0.00831 seconds