rbhkamal Posted April 4, 2006 Posted April 4, 2006 (edited) How can I allow multiple select for radios within the same group (e.g. Selecting "short" and "long" at the same time) ? thanks Edited April 10, 2006 by rbhkamal "When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix
DaleHohm Posted April 4, 2006 Posted April 4, 2006 How can I allow multiple select for radios within the same group (e.g. Selecting "short" and "long" at the same time) ?thanksBy definition, Radios only allow a single selection in a group. You either need to use checkboxes (which allow multiple selections) instead or you need to define multiple radio groups.Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble
rbhkamal Posted April 4, 2006 Author Posted April 4, 2006 (edited) Or if I can use checkboxes instead, but with the same style. I already searched the help but the radio style for checkboxes, makes me unable to do multiple select. Thanks DaleHohm. I only need the radio style. Edited April 4, 2006 by rbhkamal "When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix
Valuater Posted April 4, 2006 Posted April 4, 2006 example expandcollapse popup#include <GUIconstants.au3> Opt("GUICoordMode", 1) GUICreate("Radio Box Grouping Demo", 400,280) ; Create the controls $button_1 = GUICtrlCreateButton ("B&utton 1", 30, 20, 120, 40) $group_1 = GUICtrlCreateGroup ("Group 1", 30, 90, 165, 160) GUIStartGroup() $radio_1 = GUICtrlCreateRadio ("Radio &0", 50, 120, 70, 20) GUIStartGroup() $radio_2 = GUICtrlCreateRadio ("Radio &1", 50, 150, 60, 20) GUIStartGroup() $radio_3 = GUICtrlCreateRadio ("Radio &2", 50, 180, 60, 20) GUIStartGroup() $radio_4 = GUICtrlCreateRadio ("Radio &A", 120, 120, 70, 20) GUIStartGroup() $radio_5 = GUICtrlCreateRadio ("Radio &B", 120, 150, 60, 20) GUIStartGroup() $radio_6 = GUICtrlCreateRadio ("Radio &C", 120, 180, 60, 20) GUIStartGroup() $input_1 = GUICtrlCreateInput ("Input 1", 200, 20, 160, 30) $input_2 = GUICtrlCreateInput ("Input 2", 200, 70, 160, 30) ; Set the defaults (radio buttons clicked, default button, etc) GUICtrlSetState($radio_1, $GUI_CHECKED) GUICtrlSetState($radio_6, $GUI_CHECKED) GUICtrlSetState($button_1, $GUI_FOCUS + $GUI_DEFBUTTON) ; Init our vars that we will use to keep track of radio events $radioval1 = 0 ; We will assume 0 = first radio button selected, 2 = last button $radioval2 = 2 GUISetState () ; In this message loop we use variables to keep track of changes to the radios, another ; way would be to use GUICtrlRead() at the end to read in the state of each control. Both ; methods are equally valid While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $button_1 MsgBox(0, "Button", "Radio " & $radioval1 & @LF & "Radio " & Chr($radioval2 + Asc("A")) & @LF & GUICtrlRead($input_1) & @LF & GUICtrlRead($input_2)) Case $msg = $radio_1 OR $msg = $radio_2 OR $msg = $radio_3 $radioval1 = $msg - $radio_1 Case $msg = $radio_4 OR $msg = $radio_5 OR $msg = $radio_6 $radioval2 = $msg - $radio_4 EndSelect WEnd 8)
CyberSlug Posted April 4, 2006 Posted April 4, 2006 Unless you go with DaleHohm's advice, you are going directly against intuitive interface design.... Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
rbhkamal Posted April 4, 2006 Author Posted April 4, 2006 Thank you all, I thought there was a simpler way (like style) to enable mutilple select. I guess I'll go with GUIStartGroup() Thanks again. "When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix
rbhkamal Posted April 6, 2006 Author Posted April 6, 2006 (edited) I guess I'll go with GUIStartGroup()Ok I used GUIStartGroup() but Im having a wearied issues with marking the radio as checked.e.g. I can uncheck but I cannot check however tabbing works and if you select one and then click on your desktop then you click back on your window again it works!!Please help me, I've been working on my script for over three month, I'm almost done I just need to finish this one.Thanks,Cool forum.Edit: OS:XPSP2 Autoit Beta V3.1.1.117Edit: Script was removed Edited April 10, 2006 by rbhkamal "When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix
rbhkamal Posted April 8, 2006 Author Posted April 8, 2006 I hope some one will give me an answer; otherwise I will have to use checkboxes (not pretty). "When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix
Valuater Posted April 8, 2006 Posted April 8, 2006 why would you want to read the checked radio.. then uncheck it??? just comment out 1 line and ... presto Func Radio_disable_enable() Local $L_GUI_READ_CTRLID = @GUI_CTRLID If guictrlread( $L_GUI_READ_CTRLID ) = $GUI_CHECKED Then ;GUICtrlSetState( $L_GUI_READ_CTRLID , $GUI_UNCHECKED ) Else GUICtrlSetState( $L_GUI_READ_CTRLID , $GUI_CHECKED ) EndIf EndFunc 8)
eviloverlord Posted April 8, 2006 Posted April 8, 2006 I hope some one will give me an answer; otherwise I will have to use checkboxes (not pretty). Why would checkboxes look worse. Surely an intuitive design would suggest that if something allows multiple selection it must use checkboxes (or a listbox).I would never expect to see a user interface where a radio group allows multiple selection. The whole difference between radio buttons and checkboxes is precisely that checkboxes allow multiple selection wheras only one radio button per group can be selected.Aside from being square rather than rounded, what's so different about checkboxes that would make your interface look bad by using them?
Valuater Posted April 8, 2006 Posted April 8, 2006 Why would checkboxes look worse. Surely an intuitive design would suggest that if something allows multiple selection it must use checkboxes (or a listbox).I would never expect to see a user interface where a radio group allows multiple selection. The whole difference between radio buttons and checkboxes is precisely that checkboxes allow multiple selection wheras only one radio button per group can be selected.Aside from being square rather than rounded, what's so different about checkboxes that would make your interface look bad by using them?actually, after looking at your script , i agree with eviloverlord8)
rbhkamal Posted April 9, 2006 Author Posted April 9, 2006 Valuater: I must allow the user to uncheck after checking (incase he or she wanted to) eviloverlord: You are right, but too many checkboxes in a small GUI ...... it looks horrible If anyone is wondering what the hell this is for: This part of my script is responsible for generating all the possible configurations for VPN sleeves. Using Autoit and CMD shell, each configuration will be tested using FTP. Thanks, "When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix
rbhkamal Posted April 10, 2006 Author Posted April 10, 2006 Never mind, I found a diffirent way to do what I want. "When the power of love overcomes the love of power, the world will know peace"-Jimi Hendrix
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now