blacksniper Posted March 2, 2007 Share Posted March 2, 2007 expandcollapse popup#include <GUIConstants.au3> #Region ### START Koda GUI section ### Form=C:\Documents and Settings\SBatt\Desktop\programming\jukebox\AForm3.kxf Global $Form1 = GUICreate("Help File Mounter", 178, 187, 648, 382) Global $Year = GUICtrlCreateCombo("", 16, 32, 145, 25) GUICtrlSetData(-1, "2007|2006|2005|2004|Dotnet|Graphics|Release") Global $Year1 = GUICtrlCreateLabel("Year of Help File", 40, 8, 82, 17) Global $Mount = GUICtrlCreateButton("Mount", 24, 152, 57, 25, 0) Global $Exit = GUICtrlCreateButton("Exit", 112, 152, 57, 25, 0) Global $Combo2 = GUICtrlCreateCombo("", 16, 104, 145, 25) GUICtrlSetState(-1, $GUI_HIDE) guiCtrlsetData(-1, "Testing|testing1") Global $Label1 = GUICtrlCreateLabel("Product", 64, 80, 41, 17) GUICtrlSetState(-1, $GUI_HIDE) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Func checkit($year) ;msgbox(0,"msg",$year) Select Case $year = "2007" if $combo2(GUIctrlgetstate($combo2)) = $gui_hide Then GUICtrlSetState($Combo2, $Gui_Show) Else EndIf Case $year = "2006" GUICtrlSetState($Combo2, $Gui_Show) Case $year = "2005" GUICtrlSetState($Combo2, $Gui_Show) Case $year = "2004" GUICtrlSetState($Combo2, $Gui_Show) Case $year = "Dotnet" GUICtrlSetState($Combo2, $Gui_Show) Case $year = "Graphics" GUICtrlSetState($Combo2, $Gui_Show) Case $year = "Release" GUICtrlSetState($Combo2, $Gui_Show) EndSelect ;if GUICtrlRead($Browse,$GUI_CHECKED) Then ; $message = 'Mounting DVD Version '&$version&' Please wait...' ;Else ; EndIf ;if GUICtrlRead($install,$gui_checked) Then ; $message = 'Setting Up Installer Version '&$version&' Please wait...' ;Else ;EndIf #comments-start Switch $Year Case $version = "99fxdirect" and BitAnd(GUICtrlRead($Browse),$GUI_CHECKED) GUICtrlSetData($Progress1, $oProgress) DriveMapDel("B:") GUISetState(@sw_hide,$Form1) drivemapadd("B:", "\\wfx_interim\99wfxdir",0, "PFXTAX","quality1") ;Msgbox (0,$version,"You Mounted " & "1999 Fx Direct") Run('explorer.exe b:\') GUICtrlSetData($Progress1, $oProgress) Sleep (10000) _showSplash() Exit EndSwitch #comments-end endfunc While 1 checkit(GuiCtrlRead($year)) $nMsg = GUIGetMsg() Switch $nMsg Case $mount ;MsgBox(0,"test","test") Case $GUI_EVENT_CLOSE Exit case $exit Exit EndSwitch WEndoÝ÷ ئ¶¼¢hëtߧ(º5Nb²ZÉh^Ø^Ó~²yªâ²Ç¥yË^u»Ú'¶ØbHíêâm§$ ©ì¢g¨è^!ø¢Øb±«¢+Ù ÍÀÌØíåÈôÅÕ½ÐìÈÀÀÜÅÕ½Ðì($$%U% ÑɱMÑMÑÑ ÀÌØí ½µ¼È°ÀÌØíÕ¥}M¡½Ü¤($% ÍÀÌØíåÈôÅÕ½ÐìÈÀÀØÅÕ½Ðì($$%U% ÑɱMÑMÑÑ ÀÌØí ½µ¼È°ÀÌØíÕ¥}M¡½Ü¤($% ÍÀÌØíåÈôÅÕ½ÐìÈÀÀÔÅÕ½Ðì($$%U% ÑɱMÑMÑÑ ÀÌØí ½µ¼È°ÀÌØíÕ¥}M¡½Ü¤($% ÍÀÌØíåÈôÅÕ½ÐìÈÀÀÐÅÕ½Ðì($$%U% ÑɱMÑMÑÑ ÀÌØí ½µ¼È°ÀÌØíÕ¥}M¡½Ü¤($% ÍÀÌØíåÈôÅÕ½Ðí½Ñ¹ÐÅÕ½Ðì($$%U% ÑɱMÑMÑÑ ÀÌØí ½µ¼È°ÀÌØíÕ¥}M¡½Ü¤($% ÍÀÌØíåÈôÅÕ½ÐíÉÁ¡¥ÌÅÕ½Ðì($$%U% ÑɱMÑMÑÑ ÀÌØí ½µ¼È°ÀÌØíÕ¥}M¡½Ü¤($% ÍÀÌØíåÈôÅÕ½ÐíI±ÍÅÕ½Ðì($$%U% ÑɱMÑMÑÑ ÀÌØí ½µ¼È°ÀÌØíÕ¥}M¡½Ü I just flashes every millsecond or so how do i Add a line to Stop it from refreshing if it is in Gui_show 'n Status? Link to comment Share on other sites More sharing options...
lod3n Posted March 2, 2007 Share Posted March 2, 2007 Your first problem is that you are trying to get the value of the $year control incorrectly. I'd do this: change your 4th line to this: Global $cboYear = GUICtrlCreateCombo("", 16, 32, 145, 25) Then in your loop do this: $year = GuiCtrlRead($cboYear) [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
lod3n Posted March 2, 2007 Share Posted March 2, 2007 The other problem is setting the $Gui_Show state on the control every loop, regardless of whether the combo's value has changed or not. That will make it vibrate, and not in a good way. Instead, something like this (not a complete script, obviously, just the ideas): Global $cboYear = GUICtrlCreateCombo("", 16, 32, 145, 25) global $lastyear = 0 global $year = 0 while 1 $year = GuiCtrlRead($cboYear) if $year <> $lastyear then $lastyear = $year ; NOW do your checking, and state changing endif wend [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
blacksniper Posted March 3, 2007 Author Share Posted March 3, 2007 The other problem is setting the $Gui_Show state on the control every loop, regardless of whether the combo's value has changed or not. That will make it vibrate, and not in a good way. Instead, something like this (not a complete script, obviously, just the ideas): Global $cboYear = GUICtrlCreateCombo("", 16, 32, 145, 25) global $lastyear = 0 global $year = 0 while 1 $year = GuiCtrlRead($cboYear) if $year <> $lastyear then $lastyear = $year ; NOW do your checking, and state changing endif wend Actaly that only if i am not running a function. Witch the function checks the state of the box item. (in the while loop) this i have no clue where you was going with this.. i fixed my problem with reading the state, now i need someone to help me with the Checking the status of the box if its GUI_show or not i think i can get the rest. Link to comment Share on other sites More sharing options...
EndFunc Posted March 4, 2007 Share Posted March 4, 2007 (edited) Actaly that only if i am not running a function. Witch the function checks the state of the box item. (in the while loop) this i have no clue where you was going with this.. i fixed my problem with reading the state, now i need someone to help me with the Checking the status of the box if its GUI_show or not i think i can get the rest.If you need to read the status of the box why not use the GUICtrlGetState function to read the box? However it will only tell you the status such as hidden, disabled etc but not the data. For that obviously you use GUICtrlRead. That might help. Edited March 4, 2007 by EndFunc EndFuncAutoIt is the shiznit. I love it. 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