Jump to content
Sign in to follow this  
firestrife23

little help with checkbox thingy

Recommended Posts

firestrife23

I'm new to autoit scripting, and i'm picking up pace quite well, so easy to learn! however how do I restrict to only one check box may be selected, I don't want novice to pick out more than 1 and screw up whole process you know. Here's portion of codes I did so far...

#include <GUIConstants.au3>
GUICreate("Addons Packages Flavors", 300, 125)
$LABEL = GUICtrlCreateLabel("Please choose one flavor", 10, 10, 150, 20)
$CHECK = GUICtrlCreateCheckbox(" Advanced", 10, 30, 120, 20)
$CHECK1 = GUICtrlCreateCheckbox(" Basic", 10, 50, 120, 20)
$CHECK2 = GUICtrlCreateCheckbox(" Guild Mandatory Files", 10, 70, 120, 20)

$DONE = GUICtrlCreateButton("Install", 200, 60, 60, 25)
GUISetState()
While 1
    $MSG = GUIGetMsg()
    $READ2 = GUICtrlRead($CHECK)
    $READ3 = GUICtrlRead($CHECK1)
    $READ4 = GUICtrlRead($CHECK2)
  
    If $MSG = $DONE Then
        If $READ2 = $GUI_CHECKED Then
            ProgressSet(20 , "20 Precent", "Downloading Addons...")
            ShellExecuteWait( "wget", "--directory-prefix=download -N -i alist.txt", @ScriptDir, "", @SW_HIDE)
        ElseIf $READ3 = $GUI_CHECKED Then
            ProgressSet(20 , "20 Precent", "Downloading Addons...")
            ShellExecuteWait( "wget", "--directory-prefix=download -N -i blist.txt", @ScriptDir, "", @SW_HIDE)
        ElseIf $READ4 = $GUI_CHECKED Then
            ProgressSet(20 , "20 Precent", "Downloading Addons...")
            ShellExecuteWait( "wget", "--directory-prefix=download -N -i glist.txt", @ScriptDir, "", @SW_HIDE)
        EndIf
    EndIf
    If $MSG = $GUI_EVENT_CLOSE Then ExitLoop
WEnd

Share this post


Link to post
Share on other sites
DW1

Use a radio instead of a checkbox,

#include <GUIConstants.au3>
GUICreate("Addons Packages Flavors", 300, 125)
$LABEL = GUICtrlCreateLabel("Please choose one flavor", 10, 10, 150, 20)
$CHECK = GUICtrlCreateRadio(" Advanced", 10, 30, 120, 20)
$CHECK1 = GUICtrlCreateRadio(" Basic", 10, 50, 120, 20)
$CHECK2 = GUICtrlCreateRadio(" Guild Mandatory Files", 10, 70, 120, 20)

$DONE = GUICtrlCreateButton("Install", 200, 60, 60, 25)
GUISetState()
While 1
    $MSG = GUIGetMsg()
    $READ2 = GUICtrlRead($CHECK)
    $READ3 = GUICtrlRead($CHECK1)
    $READ4 = GUICtrlRead($CHECK2)
  
    If $MSG = $DONE Then
        If $READ2 = $GUI_CHECKED Then
            ProgressSet(20 , "20 Precent", "Downloading Addons...")
            ShellExecuteWait( "wget", "--directory-prefix=download -N -i alist.txt", @ScriptDir, "", @SW_HIDE)
        ElseIf $READ3 = $GUI_CHECKED Then
            ProgressSet(20 , "20 Precent", "Downloading Addons...")
            ShellExecuteWait( "wget", "--directory-prefix=download -N -i blist.txt", @ScriptDir, "", @SW_HIDE)
        ElseIf $READ4 = $GUI_CHECKED Then
            ProgressSet(20 , "20 Precent", "Downloading Addons...")
            ShellExecuteWait( "wget", "--directory-prefix=download -N -i glist.txt", @ScriptDir, "", @SW_HIDE)
        EndIf
    EndIf
    If $MSG = $GUI_EVENT_CLOSE Then ExitLoop
WEnd

Share this post


Link to post
Share on other sites
firestrife23

you rock! thx!

Edit: how do i make it disappear after clicking "install" button?

Edited by firestrife23

Share this post


Link to post
Share on other sites
d4rk

GUICtrlSetState($CHECK,$GUI_HIDE)


[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Share this post


Link to post
Share on other sites
firestrife23

GUICtrlSetState($CHECK,$GUI_HIDE)

that work, thx again

Share this post


Link to post
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
Sign in to follow this  

×