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 » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » Getting data in a row of ArrCtrl
Re: Getting data in a row of ArrCtrl [message #2206 is a reply to message #2200] Tue, 04 April 2006 00:40 Go to previous messageGo to previous message
forlano is currently offline  forlano
Messages: 1214
Registered: March 2006
Location: Italy
Senior Contributor
I have got so many answers that I am a bit confused Smile
I need to experiment each of them separately.

Please let me answer.

Quote:


1. When? (then think about when... )
2. In what format and destination? - what do you want to do with the data?



1. In principle when I click on a row I would like to have the possibility to retrieve the data (to send them in the above mask for some modification for example).
But after your question I think could be very useful to get the data even when I press some button (I need it for another Tab page). In this case I could want get the data where the cursor is and/or in corrispondence of a given row (think about a loop that scan all the rows).

2. Format? some of the cells (coloumns) in the row are string, other are integer. It is preferible to get them in their original format. But if all are retrieved as string it is perfect too.
Once the data are available I could send them in some other widget or save in a file... it depends. For the moment just pass to another widget.

Now please let me ask you something about your previous suggestion:

a)
void Tab1::PromptCell(){
	String s;
	s=AsString(arr.ReadRow(arr.GetCursor())[arr.GetClickColumn()]);	
	PromptOK(s);
}


I've associated this method to left_click event with

arr.WhenLeftClick = THISBACK(PromptCell);

Did you mean to play in this way?

Quote:


also, don't forget a useful method ToString() ...



What do you mean? Why I need this method (sorry for this silly question).

b)
	String s;
	int int_row = arr.GetCursor();
	for (int i=0; i<arr.GetColumnCount(); i++) {
		s << arr.Get(int_row, i);
		s << ":::";
      }


If I have understood, in this last example all the cells finish in 's' separated by ":::". Is this correct? It is evident that the operator '<<' does a continues strcat(...), it isn't. (Sometimes I feel to be a dinosaur... but I'm enjoing the short and powerfull syntax of C++ Smile ).

Luigi
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
Next Topic: "Forlano tabs" - fill EditFields from ArrayCtrl Row...
Goto Forum:
  


Current Time: Sat Aug 23 13:30:21 CEST 2025

Total time taken to generate the page: 0.03911 seconds