Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » How to Set data in the ArrayCtrl from EditField(s)...[EXAMPLE] 
	
		
		
			| How to Set data in the ArrayCtrl from EditField(s)...[EXAMPLE] [message #2227] | 
			Tue, 04 April 2006 18:34  | 
		 
		
			
				
				
				  | 
					
						  
						forlano
						 Messages: 1215 Registered: March 2006  Location: Italy
						
					 | 
					Senior Contributor  | 
					 | 
		 
		 
	 | 
 
	
		This time I post directly the answer    
 
class Tab1 : public WithTab1Layout<TopWindow> {
public:
	typedef Tab1 CLASSNAME;
	Tab1();
	void AddPlayer(); //callback from Add_Player  button
	void ModifyPlayer(); //callback from Modify_Player  button
	void MaskDefaultValue(); //callback from Clear button
	void FillFieldsFromRow();
};
void Tab1::ModifyPlayer() // body of the callback 
{   int int_row;
    int_row=arr.GetCursor();
    if (int_row < 0) return; // prevent the crash of the application when int_row = -1)
    if ( (~editName) == Null) { //of course this is specific of my application... in principle this if() block can be removed
       Exclamation("The Name field cannot be empty!");
       return;
    }
	arr.Set( int_row, 0, ~editName);
	arr.Set( int_row, 1, ~editCountry);
	arr.Set( int_row, 2, ~editBirth);
	arr.Set( int_row, 3, ~tsex);
	arr.Set( int_row, 4, ~editTitle);
	arr.Set( int_row, 5, ~editFIDEId);
	arr.Set( int_row, 6, ~editFIDERat);
	arr.Set( int_row, 7, ~editNatId);
	arr.Set( int_row, 8, ~editNatRat);
	arr.Set( int_row, 9, ~kcoeff);
	
	ActiveFocus(editName);
	MaskDefaultValue();
}
 
 
Moreover in the constructor should appear the line: 
 
    btnModify <<= THISBACK(ModifyPlayer); 
 
Luigi
		
		
		[Updated on: Mon, 01 May 2006 14:11] by Moderator Report message to a moderator  
 |  
	| 
		
	 | 
 
 
 |   
Goto Forum:
 
 Current Time: Tue Nov 04 17:04:51 CET 2025 
 Total time taken to generate the page: 0.05527 seconds 
 |