View Single Post
  #7   Spotlight this post!  
Unread Today, 00:41
bob.wolff68's Avatar
bob.wolff68 bob.wolff68 is offline
Da' Mentor Man
FRC #1967
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2007
Location: United States
Posts: 162
bob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nice
Re: Smart Dashboard Sendable

You're really close to the right solution. Yes - you can use integers instead of Command* ... but SendableChooser (despite it being a templated class) doesn't like <int> as a type to use. Sigh. Dunno why. However, you can use an <int*> instead.
Code:
SendableChooser<int*> snd;
int auto1;
int auto2;
snd.AddDefault("default", &auto1);
snd.AddObject("Second", &auto2);
.....
// Later make the comparison
if (snd.GetSelected() == &auto1) // default one was chosen...
It's a matter of comparing the addresses of the choices since the SendableChooser template really wants to operate on pointers for some reason. Haven't looked at their code to figure why.
__________________
~~~~~~~~~~~~~~~~~~~
Bob Wolff - Software from the old-school
Mentor / C / C++ guy
Team 1967 - The Janksters - San Jose, CA
Reply With Quote