Sign in to follow this  
Followers 0
Reload_2006

I've got to a certain point in this script, but can't figure out this one part.

3 posts in this topic

Ok guys, I've been a long time reader and was hope you could provide me with some of your expertise. I've been messing with AutoIt for awhile now, but most of the scripts I've created in the past with AutoIt were pretty basic. This one I've beeen trying to write is a little more advanced and I think I need a little help with it. Here is the code I've got so far:

CODE

#include <GUIConstants.au3>

$PCselectGUI = GUICreate("Selection Screen", 355, 400, -1, -1)

GUISetFont(9, 300)

$tab=GUICtrlCreateTab (2,5, 350,395)

$tab0=GUICtrlCreateTabitem ("Tab 1")

GUICtrlSetState(-1,$GUI_SHOW) ; will be display first

$Pic1 = GUICtrlCreatePic("C:\Temp\pic1.jpg", 250, 40, 68, 60, BitOR($SS_NOTIFY,$WS_GROUP))

$tab0OK=GUICtrlCreateButton ("OK", 260,350,60,30)

GUICtrlCreateLabel ("Cat 1", 10,50,50,20)

GuiCtrlCreateRadio("1", 10, 80, 80)

GuiCtrlSetState(-1, $GUI_CHECKED)

GuiCtrlCreateRadio("2", 10, 105, 80)

GuiCtrlCreateRadio("3", 10, 130, 80)

GuiCtrlCreateRadio("4", 10, 155, 80)

;GUICtrlCreateGroup ("",-99,-99,1,1) ;close group

GUICtrlCreateLabel ("Cat 2", 130,50,50,20)

GuiCtrlCreateRadio("1", 130, 80, 80)

GuiCtrlCreateRadio("2", 130, 105, 80)

GuiCtrlCreateRadio("3", 130, 130, 80)

GuiCtrlCreateRadio("4", 130, 155, 80)

$tab1=GUICtrlCreateTabitem ( "Tab 2")

$Pic1 = GUICtrlCreatePic("C:\Temp\pic2.jpg", 250, 40, 68, 60, BitOR($SS_NOTIFY,$WS_GROUP))

$tab0OK=GUICtrlCreateButton ("OK", 260,350,60,30)

GUICtrlCreateLabel ("Cat 1", 10,50,50,20)

GuiCtrlCreateRadio("1", 10, 80, 80)

GuiCtrlSetState(-1, $GUI_CHECKED)

GuiCtrlCreateRadio("2", 10, 105, 80)

GuiCtrlCreateRadio("3", 10, 130, 80)

GuiCtrlCreateRadio("4", 10, 155, 80)

GuiCtrlCreateRadio("5", 10, 180, 80)

GuiCtrlCreateRadio("6", 10, 205, 80)

GuiCtrlCreateRadio("7", 10, 230, 80)

;GUICtrlCreateGroup ("",-99,-99,1,1) ;close group

$tab1=GUICtrlCreateTabitem ( "Tab 3")

$Pic1 = GUICtrlCreatePic("C:\Temp\pic3.jpg", 250, 40, 68, 60, BitOR($SS_NOTIFY,$WS_GROUP))

$tab0OK=GUICtrlCreateButton ("OK", 260,350,60,30)

GUICtrlCreateLabel ("Cat 1", 10,50,50,20)

GuiCtrlCreateRadio("1", 10, 80, 80)

GuiCtrlSetState(-1, $GUI_CHECKED)

GUICtrlCreateTabitem ("") ; end tabitem definition

;GUICtrlCreateLabel ("label3", 20,130,50,20)

GUISetState ()

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Wend

What I'm looking to do with this script is have it run certain executables depending on the selection you make. I only want it to execute one selection at a time. For instance, if I were to select Tab 1 Category 2 and hit OK, I want it to only run executables that I've specified for that one particular radio button. And I only want to execute one radio button at a time. Once I hit OK, I also want the gui to close. So far what I've got is the interface, but I have no idea how to set it up to run executable for a radio button seclected.

Any help would be GREATLY appreciated.

Share this post


Link to post
Share on other sites



HI,

select cat 1 Radio 4 and hit ok

#include <GUIConstants.au3>

$PCselectGUI = GUICreate("Selection Screen", 355, 400, -1, -1)

GUISetFont(9, 300)

$tab=GUICtrlCreateTab (2,5, 350,395)

$tab0=GUICtrlCreateTabitem ("Tab 1")
GUICtrlSetState(-1,$GUI_SHOW) ; will be display first
$Pic1 = GUICtrlCreatePic("C:\Temp\pic1.jpg", 250, 40, 68, 60, BitOR($SS_NOTIFY,$WS_GROUP))
$tab0OK1=GUICtrlCreateButton ("OK", 260,350,60,30)
GUICtrlCreateLabel ("Cat 1", 10,50,50,20)
GuiCtrlCreateRadio("1", 10, 80, 80)
GuiCtrlSetState(-1, $GUI_CHECKED)
GuiCtrlCreateRadio("2", 10, 105, 80)
GuiCtrlCreateRadio("3", 10, 130, 80)
$4 = GuiCtrlCreateRadio("4", 10, 155, 80)
;GUICtrlCreateGroup ("",-99,-99,1,1) ;close group
GUICtrlCreateLabel ("Cat 2", 130,50,50,20)
GuiCtrlCreateRadio("1", 130, 80, 80)
GuiCtrlCreateRadio("2", 130, 105, 80)
GuiCtrlCreateRadio("3", 130, 130, 80)
GuiCtrlCreateRadio("4", 130, 155, 80)

$tab1=GUICtrlCreateTabitem ( "Tab 2")
$Pic1 = GUICtrlCreatePic("C:\Temp\pic2.jpg", 250, 40, 68, 60, BitOR($SS_NOTIFY,$WS_GROUP))
$tab0OK=GUICtrlCreateButton ("OK", 260,350,60,30)
GUICtrlCreateLabel ("Cat 1", 10,50,50,20)
GuiCtrlCreateRadio("1", 10, 80, 80)
GuiCtrlSetState(-1, $GUI_CHECKED)
GuiCtrlCreateRadio("2", 10, 105, 80)
GuiCtrlCreateRadio("3", 10, 130, 80)
GuiCtrlCreateRadio("4", 10, 155, 80)
GuiCtrlCreateRadio("5", 10, 180, 80)
GuiCtrlCreateRadio("6", 10, 205, 80)
GuiCtrlCreateRadio("7", 10, 230, 80)
;GUICtrlCreateGroup ("",-99,-99,1,1) ;close group

$tab1=GUICtrlCreateTabitem ( "Tab 3")
$Pic1 = GUICtrlCreatePic("C:\Temp\pic3.jpg", 250, 40, 68, 60, BitOR($SS_NOTIFY,$WS_GROUP))
$tab0OK=GUICtrlCreateButton ("OK", 260,350,60,30)
GUICtrlCreateLabel ("Cat 1", 10,50,50,20)
GuiCtrlCreateRadio("1", 10, 80, 80)
GuiCtrlSetState(-1, $GUI_CHECKED)

GUICtrlCreateTabitem ("") ; end tabitem definition

;GUICtrlCreateLabel ("label3", 20,130,50,20)

GUISetState ()

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
Select
    Case $msg = $GUI_EVENT_CLOSE 
        ExitLoop
    Case $msg = $tab0OK1 
    If GUICtrlRead($4) = $GUI_CHECKED Then
        Run("notepad.exe")
    EndIf
    EndSelect
Wend

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

You're awesome Mega!! Thanks alot!!

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  
Followers 0