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 » Problem with Clipboard in GridCtrl
Problem with Clipboard in GridCtrl [message #34358] Fri, 18 November 2011 13:14 Go to next message
koldo is currently offline  koldo
Messages: 3040
Registered: August 2008
Ultimate Member
Hello Daniel

When copying GridCtrl rows I have a problem if some of the cells is colored.

To color a cell I do:

grid.Set(row, col, AttrText("Hello").Paper(LtRed));


When selecting and copying to the clipboard, I get this error:

index.php?t=getfile&id=3520&private=0

It fails as this is true:
Typemap().Find(type) >= 0


It is like there is a problem when inserting a AttrText in a Value.

It is inserted as a RawValueRep, type == 5 + 0x8000000
  • Attachment: dib.PNG
    (Size: 8.99KB, Downloaded 381 times)


Best regards
Iñaki
Re: Problem with Clipboard in GridCtrl [message #34408 is a reply to message #34358] Sun, 20 November 2011 23:26 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1355
Registered: November 2005
Location: Poland
Senior Contributor

Thanks! I'll try to fix it ASAP.
Re: Problem with Clipboard in GridCtrl [message #34649 is a reply to message #34408] Sat, 03 December 2011 23:09 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1355
Registered: November 2005
Location: Poland
Senior Contributor

Finally fixed Smile
Re: Problem with Clipboard in GridCtrl [message #34651 is a reply to message #34649] Sat, 03 December 2011 23:37 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3040
Registered: August 2008
Ultimate Member
Hello Daniel

Now it runs but it does not copy column names (if CopyColumnNames() is used).


Best regards
Iñaki
Re: Problem with Clipboard in GridCtrl [message #34653 is a reply to message #34651] Sun, 04 December 2011 00:04 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1355
Registered: November 2005
Location: Poland
Senior Contributor

koldo wrote on Sat, 03 December 2011 17:37

Hello Daniel

Now it runs but it does not copy column names (if CopyColumnNames() is used).

Could you please paste a screensho here from your app before you press ctrl-c?
Re: Problem with Clipboard in GridCtrl [message #34655 is a reply to message #34653] Sun, 04 December 2011 00:37 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3040
Registered: August 2008
Ultimate Member
Hello Daniel

It is now solved Smile.


Best regards
Iñaki
Re: Problem with Clipboard in GridCtrl [message #35073 is a reply to message #34655] Mon, 09 January 2012 12:04 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3040
Registered: August 2008
Ultimate Member
Hello Daniel

I do not know what happened, but now when copying rows with colors, the text inside cells is not copied.


Best regards
Iñaki
Re: Problem with Clipboard in GridCtrl [message #35075 is a reply to message #35073] Mon, 09 January 2012 16:03 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3040
Registered: August 2008
Ultimate Member
Hello Daniel

There is other problem. The row ordering by clicking the header does not work well with colored cells.

In general it would be great if in GridCtrl it would be separated the cell value from the formatting. I think the AttrText() solution to insert formatting in cells is not ideal Sad.


Best regards
Iñaki
Re: Problem with Clipboard in GridCtrl [message #35162 is a reply to message #35075] Wed, 18 January 2012 09:07 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1355
Registered: November 2005
Location: Poland
Senior Contributor

koldo wrote on Mon, 09 January 2012 10:03

Hello Daniel

There is other problem. The row ordering by clicking the header does not work well with colored cells.

In general it would be great if in GridCtrl it would be separated the cell value from the formatting. I think the AttrText() solution to insert formatting in cells is not ideal Sad.

Hi Koldo!
I checked both problems in the latest version and for me everything is fine.. Maybe you could provide a test case with steps to reproduce.
Re: Problem with Clipboard in GridCtrl [message #35164 is a reply to message #35162] Wed, 18 January 2012 09:49 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3040
Registered: August 2008
Ultimate Member
Hello Daniel

This is the code:
#include <CtrlLib/CtrlLib.h>
#include <GridCtrl/GridCtrl.h>

using namespace Upp;

GUI_APP_MAIN
{
	TopWindow w;
	GridCtrl grid;
	
	grid.Clipboard().CopyColumnNames();
	grid.AddColumn("Data");
	grid.Add(AttrText("123").Center().Paper(LtGreen()).Bold());
	grid.Add(AttrText("023").Center().Paper(LtGreen()).Bold());
	grid.Add(AttrText("523").Center().Paper(LtGreen()).Bold());
	
	w.Add(grid.SizePos());
	
	w.Run();
}

The package is also included.

Thank you Smile.


Best regards
Iñaki

[Updated on: Wed, 18 January 2012 09:57]

Report message to a moderator

Re: Problem with Clipboard in GridCtrl [message #35165 is a reply to message #35164] Wed, 18 January 2012 11:24 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1355
Registered: November 2005
Location: Poland
Senior Contributor

Thank you for a test case! My test was too simple to detect that Smile. It's fixed now. I'll push out the changes in the evening.
What about coping? Do you still have this problem? I'm not able to reproduce it..
Re: Problem with Clipboard in GridCtrl [message #35166 is a reply to message #35165] Wed, 18 January 2012 12:39 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3040
Registered: August 2008
Ultimate Member
Hello Daniel

Thank you!

The sample was to show the problems ordering and copying.

If I copy with that sample I can only get the column headers.


Best regards
Iñaki
Re: Problem with Clipboard in GridCtrl [message #35167 is a reply to message #35166] Wed, 18 January 2012 13:55 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1355
Registered: November 2005
Location: Poland
Senior Contributor

koldo wrote on Wed, 18 January 2012 06:39

Hello Daniel
Thank you!
The sample was to show the problems ordering and copying.
If I copy with that sample I can only get the column headers.

Ok, you meant textual clipboard. It's fixed now as well!
Re: Problem with Clipboard in GridCtrl [message #35169 is a reply to message #35167] Wed, 18 January 2012 15:42 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3040
Registered: August 2008
Ultimate Member
Thank you Smile

Best regards
Iñaki
Re: Problem with Clipboard in GridCtrl [message #35176 is a reply to message #35169] Thu, 19 January 2012 11:38 Go to previous message
koldo is currently offline  koldo
Messages: 3040
Registered: August 2008
Ultimate Member
Confirmed. Problem solved.

Best regards
Iñaki
Previous Topic: Not able to remove Columns in Grid.
Next Topic: GridCtrl WhenLeftDouble Callback
Goto Forum:
  


Current Time: Fri Dec 06 02:18:47 CET 2019

Total time taken to generate the page: 0.01769 seconds