Moderators Melba23 Posted February 8, 2011 Moderators Share Posted February 8, 2011 ragiroti, Not a good idea in my opinion as you will never be able to tell if the user has finished entering data. You risk moving away from the dialog before the user has finished entering his required data. I would do something like this: expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GUIComboBox.au3> #include <EditConstants.au3> $hGUI = GUICreate("Set Parameters", 600, 500, -1, -1, $WS_CAPTION) GUICtrlCreateLabel("What are you testing in this build?", 10, 10, 300, 20) $hEdit = GUICtrlCreateEdit("", 10, 40, 480, 100, $ES_MULTILINE) GUICtrlCreateLabel("YYYYYY" & @CRLF & "Please enter the '<1> <2> <3> <4> <5> <6>'", 10, 150, 250, 40) $spnumber = GUICtrlCreateInput("", 10, 190, 100, 20) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetLimit(-1, 6) GUICtrlCreateLabel("Environment" & @CRLF & "Please choose the Environment", 10, 220, 250, 40) $environment = GUICtrlCreateCombo("", 10, 260, 100, 20) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetData(-1, "PC|Win 7|Win XP") GUICtrlCreateLabel("Developer" & @CRLF & "Please choose the Developer Name", 250, 150, 250, 40) $developer = GUICtrlCreateCombo("", 260, 190, 100, 20) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetData(-1, "aaa|BBB|CCC|DDD|EEE|FFF") GUICtrlCreateLabel("Tester" & @CRLF & "Please choose the Tester Name", 260, 220, 250, 40) $tester = GUICtrlCreateCombo("", 260, 260, 100, 20) GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlSetData(-1, "GGG|HHH|III|JJJ") ;GUICtrlCreateLabel("Date" & @CRLF & "Please enter the date in the following format 'dd-mm-yyyy'", 10, 290, 250, 40) ;$date = GUICtrlCreateInput("", 10, 340, 100, 20) ;GUICtrlSetLimit(-1, 10) GUISetState() $fDisabled = True While 1 ; Set the check to 0 $iCheck = 0 ; Enable the other controls if we have at least 10 characters in the edit If StringLen(GUICtrlRead($hEdit)) > 10 Then ; If edit has some text then enable the other controls If $fDisabled Then For $i = $spnumber To $tester GUICtrlSetState($i, $GUI_ENABLE) Next $fDisabled = False EndIf EndIf ; Check to see if all conditions met If StringLen(GUICtrlRead($spnumber)) = 6 Then $iCheck += 1 If GUICtrlRead($environment) <> "" And _GUICtrlComboBox_GetDroppedState($environment) = False Then $iCheck += 1 If GUICtrlRead($developer) <> "" And _GUICtrlComboBox_GetDroppedState($developer) = False Then $iCheck += 1 If GUICtrlRead($tester) <> "" And _GUICtrlComboBox_GetDroppedState($tester) = False Then $iCheck += 1 ; If we have all 4 checks we are good to go If $iCheck = 4 Then $spnumber = GUICtrlRead($spnumber) $environment = GUICtrlRead($environment) $developer = GUICtrlRead($developer) $tester = GUICtrlRead($tester) $date = @MDAY & "-" & @MON & "-" & @YEAR ; Delete the GUI GUIDelete($hGUI) ; And continue on our way ExitLoop EndIf WEnd $sString = _ "=============================================================================================================================================================" & @CRLF & _ "Sprint Number: " & $spnumber & @CRLF & _ "Exploratory Test Sessions" & @CRLF & _ "=============================================================================================================================================================" & @CRLF & _ "Environment: " & $environment & @CRLF & _ "Developer: " & $developer & @CRLF & _ "Project: aaaaaaaaaaaa" & @CRLF & _ "Tester: " & $tester & @CRLF & _ "Date: " & $date & @CRLF ConsoleWrite($sString & @CRLF) Now the user has to enter at least 10 characters (you can adjust this of course) in the edit box first because nothing else works until they are entered. Then we check the other 4 items are correctly actioned and off we go. As I assume we will always want today's date, I have also made the date entry automatic - we are talking Auto(mate)It here! How does that look? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
ragiroti Posted February 8, 2011 Author Share Posted February 8, 2011 I like the approach . Thanks I also liked what you have done with the date field $date = @MDAY & "-" & @MON & "-" & @YEAR could I use it for automating the current time also? like $time = Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 8, 2011 Moderators Share Posted February 8, 2011 ragiroti,could I use it for automating the current time also?Of course - go and look at the Help file under <Macro Reference - Time And Date Macros>. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
ragiroti Posted February 9, 2011 Author Share Posted February 9, 2011 Thanks M23, I am all setup now. Appreciate all your help Now I shall look into some UI beautification Thanks again Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now