Sign in to follow this  
Followers 0
5t0n3r

Multi-Page Checklist

3 posts in this topic

I need help making a multiplge checklist with buttons to launch applications if the correct option is selected.

I have tried about 10 times to make one on my own and haven't had much luck.

It needs to have two main buttons, "New Hire" and "Termination".

Depending on which one is pressed, it'll come to the first screen and have a place to put the persons name, address and other contact info. The susequest pages will have 2 radio buttons, one for Yes and one for No. When Yes is selected, it will enable a Run Program button to launch some application. If no is selected the button stays greyed out and a small text field appears for input. Clicking next goes to the next checklist item after it checks to make sure you have selected on of the options already.

It also needs to e-mail or write to a file the information you selected and entered withing the document.

Any help would be appreciated.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=I:\Scripts\koda_menu.kxf
$AHC = GUICreate("New Hire - Termination Checklist", 511, 263, 255, 166)
$Group1 = GUICtrlCreateGroup("Confidential - Systems Internal Use ONLY!", 16, 16, 481, 209)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
$label_AHC = GUICtrlCreateLabel("Choose how to Proceed", 59, 64, 234, 34)
$newhire = GUICtrlCreateButton("New Hire", 104, 128, 121, 55, $WS_GROUP)
GUICtrlSetFont(-1, 12, 800, 0, "Arial")
GUICtrlSetCursor (-1, 0)
$termination = GUICtrlCreateButton("Termination", 288, 128, 121, 55, $WS_GROUP)
GUICtrlSetFont(-1, 12, 800, 0, "Arial")
GUICtrlSetCursor (-1, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$next = GUICtrlCreateButton("Next >", 416, 232, 81, 25, $WS_GROUP)
GUICtrlSetState(-1, $GUI_HIDE)
$back = GUICtrlCreateButton("< Back", 330, 232, 81, 25, $WS_GROUP)
GUICtrlSetState(-1, $GUI_HIDE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $newhire
            If GUICtrlRead($label_AHC) = "Choose how to Proceed" Then
                GUICtrlSetData($Group1, "New Hire - Screen 2")
                GUICtrlSetData($label_AHC, "newhire")
                GUICtrlSetData($newhire, "New Hire")
                GUICtrlSetState($back, $GUI_HIDE)
                GUICtrlSetState($next, $GUI_SHOW)
                GUICtrlSetState($newhire, $GUI_HIDE)
                GUICtrlSetState($termination, $GUI_HIDE)

            ElseIf GUICtrlRead($label_AHC) = "newhire" Then
                GUICtrlSetData($Group1, "Learning AutoIT - Screen 3")
                GUICtrlSetData($label_AHC, "Test3")
            EndIf
        Case $termination
            If GUICtrlRead($label_AHC) = "Choose how to Proceed" Then
                GUICtrlSetData($Group1, "Termination - Screen 2")
                GUICtrlSetData($label_AHC, "termination2")
                GUICtrlSetData($termination, "Termination")
                GUICtrlSetState($back, $GUI_HIDE)
                GUICtrlSetState($next, $GUI_SHOW)
                GUICtrlSetState($newhire, $GUI_HIDE)
                GUICtrlSetState($termination, $GUI_HIDE)

            ElseIf GUICtrlRead($Group1) = "Termination - Screen 2" Then
                GUICtrlSetData($Group1, "Termination - Screen 3")
                GUICtrlSetData($label_AHC, "Test3")
            EndIf
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

One easy way to have different pages display is to create each page as required with a set of controls for each page and make the page appear or hide instead of making various individual controls appear or hide.

The easiest way to have different pages display is with a tab control, but you don't need to have the tabs showing.

Here is an example.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$gui = GUICreate("tabs for page options", 500, 400)
$tab = GUICtrlCreateTab(-10, -22, 520, 430)
$tabpage1 = GUICtrlCreateTabItem("page1")
$tab1Btn1 = GUICtrlCreateButton("go to page 2", 60, 60, 100, 30)
$tab1Btn2 = GUICtrlCreateButton("go to page 3", 60, 120, 100, 30)
GUICtrlCreateLabel("This is page 1", 100, 200)
$tabpage2 = GUICtrlCreateTabItem("page2")
$tab2Btn1 = GUICtrlCreateButton("go to page 1", 60, 60, 100, 30)
$tab2Btn2 = GUICtrlCreateButton("go to page 4", 60, 120, 100, 30)
GUICtrlCreateLabel("This is page 2", 100, 220)
$tabpage3 = GUICtrlCreateTabItem("page3")
$tab3Btn1 = GUICtrlCreateButton("go to page 2", 60, 60, 100, 30)
$tab3Btn2 = GUICtrlCreateButton("go to page 4", 60, 120, 100, 30)
GUICtrlCreateLabel("This is page 3", 100, 240)
$tabpage4 = GUICtrlCreateTabItem("page4")
$tab4Btn1 = GUICtrlCreateButton("go to page 1", 60, 60, 100, 30)
$tab4Btn2 = GUICtrlCreateButton("go to page 3", 60, 120, 100, 30)
GUICtrlCreateLabel("This is page 4", 100, 260)
GUICtrlCreateTabItem("")
GUICtrlSetState($tabpage1, $GUI_SHOW)
GUISetState()

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case - 3
            Exit
        Case $tab1Btn1
            GUICtrlSetState($tabpage2, $GUI_SHOW)
        Case $tab1Btn2
            GUICtrlSetState($tabpage3, $GUI_SHOW)
        Case $tab2Btn1
            GUICtrlSetState($tabpage1, $GUI_SHOW)
        Case $tab2Btn2
            GUICtrlSetState($tabpage4, $GUI_SHOW)
        Case $tab3Btn1
            GUICtrlSetState($tabpage2, $GUI_SHOW)
        Case $tab3Btn2
            GUICtrlSetState($tabpage4, $GUI_SHOW)
        Case $tab4Btn1
            GUICtrlSetState($tabpage1, $GUI_SHOW)
        Case $tab4Btn2
            GUICtrlSetState($tabpage3, $GUI_SHOW)

    EndSwitch

WEnd
Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

This is perfect. Thank you VERY much!

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