Jump to content
Sign in to follow this  
5t0n3r

GUI Menu using hidden tabs (sharing back)

Recommended Posts

5t0n3r

Here's the code. Hope someone can find some use with what I've done so far with it.

Thanks to all who helped along the way. :D

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$gui = GUICreate("Add / Remove Employee Process", 500, 400)
$tab = GUICtrlCreateTab(-10, -22, 520, 430)

; Main Menu Page
$main1Page1 = GUICtrlCreateTabItem("mainmenu1")
$main1Btn1 = GUICtrlCreateButton("New Employee", 70, 100, 150, 60)
$main1Btn2 = GUICtrlCreateButton("Terminated Employee", 280, 100, 150, 60)
GUICtrlCreateLabel("Choose this option for the" & @CRLF & "New Employee checklist.", 70, 200)
GUICtrlCreateLabel("Choose this option for the" & @CRLF & "Terminated Employee checklist.", 280, 200)
; End Main Menu page

; New Employee Page 1
$new1Page1 = GUICtrlCreateTabItem("new_employee_p1")
$newGroup1 = GUICtrlCreateGroup("New Employee", 8, 10, 485, 354)
$new1Back1 = GUICtrlCreateButton("< Back", 260, 370, 75, 25)
$new1Next1 = GUICtrlCreateButton("Next >", 335, 370, 75, 25)
GUICtrlCreateLabel("New Employee Page 1", 100, 200)
; End New Employee Page 1

; New Employee Page 2
$new2Page1 = GUICtrlCreateTabItem("new_employee_p1")
$newGroup1 = GUICtrlCreateGroup("New Employee", 8, 10, 485, 354)
$new2Back1 = GUICtrlCreateButton("< Back", 260, 370, 75, 25)
$new2Next1 = GUICtrlCreateButton("Next >", 335, 370, 75, 25)
GUICtrlCreateLabel("New Employee Page 2", 100, 200)
; End New Employee Page 2

; New Employee Page 3
$new3Page1 = GUICtrlCreateTabItem("new_employee_p1")
$newGroup1 = GUICtrlCreateGroup("New Employee", 8, 10, 485, 354)
$new3Back1 = GUICtrlCreateButton("< Back", 260, 370, 75, 25)
$new3Next1 = GUICtrlCreateButton("Next >", 335, 370, 75, 25)
GUICtrlCreateLabel("New Employee Page 3", 100, 200)
; End New Employee Page 3

; New Employee Page 4
$new4Page1 = GUICtrlCreateTabItem("new_employee_p1")
$newGroup1 = GUICtrlCreateGroup("New Employee", 8, 10, 485, 354)
$new4Back1 = GUICtrlCreateButton("< Back", 260, 370, 75, 25)
$new4Next1 = GUICtrlCreateButton("Next >", 335, 370, 75, 25)
GUICtrlCreateLabel("New Employee Page 4", 100, 200)
; End New Employee Page 4

; New Employee Page 5
$new5Page1 = GUICtrlCreateTabItem("new_employee_p1")
$newGroup1 = GUICtrlCreateGroup("New Employee", 8, 10, 485, 354)
$new5Back1 = GUICtrlCreateButton("< Back", 260, 370, 75, 25)
$new5Next1 = GUICtrlCreateButton("Next >", 335, 370, 75, 25)
GUICtrlCreateLabel("New Employee Page 5", 100, 200)
; End New Employee Page 5

; New Employee Page 6
$new6Page1 = GUICtrlCreateTabItem("new_employee_p1")
$newGroup1 = GUICtrlCreateGroup("New Employee", 8, 10, 485, 354)
$new6Back1 = GUICtrlCreateButton("< Back", 260, 370, 75, 25)
$new6Next1 = GUICtrlCreateButton("Next >", 335, 370, 75, 25)
GUICtrlCreateLabel("New Employee Page 6", 100, 200)
; End New Employee Page 6

; New Employee Page 7
$new7Page1 = GUICtrlCreateTabItem("new_employee_p1")
$newGroup1 = GUICtrlCreateGroup("New Employee", 8, 10, 485, 354)
$new7Back1 = GUICtrlCreateButton("< Back", 260, 370, 75, 25)
$new7Next1 = GUICtrlCreateButton("Next >", 335, 370, 75, 25)
$new7Finish1 = GUICtrlCreateButton("Finish", 260, 195, 75, 25)
GUICtrlCreateLabel("New Employee Page 7", 100, 200)
; End New Employee Page 7

;==================================================================

; Terminated Employee Page 1
$ter1Page1 = GUICtrlCreateTabItem("ter_employee_page1")
$terGroup2 = GUICtrlCreateGroup("Terminated Employee", 8, 10, 485, 354)
$ter1Back1 = GUICtrlCreateButton("< Back", 260, 370, 75, 25)
$ter1Next1 = GUICtrlCreateButton("Next >", 335, 370, 75, 25)
GUICtrlCreateLabel("Terminated Employee Page 1", 100, 200)
; End Terminated Employee Page 1

; Terminated Employee Page 2
$ter2Page1 = GUICtrlCreateTabItem("ter_employee_page1")
$terGroup2 = GUICtrlCreateGroup("Terminated Employee", 8, 10, 485, 354)
$ter2Back1 = GUICtrlCreateButton("< Back", 260, 370, 75, 25)
$ter2Next1 = GUICtrlCreateButton("Next >", 335, 370, 75, 25)
GUICtrlCreateLabel("Terminated Employee Page 2", 100, 200)
; End Terminated Employee Page 2

; Terminated Employee Page 3
$ter3Page1 = GUICtrlCreateTabItem("ter_employee_page1")
$terGroup2 = GUICtrlCreateGroup("Terminated Employee", 8, 10, 485, 354)
$ter3Back1 = GUICtrlCreateButton("< Back", 260, 370, 75, 25)
$ter3Next1 = GUICtrlCreateButton("Next >", 335, 370, 75, 25)
GUICtrlCreateLabel("Terminated Employee Page 3", 100, 200)
; End Terminated Employee Page 3

; Terminated Employee Page 4
$ter4Page1 = GUICtrlCreateTabItem("ter_employee_page1")
$terGroup2 = GUICtrlCreateGroup("Terminated Employee", 8, 10, 485, 354)
$ter4Back1 = GUICtrlCreateButton("< Back", 260, 370, 75, 25)
$ter4Next1 = GUICtrlCreateButton("Next >", 335, 370, 75, 25)
GUICtrlCreateLabel("Terminated Employee Page 4", 100, 200)
; End Terminated Employee Page 4

; Terminated Employee Page 5
$ter5Page1 = GUICtrlCreateTabItem("ter_employee_page1")
$terGroup2 = GUICtrlCreateGroup("Terminated Employee", 8, 10, 485, 354)
$ter5Back1 = GUICtrlCreateButton("< Back", 260, 370, 75, 25)
$ter5Next1 = GUICtrlCreateButton("Next >", 335, 370, 75, 25)
GUICtrlCreateLabel("Terminated Employee Page 5", 100, 200)
; End Terminated Employee Page 5

; Terminated Employee Page 6
$ter6Page1 = GUICtrlCreateTabItem("ter_employee_page1")
$terGroup2 = GUICtrlCreateGroup("Terminated Employee", 8, 10, 485, 354)
$ter6Back1 = GUICtrlCreateButton("< Back", 260, 370, 75, 25)
$ter6Next1 = GUICtrlCreateButton("Next >", 335, 370, 75, 25)
GUICtrlCreateLabel("Terminated Employee Page 6", 100, 200)
; End Terminated Employee Page 6

; Terminated Employee Page 7
$ter7Page1 = GUICtrlCreateTabItem("ter_employee_page1")
$terGroup2 = GUICtrlCreateGroup("Terminated Employee", 8, 10, 485, 354)
$ter7Back1 = GUICtrlCreateButton("< Back", 260, 370, 75, 25)
$ter7Next1 = GUICtrlCreateButton("Next >", 335, 370, 75, 25)
$ter7Finish1 = GUICtrlCreateButton("Finish", 260, 195, 75, 25)
GUICtrlCreateLabel("Terminated Employee Page 7", 100, 200)
; End Terminated Employee Page 7

;==================================================================

GUICtrlCreateTabitem ("")
$cancel = GUICtrlCreateButton("Cancel", 420, 370, 75, 25)
GUICtrlSetState($main1Page1, $GUI_SHOW)
GUICtrlSetState($new7Next1, $GUI_DISABLE)
GUICtrlSetState($ter7Next1, $GUI_DISABLE)
GUISetState()

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case - 3
            $answer = MsgBox(32 + 4, "Exit Program", "Are you sure you want to EXIT the program?" & @CRLF & "All entered information will be lost.")
            Switch $answer
                Case 6; Yes
                    Exit
                Case 7; No
            EndSwitch
        Case $cancel
            $answer = MsgBox(32 + 4, "Exit Program", "Are you sure you want to EXIT the program?" & @CRLF & "All entered information will be lost.")
            Switch $answer
                Case 6; Yes
                    Exit
                Case 7; No
            EndSwitch

;==================================================================

        Case $main1Btn1
            GUICtrlSetState($new1Page1, $GUI_SHOW)
        Case $main1Btn2
            GUICtrlSetState($ter1Page1, $GUI_SHOW)


        Case $new1Back1
            GUICtrlSetState($main1Page1, $GUI_SHOW)
        Case $new1Next1
            GUICtrlSetState($new2Page1, $GUI_SHOW)
        Case $new2Back1
            GUICtrlSetState($new1Page1, $GUI_SHOW)
        Case $new2Next1
            GUICtrlSetState($new3Page1, $GUI_SHOW)
        Case $new3Back1
            GUICtrlSetState($new2Page1, $GUI_SHOW)
        Case $new3Next1
            GUICtrlSetState($new4Page1, $GUI_SHOW)
        Case $new4Back1
            GUICtrlSetState($new3Page1, $GUI_SHOW)
        Case $new4Next1
            GUICtrlSetState($new5Page1, $GUI_SHOW)
        Case $new5Back1
            GUICtrlSetState($new4Page1, $GUI_SHOW)
        Case $new5Next1
            GUICtrlSetState($new6Page1, $GUI_SHOW)
        Case $new6Back1
            GUICtrlSetState($new5Page1, $GUI_SHOW)
        Case $new6Next1
            GUICtrlSetState($new7Page1, $GUI_SHOW)
        Case $new7Back1
            GUICtrlSetState($new6Page1, $GUI_SHOW)
        Case $new7Finish1
            GUICtrlSetState($main1Page1, $GUI_SHOW)


        Case $ter1Back1
            GUICtrlSetState($main1Page1, $GUI_SHOW)
        Case $ter1Next1
            GUICtrlSetState($ter2Page1, $GUI_SHOW)
        Case $ter2Back1
            GUICtrlSetState($ter1Page1, $GUI_SHOW)
        Case $ter2Next1
            GUICtrlSetState($ter3Page1, $GUI_SHOW)
        Case $ter3Back1
            GUICtrlSetState($ter2Page1, $GUI_SHOW)
        Case $ter3Next1
            GUICtrlSetState($ter4Page1, $GUI_SHOW)
        Case $ter4Back1
            GUICtrlSetState($ter3Page1, $GUI_SHOW)
        Case $ter4Next1
            GUICtrlSetState($ter5Page1, $GUI_SHOW)
        Case $ter5Back1
            GUICtrlSetState($ter4Page1, $GUI_SHOW)
        Case $ter5Next1
            GUICtrlSetState($ter6Page1, $GUI_SHOW)
        Case $ter6Back1
            GUICtrlSetState($ter5Page1, $GUI_SHOW)
        Case $ter6Next1
            GUICtrlSetState($ter7Page1, $GUI_SHOW)
        Case $ter7Back1
            GUICtrlSetState($ter6Page1, $GUI_SHOW)
        Case $ter7Finish1
            GUICtrlSetState($main1Page1, $GUI_SHOW)

    EndSwitch
WEnd
Edited by 5t0n3r

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.