Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » ArrayCtrl with enabled/Disabled columns  
	
		
		
			| ArrayCtrl with enabled/Disabled columns [message #3042] | 
			Fri, 05 May 2006 07:09   | 
		 
		
			
				
				
				
					
						  
						lundman
						 Messages: 175 Registered: March 2006  Location: Tokyo
						
					 | 
					Experienced Member  | 
					 | 
		 
		 
	 | 
 
	
		I have an ArrayCtrl with 7 elements, like that of the output of 
"ls": 
 
index, name, user, group, size, date, perm 
 
The first is an Index, and is not viewed. Next I thought it would be nice if the user could chose which fields are used. To avoid having to store which column is what in my code, I went down the route where I always add 7 elements, but turned them off or on depending on user selected options. 
 
However, I could see no apparent way to just enable or disable a column. (is that the case? HeaderObject().HideTab(int) did nothing for me). 
 
So, instead I went down the road where I either AddColumn(), or AddIndex() based on whether or not it is enabled. 
 
This appears to work ok, except when I call .Reset() and re-add the Columns/Indeces. I lose the User set Width.  
 
It would appear that I have a ColumnsWidths(char *) function to set them, but I am unsure how to get what they are. HeaderObject().GetTabWidth() seems to give me the default/initial width, not the current width. 
 
On the other hand, Serialize() appears to work fine, but it works with streams. But perhaps that is the proper path? (Do I really need to open a stream just to save the widths?) 
 
		
		
		
 |  
	| 
		
	 | 
 
 
 |  
  
 
Goto Forum:
 
 Current Time: Tue Nov 04 13:23:51 CET 2025 
 Total time taken to generate the page: 0.05699 seconds 
 |