tbaror Posted October 4, 2007 Posted October 4, 2007 Hello All, i am writing GUIOnEventMode style utility in the GUI i have 8 input box that should be $GUI_ENABLE according to combo box with option from 1 to 8 that part i don't know how to implement is to loop with the value retrieved from combo-box and enable input-box according to value from combo-box. please advise thanks
BrettF Posted October 4, 2007 Posted October 4, 2007 Hello All,i am writing GUIOnEventMode style utilityin the GUI i have 8 input box that should be $GUI_ENABLE according to combo box with option from 1 to 8that part i don't know how to implement is to loop with the value retrieved from combo-box and enable input-box according to value from combo-box.please advisethanksWould you have some code? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
tbaror Posted October 4, 2007 Author Posted October 4, 2007 Hello All, i am writing GUIOnEventMode style utility in the GUI i have 8 input box that should be $GUI_ENABLE according to combo box with option from 1 to 8 that part i don't know how to implement is to loop with the value retrieved from combo-box and enable input-box according to value from combo-box. please advise thanks this is the relevant part of the code i hope. thanks expandcollapse popupDim $ManTest [10] [3] $CheckTrheads1 = GUICtrlCreateCheckbox("# of Threads -t (throughput mode)", 6, 429, 185, 17) GUICtrlSetOnEvent($CheckTrheads1, "CheckTrheads1Click") $ReadyM = GUICtrlCreateButton("Ready", 8, 536, 90, 22, $BS_FLAT) GUICtrlSetFont($ReadyM, 8, 400, 0, "Arial") GUICtrlSetBkColor($ReadyM, 0xC0C0C0) GUICtrlSetOnEvent($ReadyM, "ReadyMClick") $Thread4 = GUICtrlCreateInput("Thread4", 69, 472, 169, 22) GUICtrlSetFont($Thread4, 8, 400, 0, "Arial") GUICtrlSetOnEvent($Thread4, "Thread4Change") GUICtrlSetState($Thread4, $GUI_DISABLE) $Thread3 = GUICtrlCreateInput("Thread3", 69, 427, 169, 22) GUICtrlSetFont($Thread3, 8, 400, 0, "Arial") GUICtrlSetOnEvent($Thread3, "Thread3Change") GUICtrlSetState($Thread3, $GUI_DISABLE) $Thread2 = GUICtrlCreateInput("Thread2", 68, 390, 169, 22) GUICtrlSetFont($Thread2, 8, 400, 0, "Arial") GUICtrlSetOnEvent($Thread2, "Thread2Change") GUICtrlSetState($Thread2, $GUI_DISABLE) $Thread1 = GUICtrlCreateInput("Thread1", 69, 352, 169, 22) GUICtrlSetFont($Thread1, 8, 400, 0, "Arial") GUICtrlSetOnEvent($Thread1, "Thread1Change") GUICtrlSetState($Thread1, $GUI_DISABLE) $Thread5 = GUICtrlCreateInput("Thread5", 320, 352, 169, 22) GUICtrlSetFont($Thread5, 8, 400, 0, "Arial") GUICtrlSetOnEvent($Thread5, "Thread5Change") GUICtrlSetState($Thread5, $GUI_DISABLE) $Thread6 = GUICtrlCreateInput("Thread6", 320, 390, 169, 22) GUICtrlSetFont($Thread6, 8, 400, 0, "Arial") GUICtrlSetOnEvent($Thread6, "Thread6Change") GUICtrlSetState($Thread6, $GUI_DISABLE) $Thread7 = GUICtrlCreateInput("Thread7", 320, 427, 169, 22) GUICtrlSetFont($Thread7, 8, 400, 0, "Arial") GUICtrlSetOnEvent($Thread7, "Thread7Change") GUICtrlSetState($Thread7, $GUI_DISABLE) $Tread8 = GUICtrlCreateInput("Thread8", 320, 472, 169, 22) GUICtrlSetFont($Tread8, 8, 400, 0, "Arial") GUICtrlSetOnEvent($Tread8, "Tread8Change") GUICtrlSetState($Tread8, $GUI_DISABLE) Func CheckTrheads1Click() $menustate = GUICtrlRead($CheckTrheads1) If $menustate = $GUI_CHECKED Then GUICtrlSetState ($ComboThreads1, $GUI_ENABLE) GUICtrlSetState ($CheckFILE1, $GUI_DISABLE) GUICtrlSetState ($Flocation, $GUI_DISABLE) GUICtrlSetState ($Fname, $GUI_DISABLE) GUICtrlSetState ($CheckFILE2, $GUI_ENABLE) GUICtrlSetState ($CheckFILE2, $GUI_CHECKED) $ManTest [6] [0]= "-t" $ManTest [6] [1]= "" $ManTest [9] [0]= "-F" $ManTest [9] [1]= "" ElseIf $menustate = $GUI_UNCHECKED Then GUICtrlSetState ($CheckFILE2, $GUI_UNCHECKED) GUICtrlSetState ($ComboThreads1, $GUI_DISABLE) GUICtrlSetState ($CheckFILE1, $GUI_ENABLE) GUICtrlSetState ($Flocation, $GUI_ENABLE) GUICtrlSetState ($Fname, $GUI_ENABLE) GUICtrlSetState ($CheckFILE2, $GUI_DISABLE) $ManTest [6] [0]= "" $ManTest [6] [1]= "" $ManTest [9] [0]= "" $ManTest [9] [1]= "" EndIf EndFunc Func ReadyMClick() ;########### start -t thread test###################################### If $ManTest [6] [0]= "-t" And GUICtrlRead ($ComboThreads1) = "" Then MsgBox(16, "Error","Nuber of Thread MUST BE Selected") Return ElseIf $ManTest [6] [0]= "-t" And GUICtrlRead ($ComboThreads1) <> "" Then $ManTest [6] [1] = GUICtrlRead ($ComboThreads1) $log = "$Thread" $T = Number($ManTest [6] [1]) for $y = 0 to $T GUICtrlSetState ($log & $y, $GUI_ENABLE) MsgBox(16, "",$log & $y) Next EndIf ;########### End -t thread test###################################### EndFunc ;==>Click
tbaror Posted October 4, 2007 Author Posted October 4, 2007 hi was the code submitted helpfull or you need the full code ?
BrettF Posted October 4, 2007 Posted October 4, 2007 Yes... The full code would helps lots Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
Valuater Posted October 4, 2007 Posted October 4, 2007 (edited) Func CheckTrheads1Click() If _IsChecked($CheckTrheads1) Then GUICtrlSetState ($ComboThreads1, $GUI_ENABLE) GUICtrlSetState ($CheckFILE1, $GUI_DISABLE) GUICtrlSetState ($Flocation, $GUI_DISABLE) GUICtrlSetState ($Fname, $GUI_DISABLE) GUICtrlSetState ($CheckFILE2, $GUI_ENABLE) GUICtrlSetState ($CheckFILE2, $GUI_CHECKED) $ManTest [6] [0]= "-t" $ManTest [6] [1]= "" $ManTest [9] [0]= "-F" $ManTest [9] [1]= "" Else GUICtrlSetState ($CheckFILE2, $GUI_UNCHECKED) GUICtrlSetState ($ComboThreads1, $GUI_DISABLE) GUICtrlSetState ($CheckFILE1, $GUI_ENABLE) GUICtrlSetState ($Flocation, $GUI_ENABLE) GUICtrlSetState ($Fname, $GUI_ENABLE) GUICtrlSetState ($CheckFILE2, $GUI_DISABLE) $ManTest [6] [0]= "" $ManTest [6] [1]= "" $ManTest [9] [0]= "" $ManTest [9] [1]= "" EndIf EndFunc Func _IsChecked($control) Return BitAnd(GUICtrlRead($control),$GUI_CHECKED) = $GUI_CHECKED EndFunc EDIT...... 8) Edited October 4, 2007 by Valuater
Valuater Posted October 4, 2007 Posted October 4, 2007 error $Tread8 = GUICtrlCreateInput("Thread8", 320, 472, 169, 22) $Thread ???... not $Tread 8)
Valuater Posted October 4, 2007 Posted October 4, 2007 Found it GUICtrlSetState (Eval($log & $y), $GUI_ENABLE) 8)
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