Radio buttons.

Got a problem you cannot solve? Try here.
bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Radio buttons.

Postby bokkie » Mon Oct 25, 2010 3:24 am

I have a project that's based on our corporate theme. I needed a new dialog (project specific) so I made a copy of the setuptype.dfm.miaf dialog as it has some radio buttons on it. I edited the dialog and rewired the variables their output is written to and I created variables in my script. It works fine. However, I've run into a minor issue relating to the checked state of the radio buttons.

For example, let's say I have two radio buttons called A and B. In the dialog I set A's checked state to True and B's to False. As far as the dialog is concerned it correctly highlights the state of the buttons. When I build and run the project my new dialog is displayed but neither of the radio buttons is checked which sort of demerits the intended use of them. I thought that if I set A's checked state in the dialog to True it would be the one selected when the dialog is loaded? Eventually, I found that I had to set A's associated variable to True before calling the dialog. When I did that then A was correctly selected as the default.

I'm inclined to think then that the dialog's checked state is for design purposes only and that you have to set the dependent variable to True beforehand? That makes sense if I think of the variable as a two-way feed into the radio button and its runtime checked state on the way back. Could someone confirm this or issue a rebuttal to the way I think it works? :)
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP

mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: Radio buttons.

Postby mills » Mon Oct 25, 2010 1:55 pm

Yes, as it currently stands, you have observed the "correct" behavior, that the variable associated with the radio button must be set to true and the checked value is basically only valid during testing.
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.

bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Re: Radio buttons.

Postby bokkie » Mon Oct 25, 2010 3:45 pm

Thanks, Andy. Another thing comes out of this. I wanted to check the state of some values and I really wanted an IF something OR something but the IF only permits one condition. I feel a bit embarrassed to ask this but can I do more complex types of IFs that include ORs and ANDs and various bracketed conditions?

I tried searching but I can't find the answer and I've seldom ever needed to use more than one IF at a time. I guess a statement like IF A = TRUE OR B = TRUE might be possible somehow but I can't see it.

:oops:
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP

mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: Radio buttons.

Postby mills » Mon Oct 25, 2010 4:28 pm

No worries. I didn't figure out how to handle checking multiple expressions, for a long time, either. You'll want to use the Evaluate Expression command. Check the help for details and usage.
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.

bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Re: Radio buttons.

Postby bokkie » Tue Oct 26, 2010 1:18 am

Of course, I knew that all along. I was just testing to see if you knew! :D

Seriously, thanks. I'll check it out.

Edit: It works very well. The only thing that spooked me initially is that you have to double quote all constants in the expression. $X$ = "1" is legal, $X$ = 2 is not. Then again, the F1 help implies that anyway.
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 73 guests