Jump to content

Help for Radio Buttons


Recommended Posts

I'm used last beta.

Can someone told me why when I select one of the radio buttons left, the two others (middle) becomes unchecked ???

If you begin with the middle buttons it is the same (left radios become unchecked)

Is it my mystake or something wrong with GuiCtrlCreateRadio ?

Here under is my code.

Thanks for your help

#include <GUIConstants.au3>

; #include <GuiSlider.au3>

; opt('MustDeclareVars', 1)

Dim $radio[5]

$gui=GUICreate("TEST", 500,500,-1,-1,-1,-1) ; Create TEST Windows

GUISetBkColor (0x1060FF)

$background = GUICtrlCreatePic ("c:\abcde\fondfamily2ml.jpg",-1,-1,500,400) ; Set Background Picture

GUICtrlCreateLabel ("Mode",5,405)

$ModePro = GUICtrlCreateRadio ("Pro", 50, 403, 60, 20)

$ModeDeb = GUICtrlCreateRadio ("Débutant", 50, 418, 60, 20)

GUICtrlSetState ($ModeDeb, $GUI_CHECKED)

GUICtrlCreateLabel ("Envoi IR",200,403)

$IrAuto = GUICtrlCreateRadio ("Full Auto", 250, 403, 80, 20)

$IrManuel = GUICtrlCreateRadio ("Après Confirm", 250, 418, 80, 20)

GUICtrlSetState ($IrAuto, $GUI_CHECKED)

;GUISetState(@SW_MINIMIZE)

;GUISetState($GUI_CHECKED)

GUISetState () ; will display an dialog box with 1 checkbox

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case $msg = $ModePro And BitAND(GUICtrlRead($ModePro), $GUI_CHECKED) = $GUI_CHECKED

MsgBox(48, 'Consigne IMPORTANTE', 'Veuillez svp réinitialiser (éteindre puis rallumer) et ensuite ne plus entrer dans le menu')

$Radio[1]=1

$Radio[2]=0

Case $msg = $ModeDeb And BitAND(GUICtrlRead($ModeDeb), $GUI_CHECKED) = $GUI_CHECKED

MsgBox(64, 'Information', 'Vous avez sélectionné le Mode Débutant')

$Radio[2]=1

$Radio[1]=0

Case $msg = $IrAuto And BitAND(GUICtrlRead($IrAuto), $GUI_CHECKED) = $GUI_CHECKED

MsgBox(48, 'Information', 'Vous avez sélectionné le Mode Full Automatique')

$Radio[3]=1

$Radio[4]=0

Case $msg = $IrManuel And BitAND(GUICtrlRead($IrManuel), $GUI_CHECKED) = $GUI_CHECKED

MsgBox(64, 'Information', 'Vous avez sélectionné le Mode Manuel')

$Radio[4]=1

$Radio[3]=0

EndSelect

Wend

GUISetState(@SW_SHOW)

Exit

Link to comment
Share on other sites

Apparently the controls are grouped by default, to create seperate groups use GUIStartGroup

#include <GuiConstants.au3>
#include <GuiSlider.au3>
;~ opt('MustDeclareVars', 1)

Dim $radio[5]

$gui = GUICreate("TEST", 500, 500, -1, -1, -1, -1) ; Create TEST Windows

GUISetBkColor(0x1060FF)

$background = GUICtrlCreatePic("c:\abcde\fondfamily2ml.jpg", -1, -1, 500, 400) ; Set Background Picture


GUICtrlCreateLabel("Mode", 5, 405)
GUIStartGroup()
$ModePro = GUICtrlCreateRadio("Pro", 50, 403, 60, 20)
$ModeDeb = GUICtrlCreateRadio("Débutant", 50, 418, 60, 20)
GUICtrlSetState($ModeDeb, $GUI_CHECKED)

GUICtrlCreateLabel("Envoi IR", 200, 403)
GUIStartGroup()
$IrAuto = GUICtrlCreateRadio("Full Auto", 250, 403, 80, 20)
$IrManuel = GUICtrlCreateRadio("Après Confirm", 250, 418, 80, 20)
GUICtrlSetState($IrAuto, $GUI_CHECKED)




;GUISetState(@SW_MINIMIZE)
;GUISetState($GUI_CHECKED)
GUISetState() ; will display an dialog box with 1 checkbox

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
            
            
        Case $msg = $ModePro And BitAND(GUICtrlRead($ModePro), $GUI_CHECKED) = $GUI_CHECKED
            MsgBox(48, 'Consigne IMPORTANTE', 'Veuillez svp réinitialiser (éteindre puis rallumer) et ensuite ne plus entrer dans le menu')
            $radio[1] = 1
            $radio[2] = 0
            
        Case $msg = $ModeDeb And BitAND(GUICtrlRead($ModeDeb), $GUI_CHECKED) = $GUI_CHECKED
            MsgBox(64, 'Information', 'Vous avez sélectionné le Mode Débutant')
            $radio[2] = 1
            $radio[1] = 0
            
        Case $msg = $IrAuto And BitAND(GUICtrlRead($IrAuto), $GUI_CHECKED) = $GUI_CHECKED
            MsgBox(48, 'Information', 'Vous avez sélectionné le Mode Full Automatique')
            $radio[3] = 1
            $radio[4] = 0
            
        Case $msg = $IrManuel And BitAND(GUICtrlRead($IrManuel), $GUI_CHECKED) = $GUI_CHECKED
            MsgBox(64, 'Information', 'Vous avez sélectionné le Mode Manuel')
            $radio[4] = 1
            $radio[3] = 0
            
    EndSelect
    
    
    
WEnd


GUISetState(@SW_SHOW)
Exit

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...