Manjish Posted August 1, 2009 Share Posted August 1, 2009 Hi, what i wanna do is this.. wanna disable an input box initially. But as soon as user makes selections on two combo-boxes, I want to enable the input box. The reson for this is simple,to fill in the info into i/p box user has to make choices on the combo box!! Here's what I tried, but the i/p box flickers with this method. I am not happy with this approach. Help me improve it or suggest nething else!! thanks.. expandcollapse popup#include <GUIConstants.au3> #include <GUIConstants.au3> #include <GUIConstants.au3> procuring() Func procuring() #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("Media Manager", 722, 638, 302, 34) GUISetBkColor(0xD8E4F8) $Group1 = GUICtrlCreateGroup("Procurement Form", 5, 0, 713, 633, -1) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $Pic1 = GUICtrlCreatePic(@ScriptDir&"\MM_Logo.JPG", 205, 24, 353, 68) $name = GUICtrlCreateInput("", 117, 121, 185, 23) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $date = GUICtrlCreateInput("", 509, 122, 113, 23) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $BU = GUICtrlCreateInput("", 117, 180, 185, 23) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $EID = GUICtrlCreateInput("", 509, 184, 113, 23) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $mobile = GUICtrlCreateInput("", 117, 242, 185, 23) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $GA = GUICtrlCreateInput("", 509, 244, 193, 23) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $Label1 = GUICtrlCreateLabel("Procured By", 29, 119, 70, 19) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $Label2 = GUICtrlCreateLabel("BU/Team", 29, 185, 54, 19) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $Label3 = GUICtrlCreateLabel("Mobile No.", 29, 240, 64, 19) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $Label4 = GUICtrlCreateLabel("E.g. Manjish Naik", 309, 123, 98, 19) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $Label5 = GUICtrlCreateLabel("E.g. EBG-QPS", 309, 183, 77, 19) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $Label6 = GUICtrlCreateLabel("Date", 453, 122, 29, 19) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $Label7 = GUICtrlCreateLabel("EID No.", 453, 185, 46, 19) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $Label8 = GUICtrlCreateLabel("Name of Granting Authority", 341, 245, 153, 19) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $Label9 = GUICtrlCreateLabel("(dd/mm/yy)", 637, 121, 66, 19) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $Label10 = GUICtrlCreateLabel("E.g. E437409", 637, 180, 70, 19) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $Label11 = GUICtrlCreateLabel("Example: R310.3 Application Media (Build 6 Rev 6).", 29, 320, 300, 19) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $Label12 = GUICtrlCreateLabel("Please Enter the Item to be procured. (Include the Build ID of Media).", 29, 288, 550, 19) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $Label13 = GUICtrlCreateLabel("Release", 157, 352, 45, 19) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $Label14 = GUICtrlCreateLabel("Type Of Media", 469, 352, 85, 19) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $Label15 = GUICtrlCreateLabel("1.", 37, 384, 13, 19) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $Label16 = GUICtrlCreateLabel("2.", 37, 424, 13, 19) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $Label17 = GUICtrlCreateLabel("3.", 37, 464, 13, 19) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $Label18 = GUICtrlCreateLabel("4.", 37, 504, 13, 19) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $Label19 = GUICtrlCreateLabel("5.", 37, 544, 13, 19) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $R1 = GUICtrlCreateCombo("", 93, 384, 169, 25) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") GUICtrlSetData(-1, "Windows 2003 Server|Windows 2000 Server|Windows 2000 Client|Windows XP|Windows 7|Windows Vista|Windows 2008 Server|R 200 or Older|R 301.1|R 301.2|R 301.3|R 310.2|R 310.3|R 311.2|R 400") $B1 = GUICtrlCreateInput("", 278, 384, 129, 23) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $T1 = GUICtrlCreateCombo("", 422, 384, 257, 25) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") GUICtrlSetData(-1, "Operating System Disk|EXPPlus Media|Application Media|Knowledge Builder|CAB|MSDN|CAB+MSDN|Support Software") $R2 = GUICtrlCreateCombo("", 93, 424, 169, 25) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") GUICtrlSetData(-1, "Windows 2003 Server|Windows 2000 Server|Windows 2000 Client|Windows XP|Windows 7|Windows Vista|Windows 2008 Server|R 200 or Older|R 301.1|R 301.2|R 301.3|R 310.2|R 310.3|R 311.2|R 400") $B2 = GUICtrlCreateInput("", 278, 424, 129, 23) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $T2 = GUICtrlCreateCombo("", 422, 424, 257, 25) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") GUICtrlSetData(-1, "Operating System Disk|EXPPlus Media|Application Media|Knowledge Builder|CAB|MSDN|CAB+MSDN|Support Software") $R3 = GUICtrlCreateCombo("", 93, 464, 169, 25) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") GUICtrlSetData(-1, "Windows 2003 Server|Windows 2000 Server|Windows 2000 Client|Windows XP|Windows 7|Windows Vista|Windows 2008 Server|R 200 or Older|R 301.1|R 301.2|R 301.3|R 310.2|R 310.3|R 311.2|R 400") $B3 = GUICtrlCreateInput("", 278, 464, 129, 23) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $T3 = GUICtrlCreateCombo("", 422, 464, 257, 25) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") GUICtrlSetData(-1, "Operating System Disk|EXPPlus Media|Application Media|Knowledge Builder|CAB|MSDN|CAB+MSDN|Support Software") $R4 = GUICtrlCreateCombo("", 93, 504, 169, 25) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") GUICtrlSetData(-1, "Windows 2003 Server|Windows 2000 Server|Windows 2000 Client|Windows XP|Windows 7|Windows Vista|Windows 2008 Server|R 200 or Older|R 301.1|R 301.2|R 301.3|R 310.2|R 310.3|R 311.2|R 400") $B4 = GUICtrlCreateInput("", 278, 504, 129, 23) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") GUICtrlSetState(-1,$gui_disable) ;GUICtrlGetState $T4 = GUICtrlCreateCombo("", 422, 504, 257, 25) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") GUICtrlSetData(-1, "Operating System Disk|EXPPlus Media|Application Media|Knowledge Builder|CAB|MSDN|CAB+MSDN|Support Software") $R5 = GUICtrlCreateCombo("", 92, 544, 169, 25) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") GUICtrlSetData(-1, "Windows 2003 Server|Windows 2000 Server|Windows 2000 Client|Windows XP|Windows 7|Windows Vista|Windows 2008 Server|R 200 or Older|R 301.1|R 301.2|R 301.3|R 310.2|R 310.3|R 311.2|R 400") $B5 = GUICtrlCreateInput("", 278, 544, 129, 23) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") $T5 = GUICtrlCreateCombo("", 422, 544, 257, 25) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") GUICtrlSetData(-1, "Operating System Disk|EXPPlus Media|Application Media|Knowledge Builder|CAB|MSDN|CAB+MSDN|Support Software") $Enter = GUICtrlCreateButton("Enter", 250, 592, 169, 25, 0) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") GUICtrlSetState(-1,$gui_defbutton) GUICtrlSetBkColor(-1, 0x316AC5) $Label = GUICtrlCreateLabel("Build ID", 312, 352, 48, 19) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### while 1 $msg=GUIGetMsg() If $msg=$gui_event_close then Exit if guictrlread($R1,1)<>"" and guictrlread($t1,1)<>"" Then GUICtrlSetState($B1,$gui_enable) if guictrlread($R2,1)<>"" and guictrlread($t2,1)<>"" Then GUICtrlSetState($B2,$gui_enable) if guictrlread($R3,1)<>"" and guictrlread($t3,1)<>"" Then GUICtrlSetState($B3,$gui_enable) if guictrlread($R4,1)<>"" and guictrlread($t4,1)<>"" Then GUICtrlSetState($B4,$gui_enable) if guictrlread($R5,1)<>"" and guictrlread($t5,1)<>"" Then GUICtrlSetState($B5,$gui_enable) WEnd While 1 $nMsg2 = GUIGetMsg() Switch $nMsg2 Case $GUI_EVENT_CLOSE Return ExitLoop Case $Enter Global $date1=GUICtrlRead($date) Global $name1=GUICtrlRead($name) Global $EID1=GUICtrlRead($EID) Global $BU1=GUICtrlRead($BU) Global $R11=guictrlread($R1,1) Global $B11=guictrlread($B1) Global $T11=guictrlread($T1,1) Global $R21=guictrlread($R2,1) Global $B21=guictrlread($B2) Global $T21=guictrlread($T2,1) Global $R31=guictrlread($R3,1) Global $B31=guictrlread($B3) Global $T31=guictrlread($T3,1) Global $R41=guictrlread($R4,1) Global $B41=guictrlread($B4) Global $T41=guictrlread($T4,1) Global $R51=guictrlread($R5,1) Global $B51=guictrlread($B5) Global $T51=guictrlread($T5,1) Global $mobile1=guictrlread($mobile) Global $GA1=GUICtrlRead($GA) $check=datacheck() if $check=0 Then continueloop Else dataentry() ExitLoop EndIf ;Return EndSwitch WEnd EndFunc Func datacheck() Select Case $name1="" MsgBox(4096,"Form Validation Error","Blank Name Not Allowed!!") return 0 Case $date1="" MsgBox(4096,"Form Validation Error","Blank Date Not Allowed!!") return 0 Case $BU1="" MsgBox(4096,"Form Validation Error","Blank BU/Team Name Not Allowed!!") return 0 Case $EID1="" MsgBox(4096,"Form Validation Error","Blank EID No. Not Allowed!!") return 0 Case $mobile1="" MsgBox(4096,"Form Validation Error","Blank Mobile No. Not Allowed!!") return 0 Case $GA1="" MsgBox(4096,"Form Validation Error",'Blank "Granting Authority Name" Not Allowed!!') return 0 Case $R11="" MsgBox(4096,"Form Validation Error","Please Make a Selection for Media Release!!") return 0 Case $T11="" MsgBox(4096,"Form Validation Error","Please Make a Selection for Media Type!!") return 0 Case $R21<>"" And $T21="" MsgBox(4096,"Form Validation Error","Please Make a Selection for Media Type No.2!!") return 0 Case $R31<>"" And $T31="" MsgBox(4096,"Form Validation Error","Please Make a Selection for Media Type No.3!!") return 0 Case $R41<>"" And $T41="" MsgBox(4096,"Form Validation Error","Please Make a Selection for Media Type No.4!!") return 0 Case $R51<>"" And $T51="" MsgBox(4096,"Form Validation Error","Please Make a Selection for Media Type No.4!!") return 0 case Else Return 1 EndSelect EndFunc Func dataentry() $sFilePath1 = @ScriptDir & "\Media Management System.xls" $oExcel = _ExcelBookOpen($sFilePath1) For $i=2 to 50000 $sCellValue = _ExcelReadCell($oExcel, $i, 1) if $sCellValue="" then ExitLoop Next _ExcelWriteCell($oExcel, ($i-2),$i,1) _ExcelWriteCell($oExcel, $date1,$i,2) _ExcelWriteCell($oExcel, $name1,$i,3) _ExcelWriteCell($oExcel, $EID1,$i,4) _ExcelWriteCell($oExcel, $item1,$i,5) _ExcelWriteCell($oExcel, $BU1,$i,6) _ExcelWriteCell($oExcel, $mobile1,$i,7) _ExcelWriteCell($oExcel, $GA1,$i,8) _ExcelWriteCell($oExcel,"OPEN",$i,11) _ExcelBookSave($oExcel) _ExcelBookClose($oExcel) EndFunc [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 1, 2009 Moderators Share Posted August 1, 2009 Manjish, A much reduced script showing the principle of how to prevent the flicker: #include <GUIConstants.au3> procuring() Func procuring() #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("Media Manager", 722, 638, 302, 34) GUISetBkColor(0xD8E4F8) $R1 = GUICtrlCreateCombo("", 93, 384, 169, 25) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") GUICtrlSetData(-1, "Windows 2003 Server|Windows 2000 Server|Windows 2000 Client|Windows XP|Windows 7|Windows Vista|Windows 2008 Server|R 200 or Older|R 301.1|R 301.2|R 301.3|R 310.2|R 310.3|R 311.2|R 400") $B1 = GUICtrlCreateInput("", 278, 384, 129, 23) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") GUICtrlSetState(-1, $GUI_DISABLE) $T1 = GUICtrlCreateCombo("", 422, 384, 257, 25) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") GUICtrlSetData(-1, "Operating System Disk|EXPPlus Media|Application Media|Knowledge Builder|CAB|MSDN|CAB+MSDN|Support Software") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 If GUICtrlRead($R1, 1) <> "" And GUICtrlRead($T1, 1) <> "" And BitAnd(GUICtrlGetState($B1), $GUI_DISABLE) = $GUI_DISABLE Then GUICtrlSetState($B1, $gui_enable) Switch GUIGetMsg() Case $gui_event_close Return EndSwitch WEnd EndFunc ;==>procuring 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...
Manjish Posted August 1, 2009 Author Share Posted August 1, 2009 Manjish, A much reduced script showing the principle of how to prevent the flicker: #include <GUIConstants.au3> procuring() Func procuring() #Region ### START Koda GUI section ### Form= $Form2 = GUICreate("Media Manager", 722, 638, 302, 34) GUISetBkColor(0xD8E4F8) $R1 = GUICtrlCreateCombo("", 93, 384, 169, 25) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") GUICtrlSetData(-1, "Windows 2003 Server|Windows 2000 Server|Windows 2000 Client|Windows XP|Windows 7|Windows Vista|Windows 2008 Server|R 200 or Older|R 301.1|R 301.2|R 301.3|R 310.2|R 310.3|R 311.2|R 400") $B1 = GUICtrlCreateInput("", 278, 384, 129, 23) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") GUICtrlSetState(-1, $GUI_DISABLE) $T1 = GUICtrlCreateCombo("", 422, 384, 257, 25) GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") GUICtrlSetData(-1, "Operating System Disk|EXPPlus Media|Application Media|Knowledge Builder|CAB|MSDN|CAB+MSDN|Support Software") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 If GUICtrlRead($R1, 1) <> "" And GUICtrlRead($T1, 1) <> "" And BitAnd(GUICtrlGetState($B1), $GUI_DISABLE) = $GUI_DISABLE Then GUICtrlSetState($B1, $gui_enable) Switch GUIGetMsg() Case $gui_event_close Return EndSwitch WEnd EndFunc ;==>procuring M23 M23 to the rescue.. heh!! Nice!! Long time man.. Thanks this works.. Had the idea with me.. just didnt think of putting the statement in the same while loop as the guigetmsg() while loop!! I put another while loop and messed the gui! Maybe coz m very sleepy!! 1.30 am here in India!! Will complete this tomorrow!! As always, You have been a great help!! [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 1, 2009 Moderators Share Posted August 1, 2009 Manjish, Always a pleasure. Sleep well! 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...
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