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 » AttrText() and content of the cell
Re: AttrText() and content of the cell [message #11947 is a reply to message #11933] Wed, 03 October 2007 15:46 Go to previous messageGo to previous message
forlano is currently offline  forlano
Messages: 1207
Registered: March 2006
Location: Italy
Senior Contributor
forlano wrote on Tue, 02 October 2007 21:59


From what I'm observing it seems that the content of the cell is not exactly the same. Maybe some invisible character is added by AttrText() that it is passed to display to paint the cell?
Thanks,
Luigi



It is as suspected

#include <CtrlLib/CtrlLib.h>
using namespace Upp;

GUI_APP_MAIN
{ ArrayCtrl arr;
  TopWindow w;
  w.Add(arr);
  arr.SizePos();
  arr.AddColumn("col");
  arr.AddColumn("two");
  arr.Add( 1, 2);
  arr.Add( 1, 2);
  arr.Add( 1, 2);
  
  arr.Set(2,1, AttrText("2").Paper(Color(250,150,150)) );
  arr.Add( 1, arr.Get(2,1) );  //arr.Get(2,1) get not only the number "2" but even some info regarding the color of the cell
  arr.Add( 1, arr.Get(2,1).ToString() );  //I can't get "2"
  arr.Add( 1, AsString(arr.Get(2,1)) );  //I can't get "2"
  
  w.Run();
}


Because AttrText() (both in arrayctrl and gridctrl) extend in some way the data I put inside the cell I would like to know how to extract the data previously inserted in the cell. I mean disregarding the color information and so on. In other words, if I put a number in the cell and then modify its appearence I would like to get back the same number if I need it.

Alternatively I would like to know how to set the background color of a cell indipendently of the content of the cell. If I use Display I can test the passed data, but sometimes would be very useful a direct way to change the background of the cell (i,j) irrispective of the value inside and in a way that it is determined only at runtime.

Luigi

[Updated on: Wed, 03 October 2007 15:48]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Missing GridCtrl?
Next Topic: desire: ArrayCtrl and GridCtrl: Find in the row
Goto Forum:
  


Current Time: Mon Jun 23 00:17:55 CEST 2025

Total time taken to generate the page: 0.04128 seconds