![]() |
Radio Buttons (GUI)
Can anyone show me an example of how the Radio Buttons work? (That's what they're called right? Radio Buttons? Like the buttons used at the bottom of a reply/new thread to choose the Post Icon?)
I've done a forum search--but couldn't find anything. I searched the following pages: http://wiki.graal.net/index.php/Crea..._.27weapons.27 http://wiki.graal.net/index.php/Crea.../Script/Client Also with a search of "Radio buttons", "Radio" and "Radiobuttons" on the wikipedia. I'd just like an example of how they would work, like so if you had 2 only one could be selected at a time (and what ever one is selected is read from a clientr.string). I just need the basics though, I can do the rest. |
Deal with them the same as a regular checkbox control.
Make a new GuiRadioCtrl for each button in the group. Set their 'groupnum' variables to the same values. Only one button with the same groupnum can be checked at a time. You can then read which is checked by going through each GUI and reading 'GUI.checked' |
I have no idea how to use checkboxes either. But would the GuiRadioCtrl look something like this?
PHP Code:
Edit: I've tried it and it works. Thanks for your help Yen. Also - am I right in understanding that to read it, you've said GUI.checked? Would that be like this : PHP Code:
|
Yeah that looks correct
|
I still don't know how to read if the radio button is selected or not.
Here's the radio button part. PHP Code:
Checking it, I've tried loads, but it can't read it. I have it that reading it occurs after the player pushes a Button. PHP Code:
Please tell me what it is I'm missing. |
It's 'checked' or 'selected', 'select' is not an attribute.
|
I believe I also tried those 2, but I'll try again.
*tries* Ok so I've tried every one of the following and still no luck: if ("MsgOptionsRadio_Main1".checked == "true") { if (MsgOptionsRadio_Main1.checked == "true") { if ("MsgOptionsRadio_Main1".checked == true) { if (MsgOptionsRadio_Main1.checked == true) { if (MsgOptionsRadio_Main1.selected == "true") { if ("MsgOptionsRadio_Main1.selected" == "true") { if (MsgOptionsRadio_Main1.selected == true) { if ("MsgOptionsRadio_Main1.selected" == true) { Any suggestions? |
You don't need to have the names of buttons in quotes, because it's all one word with no spaces and no mathematical symbols. 'true' is a constant defined as nonzero, and it's a keyword, so it doesn't need to be in quotes.
First off, paste the part of the script you have the part where you check the status of the radio button. Is it in a timeout loop? If not, is it in an onAction block? If not, then explain how you're doing it. |
Quote:
I don't have anything for it... but when I test the NPC and click on the radio button, it gets selected--so I assumed you didn't need anything for it. |
| All times are GMT +2. The time now is 04:58 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.