Sign in to follow this  
Followers 0
danielrlm

Tab focus

3 posts in this topic

I have a form I'm trying to use to collect First Name, Last Name, Department (Ministry), Phone and E-mail. However, I can't figure out how to allow users to tab their way through the form. No matter what I do, TAB goes from First Name to the next button. Any ideas what I'm missing?

I'm using GUI controls with a main window, and a child window with the form. The next button is in the main windows because it simply refers to a nextPage() function and does not need to change each step. I can post code if needed, but it doesn't often seem to help. :rolleyes:

Share this post


Link to post
Share on other sites



I have a form I'm trying to use to collect First Name, Last Name, Department (Ministry), Phone and E-mail. However, I can't figure out how to allow users to tab their way through the form. No matter what I do, TAB goes from First Name to the next button. Any ideas what I'm missing?

I'm using GUI controls with a main window, and a child window with the form. The next button is in the main windows because it simply refers to a nextPage() function and does not need to change each step. I can post code if needed, but it doesn't often seem to help. :rolleyes:

Post your script so we can see it and let you know what we see wrong.

Share this post


Link to post
Share on other sites

Post your script so we can see it and let you know what we see wrong.

CODE
#NoTrayIcon

#include <GUIConstants.au3>

Global $page = 1

Dim $GUI[8]

$progTitle = "Real Life Ministries Wireless Sign-up Assistant (Computer: "&@ComputerName&")"

$main_win = GUICreate($progTitle, 633, 447, 193, 115)

GUISetBkColor(0xdce6eb)

$pcgg_exit = GUICtrlCreateLabel("Exit", 600, 430, 21, 17)

GUICtrlSetColor(-1, 0xF0F0F0)

GUICtrlSetBkColor(-1, 0x8a9b3b)

; Left stripe

GUICtrlCreateGraphic(0, 140, 30, 290)

GUICtrlSetBkColor(-1, 0x749ab1)

; Right stripe

GUICtrlCreateGraphic(603, 140, 30, 290)

GUICtrlSetBkColor(-1, 0x749ab1)

; Top white

GUICtrlCreateGraphic(0, 0, 633, 140)

GUICtrlSetBkColor(-1, 0xFFFFFF)

; Top green

GUICtrlCreateGraphic(0, 140, 633, 10)

GUICtrlSetBkColor(-1, 0x8a9b3b)

; Bottom green

GUICtrlCreateGraphic(0, 427, 633, 20)

GUICtrlSetBkColor(-1, 0x8a9b3b)

$logo = GUICtrlCreatePic("images\rlm_logo.jpg", 24, 8, 194, 120, BitOR($SS_NOTIFY,$WS_GROUP))

GUICtrlCreatePic("images\wsa_title.jpg", 239, 45, 362, 17)

$next = GUICtrlCreateButton("Next >>", 550, 395)

GUISetState(@SW_SHOW, $main_win)

$GUI[1] = GUICreate("", 573, 290, 30, 140, BitOR($WS_CHILD, $WS_TABSTOP), -1, $main_win)

GUISetBkColor(0xdce6eb)

GUICtrlCreateLabel("At Real Life Ministries we believe that every resource we have has been given to us by God to use for his glory. Commercial-grade internet access is expensive, and it's important that we use the bandwidth God has given us the ability to use wisely. For that reason, we have placed certain restrictions on the use of our wireless internet. We ask that all staff and volunteers who wish to utilize Real Life Ministries wireless run this program to give us a little information:", 15, 20, 550, 80)

GUICtrlSetFont(-1, 10)

GUICtrlCreateLabel("1. Who you are", 30, 110, 450, 16)

GUICtrlSetFont(-1, 10, 600)

GUICtrlCreateLabel("2. Which ministry you work for", 30, 130, 450, 16)

GUICtrlSetFont(-1, 10, 600)

GUICtrlCreateLabel("3. Information about your computer so we can allow it access", 30, 150, 450, 16)

GUICtrlSetFont(-1, 10, 600)

GUICtrlCreateLabel("To continue with this process, please click Next.", 15, 175, 550, 16)

GUICtrlSetFont(-1, 10)

GUISetState(@SW_SHOW, $GUI[1])

$GUI[2] = GUICreate("", 573, 290, 30, 140, BitOR($WS_CHILD, $WS_TABSTOP), -1, $main_win)

GUISetBkColor(0xdce6eb)

GUICtrlCreateLabel("Please enter your contact details. We will only use this information for enabling your account on our system, and contacting you regarding your wireless access if needed.", 15, 20, 550, 40)

GUICtrlSetFont(-1, 10)

; First Name field

GUICtrlCreateLabel("First Name:", 30, 60, 80, 20)

GUICtrlSetFont(-1, 10)

$firstName = GUICtrlCreateInput("", 110, 60, 140, 20, $WS_TABSTOP)

GUICtrlSetState(-1, $GUI_FOCUS)

; Last Name field

GUICtrlCreateLabel("Last Name:", 300, 60, 80, 20)

GUICtrlSetFont(-1, 10)

$lastName = GUICtrlCreateInput("", 380, 60, 150, 20, $WS_TABSTOP)

; Ministry field

GUICtrlCreateLabel("Ministry:", 30, 85, 100, 20)

GUICtrlSetFont(-1, 10)

$ministry = GUICtrlCreateInput("", 110, 85, 240, 20, $WS_TABSTOP)

; Contact Information

GUICtrlCreateGroup("Please provide at least one contact method", 15, 115, 543, 50)

; Phone #

GUICtrlCreateLabel("Phone:", 30, 135, 80, 20)

GUICtrlSetFont(-1, 10)

$phone = GUICtrlCreateInput("", 110, 135, 140, 20, $WS_TABSTOP)

; E-mail field

GUICtrlCreateLabel("E-mail:", 300, 135, 80, 20)

GUICtrlSetFont(-1, 10)

$email = GUICtrlCreateInput("", 380, 135, 150, 20, $WS_TABSTOP)

GUICtrlCreateLabel("During the next step of this process we need to collect some information about your computer (such as MAC Address) so that our Wireless System can identify your computer and allow it access. Click Next when you're ready.", 15, 170, 550, 80)

GUICtrlSetFont(-1, 10)

GUISetState(@SW_HIDE, $GUI[2])

GUISetState(@SW_DISABLE, $GUI[2])

$GUI[3] = GUICreate("", 573, 290, 30, 140, BitOR($WS_CHILD, $WS_TABSTOP), -1, $main_win)

GUISetBkColor(0xdce6eb)

GUICtrlCreateLabel("During this step we will probe your computer for the following information:", 15, 20, 550, 20)

GUICtrlSetFont(-1, 10)

GUICtrlCreateLabel("1. The physical address (MAC) of your wireless networking card", 30, 40, 450, 16)

GUICtrlSetFont(-1, 10, 600)

GUICtrlCreateLabel("2. Basic compatibility of your computer (Operating System, Processer speed, Installed memory)", 30, 60, 450, 32)

GUICtrlSetFont(-1, 10, 600)

GUICtrlCreateLabel("Without this information we cannot grant your computer access to our wireless network. To collect the above information and continue, please click the Collect Information button below.", 15, 100, 550, 40)

GUICtrlSetFont(-1, 10)

$collectData = GUICtrlCreateButton("Collect Information", 212, 150, 150, 20)

GUISetState(@SW_HIDE, $GUI[3])

GUISetState(@SW_DISABLE, $GUI[3])

$GUI[4] = GUICreate("", 573, 290, 30, 140, BitOR($WS_CHILD, $WS_TABSTOP), -1, $main_win)

GUISetBkColor(0xdce6eb)

$cancel = GUICtrlCreateButton("Cancel", 450, 255)

GUISetState(@SW_HIDE, $GUI[4])

GUISetState(@SW_DISABLE, $GUI[4])

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

quit()

Case $msg = $pcgg_exit

quit()

Case $msg = $cancel

Local $exit = MsgBox(52, "Changes will not be saved", "If you quit now your changes will not be saved. Would you like to go back and finish the process?")

If $exit = 7 then quit()

Case $msg = $next

nextPage()

Case $msg = $collectData

collect()

Case Else

;;;

EndSelect

WEnd

Func nextPage()

GUISetState(@SW_HIDE, $GUI[$page])

GUISetState(@SW_DISABLE, $GUI[$page])

$page = $page + 1

If $page = 3 Then

newFile()

GUICtrlSetState($next, $GUI_DISABLE)

ElseIf $page = 4 Then

GUICtrlSetData($next, "Finish")

EndIf

GUISetState(@SW_ENABLE, $GUI[$page])

GUISetState(@SW_SHOW, $GUI[$page])

EndFunc

Func newFile()

$file = FileOpen(@ComputerName&"_details.txt", 2)

FileWriteLine($file, "**********************************************************")

FileWriteLine($file, "Name: "&GUICtrlRead($firstName)&" "&GUICtrlRead($lastName))

FileWriteLine($file, "Ministry: "&GUICtrlRead($ministry)&" Phone: "&GUICtrlRead($phone)&" E-mail: "&GUICtrlRead($email))

FileWriteLine($file, "**********************************************************")

FileClose($file)

EndFunc

Func collect()

GUICtrlSetState($collectData, $GUI_DISABLE)

Run("ipcUpdate.bat", @WorkingDir, @SW_HIDE)

sleep(1000)

GUICtrlSetData($collectData, "Click next to continue")

GUICtrlSetState($next, $GUI_ENABLE)

EndFunc

Func quit()

Local $exit = MsgBox(52, "Confirm Exit", "Registration is not complete. Do you really want to quit?")

If $exit = 6 then Exit

EndFunc

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