Radio buttons.
Posted: 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?
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?
