PDA

View Full Version : Stylizing radiobutton to look like a button


guyr
12-31-2007, 07:57 PM
I currently have 3 radiobuttons in a radiogroup, and they are doing their assigned job. However, I've been asked to replace them with "buttons", with the appropriate text placed on the button. I've also been asked to have the button show as pressed persistently once it has been pressed; that is, it should continue to show pressed until a different button is pressed. The pressed button identifies the data content of a complex widget next to the buttons.

After mulling this over, what they are asking for is radiobutton behavior superimposed on button visuals. Theoretically, it should be possible to replace the visuals of any component without having to rewrite the component, but I believe inherent in the radiobutton implementation is that some visual element indicates selected or unselected, and the text describing that element is next to it. So I'm violating that basic assumption.

Has anyone done this already? I realize the potential visual abiguity; how would I distinguish real buttons from these radiobuttons that look like buttons? In the main window of this app, there are no buttons other than these 3, so that ambiguity doesn't exist.

Thanks.

rcyeager
02-13-2008, 07:18 PM
Seems silly, but I've had worse requirements.

All you should have to do is to replace the radio button resources. You don't have to subclass...frequently all I do is re-declare the same resource names with my custom graphics. The compiler uses the last named resources when resources with the same name exist. Just include your custom resources last.

Robert
http://www.qrowd.com
http://www.cooqy.com