Home » Community » Newbie corner » Selected option, show which is active 
	
		
		
			| Selected option, show which is active [message #28311] | 
			Fri, 27 August 2010 01:03   | 
		 
		
			
				
				
				
					
						  
						nlneilson
						 Messages: 644 Registered: January 2010  Location: U.S. California. Mojave &...
						
					 | 
					Contributor   | 
					 | 
		 
		 
	 | 
 
	
		How can you show which option is active? 
 
It looks like there is a check box before each option, could an X be placed there? 
 
Or remove the box and have the option highlighted or bold, preferred as it takes less space? 
 
  
 
This is the code I am using:
	void SettingsMenu(Bar& bar) {
		bar.Add("m meters", THISBACK(Setm));
		bar.Add("km kilometers", THISBACK(Setkm));
		bar.Add("ft feet", THISBACK(Setft));
		bar.Add("mi miles", THISBACK(Setmi));
		bar.Add("nmi naut mi", THISBACK(Setnmi));
 
 
		
		
		[Updated on: Fri, 27 August 2010 01:11] Report message to a moderator  
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |  
	
		
		
			| Re: Selected option, show which is active [message #28328 is a reply to message #28318] | 
			Fri, 27 August 2010 21:26    | 
		 
		
			
				
				
				
					
						  
						nlneilson
						 Messages: 644 Registered: January 2010  Location: U.S. California. Mojave &...
						
					 | 
					Contributor   | 
					 | 
		 
		 
	 | 
 
	
		That puts a check mark in the box, good. 
How this is worked into the code is a problem. 
 
I searched the examples and bazarr plus don't recall anything in any documentation that covers this. 
 
	void SettingsMenu(Bar& bar) {
		bar.Add("m meters", THISBACK(Setm)).Check(true);
		bar.Add("km kilometers"THISBACK(Setkm)).Check(true);
...
...
	void Setm() {
		Distm<<=revDistance(~Distance, un);
		un = 0;	
		Cfg[0] = "0";
		units<<="m";
		Distance<<=formatDistance(s, un, dp);
	}
	void Setkm() {
		Distm<<=revDistance(~Distance, un);
		un = 1;	
		Cfg[0] = "1";
		units<<="km";
		Distance<<=formatDistance(s, un, dp);
	}
	void Setft() {
		Distm<<=revDistance(~Distance, un);
		un = 2;	
		Cfg[0] = "2";
		units<<="ft";
		Distance<<=formatDistance(s, un, dp);
	} 
 
How would you include .Check(true) in the Setft() function? 
 
Without an example I could spend a considerable amount of time tinkering.  There may be something built into U++ that helps on this, like when one is picked/checked any other option in that section is unchecked.
		
		
		
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |  
	| 
		
 |   
Goto Forum:
 
 Current Time: Tue Nov 04 06:45:12 CET 2025 
 Total time taken to generate the page: 0.09788 seconds 
 |