Jump to content

Need help moving from one screen to the next


Recommended Posts

I have programmed various screens below. I'm brand new to GUI's however I've been using AutoIT for awhile now. I don't even know if I have the right switches or GUI order of events. If you break up each section and run it itself it does work, but I can't link them. Please help!

What I want it to do is

Start at the What is your name screen, have the user select their name, then click next.

Then move to the what do you want to do screen, have them choose a option and click next.

Based on what they choose I want it to go to one of the three forms sections below.

My questions are:

1. How do I code it so it can go from one screen to the next using my button next?

2. How do I code it so depending on what choice you make about what you want to do it loads the proper screen?

3. How can I code it so the back button would work properly?

4. How can I code it so the cancel button does a msgbox (or a pop up) that says do you really want to exit, and makes them reconfirm?

;Switches I'm using

Opt("GUIOnEventMode", 1)

#include <GUIConstants.au3>

GUICreate("What Is Your Name?")

GUICtrlCreateCombo ("Please select your name", 10,10)

GUICtrlSetData(-1,"Person 1|Person 2|Person 3")

Opt("GUICoordMode",2)

GUICtrlCreateButton ("Next", 10, 30, 50)

GUICtrlCreateButton ( "Exit", 0, -1)

GUISetState ()

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Wend

#include <GUIConstants.au3>

GUICreate("What Would You Like To Do?")

$radio1 = GUICtrlCreateRadio ("Employee New Hire Form", 10, 10, 200, 20)

GUICtrlSetState ($radio1,$GUI_CHECKED)

$radio2 = GUICtrlCreateRadio ("Employee Transfer Form", 10, 40, 200, 20)

$radio3 = GUICtrlCreateRadio ("Employee Termination Form", 10, 70, 200, 20)

GUICtrlCreateButton ("Next", 250, 370, 50)

GUICtrlCreateButton ("Back", 300, 370, 50)

GUICtrlCreateButton ("Exit", 350, 370, 50)

GUISetState ()

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

Wend

;Input Form for Employee New Hire Form

$newusername = InputBox("Employee New Hire Form", "What is the employee's name?", "EX: Joe User", "", "*")

$newuserpositon = InputBox("Employee New Hire Form", "What is the employee's positon?", "EX: Circulation Specialist", "", "*")

$newuserstartdate = InputBox("Employee New Hire Form", "What is the employee's start date?", "EX: 02-15-10", "", "*")

$newuseraccess = InputBox("Employee New Hire Form", "What current user should they match for access level?", "EX: Jim Bookington", "", "*")

$newuserequipment = InputBox("Employee New Hire Form", "EX: Does the user need their own computer, phone, voicemail or other special hardware? (Type None if they use shared computers)", "None", "", "*")

$newuserofficelocation = InputBox("Employee New Hire Form", "What is the employee's office or desk location?", "EX: L169E or Level-2M", "", "*")

run("notepad.exe")

processexists("notepad.exe")

sleep(2000)

send("Employee New Hire Form")

send("{enter}")

send("{enter}")

send("New Username: ")

send($newusername)

send("{enter}")

send("New User Position: ")

send($newuserpositon)

send("{enter}")

send("New User Start Date: ")

send($newuserstartdate)

send("{enter}")

send("New User Acccess: ")

send($newuseraccess)

send("{enter}")

send("New User Equipment: ")

send($newuserequipment)

send("{enter}")

send("New User Office Location: ")

send($newuserofficelocation)

send("{enter}")

;Input Form For Employee Transfer Form

$transferusername = InputBox("Employee Transfer Form", "What is the employee's name?", "EX: Joe User", "", "*")

$transferuserpositon = InputBox("Employee Transfer Form", "What is the employee's positon?", "EX: Circulation Specialist", "", "*")

$transferuserstartdate = InputBox("Employee Transfer Form", "What is the employee's start date?", "EX: 02-15-10", "", "*")

$transferuseraccess = InputBox("Employee Transfer Form", "What current user should they match for access level?", "EX: Jim Bookington", "", "*")

$transferuserequipment = InputBox("Employee Transfer Form", "EX: Does the user need their own computer, phone, voicemail or other special hardware? (Type None if they use shared computers)", "None", "", "*")

$transferuserofficelocation = InputBox("Employee Transfer Form", "What is the employee's office or desk location?", "EX: L169E or Level-2M", "", "*")

run("notepad.exe")

processexists("notepad.exe")

sleep(2000)

send("Employee Transfer Form")

send("{enter}")

send("{enter}")

send("Transfer Username: ")

send($transferusername)

send("{enter}")

send("Transfer User Position: ")

send($transferuserpositon)

send("{enter}")

send("Transfer User Start Date: ")

send($transferuserstartdate)

send("{enter}")

send("Transfer User Acccess: ")

send($transferuseraccess)

send("{enter}")

send("Transfer User Equipment: ")

send($transferuserequipment)

send("{enter}")

send("Transfer User Office Location: ")

send($transferuserofficelocation)

send("{enter}")

;Input Form For Employee Termination Form

$terminateusername = InputBox("Employee Termination Form", "What is the employee's name?", "EX: Joe User", "", "*")

$terminateuserenddate = InputBox("Employee Termination Form", "What is the employee's end date?", "EX: 02-15-20", "", "*")

$terminateuseraccess = InputBox("Employee Termination Form", "EX: Does anyone need access to the terminated users account or files? (Type None if no one should be given access for now)", "None", "", "*")

$terminateuserofficelocation = InputBox("Employee Transfer Form", "What is the employee's office or desk location?", "EX: L169E or Level-2M", "", "*")

run("notepad.exe")

processexists("notepad.exe")

sleep(2000)

send("Employee Termination Form")

send("{enter}")

send("{enter}")

send("Terminated Username: ")

send($terminateusername)

send("{enter}")

send("Terminated User End Date: ")

send($terminateuserenddate)

send("{enter}")

send("Terminated User Access Transfer: ")

send($terminateuseraccess)

send("{enter}")

send("Terminated User Office Location: ")

send($terminateuserofficelocation)

send("{enter}")

Link to comment
Share on other sites

Welcome to AutoIt! :>

First, please use the [code][/code] tags around your code. When using the forum, highlight the code and then click the "<>" button.

Since you have multiple scripts, wrap them separately in the tags.

Also, once you set GuiOnEventMode = 1 the GuiGetMsg() function doesn't work anymore (always returns 0). It's an either-or choice to either use event mode or a message loop. Don't try to mix them.

:unsure:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...