


this script is designed to be an end all be all for staff and student account creation, deletion, and moving within our school district. It does it's job amazingly well. However some new requirements means I need to modify some fields and change/extend the GUI a little bit and I figured now might be a good time to approach the layout entirely.
The way the GUI is setup is a tabbed menu within a tabbed menu. the "student, staff" is the parent gui and the "move, delete, create" is a child gui of the parent. This was my first real attempt at making something more than just a script so I realize it might not be the most elegant.
However I am wondering if anyone has any better suggestions for a simple layout GUI that will allow easy access to all 6 options for an account staff add delete move, student add delete move, while also being intuitive and maybe a little easier to work with the GUI code on the back end. The parent child gui stuff was kind of hard to learn and isn't real flexible.
Without giving too much away for our internal stuff here is the GUI portion of the script to give everyone an idea as to what is going on behind the scenes.
Func _GUI() Global $vMainGUI = GUICreate("ADAM " & $sVersion, 285, 310) ; will create a dialog box that when displayed is centered Global $vStaffGUI = GUICreate("", 280, 265, 2, 21, $WS_CHILD, $WS_EX_CONTROLPARENT, $vMainGUI) Global $vStaffTab = GUICtrlCreateTab(0, 0, 280, 265) ; left and right are child tab border ; Create staff tab Global $vCreateStaffChildTab = GUICtrlCreateTabItem("Create Staff") GUICtrlCreateLabel("First Name :", 25, 38, 65, 20, $SS_RIGHT) ; left, top, width, height $aVar[0][0] = GUICtrlCreateInput("", 100, 36, 135, 20) GUICtrlCreateLabel("Last Name :", 25, 63, 65, 20, $SS_RIGHT) ; left, top, width, height $aVar[1][0] = GUICtrlCreateInput("", 100, 61, 135, 20) GUICtrlCreateLabel("Staff ID :", 25, 89, 65, 20, $SS_RIGHT) ; left, top, width, height $aVar[2][0] = GUICtrlCreateInput("", 100, 86, 135, 20) GUICtrlCreateLabel("Location :", 25, 114, 65, 20, $SS_RIGHT) ; left, top, width, height $aVar[3][0] = GUICtrlCreateCombo("", 100, 111, 135, 18, $CBS_DROPDOWNLIST) GUICtrlSetData(-1, "schools") GUICtrlCreateLabel("Job Title :", 25, 139, 65, 20, $SS_RIGHT) ; left,x top, width, height $aVar[4][0] = GUICtrlCreateCombo("", 100, 137, 135, 20, $CBS_DROPDOWNLIST) GUICtrlSetData(-1, "Administrative Assistant|Assistant Principal|Bus Driver|Bus Monitor|Campus Support|Counselor|Custom|Director|Food Service|Librarian|Maintenance|Nurse|Office Manager|Principal|Psychologist|Resource Officer|SPED Teacher|SPED Teachers Aide|Teacher|Teachers Aide") ; job titles GUICtrlCreateLabel("Classification :", 20, 164, 70, 20, $SS_RIGHT) ; left, top, width, height $aVar[5][0] = GUICtrlCreateCombo("", 100, 162, 135, 20, $CBS_DROPDOWNLIST) GUICtrlSetData(-1, "Certified (T)|Classified ©") ; Create buttons Global $vCreateStaff = GUICtrlCreateButton("&Create", 25, 225, 95, 25) Global $vCreateStaffDummy = GUICtrlCreateDummy() Global $vReset1 = GUICtrlCreateButton("&Reset", 155, 225, 95, 25) ; Delete staff tab Global $vDeleteStaffChildTab = GUICtrlCreateTabItem("Delete Staff") GUICtrlCreateLabel("Username :", 25, 38, 65, 20, $SS_RIGHT) ; left, top, width, height $aVar[6][0] = GUICtrlCreateInput("", 100, 36, 135, 20) ; Delete buttons Global $vDeleteStaff = GUICtrlCreateButton("&Delete", 25, 225, 95, 25) Global $vDeleteStaffDummy = GUICtrlCreateDummy() Global $vReset2 = GUICtrlCreateButton("&Reset", 155, 225, 95, 25) ; Move staff tab Global $vMoveStaffChildTab = GUICtrlCreateTabItem("Move Staff") GUICtrlCreateLabel("Username :", 25, 38, 65, 20, $SS_RIGHT) ; left, top, width, height $aVar[7][0] = GUICtrlCreateInput("", 100, 36, 135, 20) GUICtrlCreateLabel("New Location :", 15, 63, 75, 20, $SS_RIGHT) ; left, top, width, height $aVar[8][0] = GUICtrlCreateCombo("", 100, 61, 135, 18, $CBS_DROPDOWNLIST) GUICtrlSetData(-1, "Places") ; Move buttons Global $vMoveStaff = GUICtrlCreateButton("&Move", 25, 225, 95, 25) Global $vMoveStaffDummy = GUICtrlCreateDummy() Global $vReset3 = GUICtrlCreateButton("&Reset", 155, 225, 95, 25) GUICtrlCreateTabItem("") ; end of tabitem definition Global $vStudentGUI = GUICreate("", 280, 265, 2, 21, $WS_CHILD, $WS_EX_CONTROLPARENT, $vMainGUI) ; left and right are for child tabs Global $vStudentTab = GUICtrlCreateTab(0, 0, 280, 265) ; left and right are child tab border ; Create student tab GUICtrlCreateTabItem("Create Student") GUICtrlCreateLabel("First Name :", 25, 38, 65, 20, $SS_RIGHT) ; left, top, width, height $aVar[9][0] = GUICtrlCreateInput("", 100, 36, 135, 20) GUICtrlCreateLabel("Last Name :", 25, 63, 65, 20, $SS_RIGHT) ; left, top, width, height $aVar[10][0] = GUICtrlCreateInput("", 100, 61, 135, 20) GUICtrlCreateLabel("Student ID :", 25, 89, 65, 20, $SS_RIGHT) ; left, top, width, height $aVar[11][0] = GUICtrlCreateInput("", 100, 86, 135, 20) GUICtrlCreateLabel("Location :", 25, 114, 65, 20, $SS_RIGHT) ; left, top, width, height $aVar[12][0] = GUICtrlCreateCombo("", 100, 111, 135, 18, $CBS_DROPDOWNLIST) GUICtrlSetData(-1, "Schools") GUICtrlCreateLabel("Accounts should only be created for students in 2nd grade or above.", 45, 150, 195, 50, $SS_CENTER) ; Create buttons Global $vCreateStudent = GUICtrlCreateButton("&Create", 25, 225, 95, 25) Global $vCreateStudentDummy = GUICtrlCreateDummy() Global $vReset4 = GUICtrlCreateButton("&Reset", 155, 225, 95, 25) ; Delete student tab GUICtrlCreateTabItem("Delete Student") GUICtrlCreateLabel("Username :", 25, 38, 65, 20, $SS_RIGHT) ; left, top, width, height $aVar[13][0] = GUICtrlCreateInput("", 100, 36, 135, 20) ; Delete buttons Global $vDeleteStudent = GUICtrlCreateButton("&Delete", 25, 225, 95, 25) Global $vDeleteStudentDummy = GUICtrlCreateDummy() Global $vReset5 = GUICtrlCreateButton("&Reset", 155, 225, 95, 25) ; Move student tab Global $vMoveStudent = GUICtrlCreateTabItem("Move Student") GUICtrlCreateLabel("Username :", 25, 38, 65, 20, $SS_RIGHT) ; left, top, width, height $aVar[14][0] = GUICtrlCreateInput("", 100, 36, 135, 20) GUICtrlCreateLabel("New Location :", 15, 63, 75, 20, $SS_RIGHT) ; left, top, width, height $aVar[15][0] = GUICtrlCreateCombo("", 100, 61, 135, 18, $CBS_DROPDOWNLIST) GUICtrlSetData(-1, "schools") ; Move buttons Global $vMoveStudent = GUICtrlCreateButton("&Move", 25, 225, 95, 25) Global $vMoveStudentDummy = GUICtrlCreateDummy() Global $vReset6 = GUICtrlCreateButton("&Reset", 155, 225, 95, 25) GUICtrlCreateTabItem("") ; end of tabitem definition GUISwitch($vMainGUI) Global $vTab = GUICtrlCreateTab(0, 0, 285, 290) ; main tab Global $vTab0 = GUICtrlCreateTabItem("Staff Account") ; primary staff tab Global $vTab1 = GUICtrlCreateTabItem("Student Account") ; primary student tab GUICtrlCreateTabItem("") ; end tabitem definition ; System menu $vFileMenu = GUICtrlCreateMenu("File") $vBulkMenu = GUICtrlCreateMenu("Bulk Functions", $vFileMenu, 1) $vBulkStaffMenu = GUICtrlCreateMenu("Staff", $vBulkMenu) Global $vBulkCreateStaff = GUICtrlCreateMenuItem("Create", $vBulkStaffMenu) Global $vBulkDeleteStaff = GUICtrlCreateMenuItem("Delete", $vBulkStaffMenu) Global $vBulkMoveStaff = GUICtrlCreateMenuItem("Move", $vBulkStaffMenu) Global $vBulkStudentMenu = GUICtrlCreateMenu("Student", $vBulkMenu) Global $vBulkCreateStudent = GUICtrlCreateMenuItem("Create", $vBulkStudentMenu) Global $vBulkDeleteStudent = GUICtrlCreateMenuItem("Delete", $vBulkStudentMenu) Global $vBulkMoveStudent = GUICtrlCreateMenuItem("Move", $vBulkStudentMenu) $vDebugItem = GUICtrlCreateMenuItem("Debug Mode", $vFileMenu) GUICtrlSetState($vDebugItem, $GUI_UNCHECKED) $vSeparator = GUICtrlCreateMenuItem("", $vFileMenu, 2) ; create separator line $vExitItem = GUICtrlCreateMenuItem("Exit", $vFileMenu) $vHelpMenu = GUICtrlCreateMenu("Help") Global $vAboutItem = GUICtrlCreateMenuItem("About", $vHelpMenu) Global $vHelpItem = GUICtrlCreateMenuItem("Help Topics", $vHelpMenu) ; Ready to create gui GUISetState() GUISetState(@SW_SHOW, $vStaffGUI) GUICtrlSetState($aVar[0][0], $GUI_FOCUS) EndFunc ;==>_GUI
Edited by kor, 13 March 2012 - 01:49 PM.






