skippynz Posted January 23, 2007 Share Posted January 23, 2007 in a recent upgrade did the $gui_checked get removed ? i ask cause i have $state = GUICtrlGetState ( $Backup_Folder1d ) if $state = $GUI_CHECKED then whateva...... endif in one of my scripts and it appears to have stopped working what can i use to replace it - cause if i check what $state = with the checkbox checked or not they both come out as '80' cheers craig Link to comment Share on other sites More sharing options...
crzftx Posted January 23, 2007 Share Posted January 23, 2007 If $state is a checkbox/radio then that statement would never have worked... Actually it wouldn't have done anything either way. You need to use GuiCtrlRead() Link to comment Share on other sites More sharing options...
_Kurt Posted January 23, 2007 Share Posted January 23, 2007 Errrmm, are you checking if a checkbox is checked? Look up GUICtrlCreateCheckbox, and $state = GUICtrlCreateCheckbox(....) Kurt Awaiting Diablo III.. Link to comment Share on other sites More sharing options...
Zedna Posted January 23, 2007 Share Posted January 23, 2007 Func IsChecked($control) Return BitAnd(GUICtrlRead($control),$GUI_CHECKED) = $GUI_CHECKED EndFunc Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
skippynz Posted January 23, 2007 Author Share Posted January 23, 2007 (edited) i will explain further - this use to work until recently. this is part of a backup script ive created using autoit if the user press the button it will prompt for a folder to choose then create a checkbox for that button - then ensure its ticked. Case $msg1 = $Backup_Folder7 $Backup_Folder7a = FileSelectFolder("Please choose the folder that needs to be backed up.","",2,"C:\") if not @error Then $Backup_Folder7b = StringSplit($Backup_Folder7a,"\",1) $x = $Backup_Folder7b[0] $Backup_Folder7c = $Backup_Folder7b[$x] GUICtrlSetData ( $Backup_Folder7, $Backup_Folder7c ) if $Backup_Folder7a <> "" Then $Backup_Folder7d = GUICtrlCreateCheckbox ( "", 495, $c7,15,15) GUICtrlSetState ( $Backup_Folder7d, $GUI_CHECKED ) EndIf EndIf oÝ÷ ÚØ^ºÇ««-¢Þ²ÆÚrK©¶(ا¹æî¶,׶!yÉ-«m쬶)eÁ©íyÛhm§$ºaj×è׫趲r§ëaêæwZÛ§rØ^~]z¼víÁ©í¶ÚrHº^Ǧʷ²ß¢»¬x-è.Ëk²Öy«¢+Ø(ÀÌØíÍÑÑÜôU% ÑɱÑMÑÑ ÀÌØí ÕÁ}½±Èݤ)¥ÀÌØí ÕÁ}½±ÈݱÐìÐìÅÕ½ÐìÅÕ½Ðì¹ÀÌØíÍÑÑÜôÀÌØíU%} ! -Q¡¸)U% ÑɱMÑÑ ÀÌØíÑáаÌäí ¥¹ÕÀÑ¡ÅÕ½ÐìÌäìµÀìÀÌØí ÕÁ}½±ÈݵÀìÌäìÅÕ½Ðì½±ÈÌäì¤)AɽÉÍÍ ½Áä ÀÌØí ÕÁ}½±ÈÝ°MÉ¥ÁѥȵÀìÌäìÀäÈìÌäìµÀìUÍÉ9µµÀìÌäìÀäÈí=Ñ¡ÈÀäÈí½±ÈÜÌäì°Ä¤)%¹¥]ɥѡMÉ¥ÁѥȵÀìÌäìÀäÈìÌäìµÀìUÍÉ9µµÀìÌäìÀäÈí=Ñ¡ÈÀäÈí½±É̹¥¹¤Ìäì°ÅÕ½Ðí½±ÈÜÅÕ½Ðì°ÅÕ½Ðí9µÅÕ½Ðì°ÀÌØí ÕÁ}½±Èݤ)¥MÑÉ¥¹%¹MÑÈ ÀÌØí ÕÁ}½±ÈűUÍÉAɽ¥±¥È¤Q¡¸(ÀÌØí½±ÈÝôMÑÉ¥¹IÁ± ÀÌØí ÕÁ}½±ÈÝ°UÍÉAɽ¥±¥È°ÅÕ½ÐíÕÍÉÁɽ¥±ÅÕ½Ðì°Ä¤)±Í(ÀÌØí½±ÈÝôÀÌØí ÕÁ}½±ÈÝ)¹%)¥MÑÉ¥¹%¹MÑÈ ÀÌØí½±ÈÝ°ÅÕ½ÐíèÀäÈìÅÕ½Ðì¤Q¡¸(ÀÌØí½±ÈÝôMÑÉ¥¹IÁ± ÀÌØí½±ÈÝ°ÅÕ½ÐíèÀäÈìÅÕ½Ðì°ÅÕ½ÐíèÀäÈìÅÕ½Ðì°Ä¤)±Í(ÀÌØí½±ÈÅôÀÌØí½±ÈÝ)¹%)%¹¥]ɥѡMÉ¥ÁѥȵÀìÌäìÀäÈìÌäìµÀìUÍÉ9µµÀìÌäìÀäÈí=Ñ¡ÈÀäÈí½±É̹¥¹¤Ìäì°ÅÕ½Ðí½±ÈÜÅÕ½Ðì°ÅÕ½Ðí1½Ñ¥½¸ÅÕ½Ðì°ÀÌØí½±Èݤ)¹%( like i say it use to work till recently. Edited January 23, 2007 by craig.gill Link to comment Share on other sites More sharing options...
Helge Posted January 23, 2007 Share Posted January 23, 2007 Look up GUICtrlCreateCheckbox, and $state = GUICtrlCreateCheckbox(....)Ehm, what ? Are you trying to say that GUICtrlCreateCheckbox returns the state and not the controlID ?How would that work ? Would $state be automagically updated whenever the checkbox' state was changed ? Link to comment Share on other sites More sharing options...
Zedna Posted January 23, 2007 Share Posted January 23, 2007 (edited) original: $state7 = GUICtrlGetState ( $Backup_Folder7d ) if $Backup_Folder7a <> "" and $state7 = $GUI_CHECKED Then ... oÝ÷ Úw°jëh×6If $Backup_Folder7a <> "" and IsChecked($Backup_Folder7d) Then ... Func IsChecked($control) Return BitAnd(GUICtrlRead($control),$GUI_CHECKED) = $GUI_CHECKED EndFunc Edited January 23, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
_Kurt Posted January 24, 2007 Share Posted January 24, 2007 (edited) Ehm, what ? Are you trying to say that GUICtrlCreateCheckbox returns the state and not the controlID ?How would that work ? Would $state be automagically updated whenever the checkbox' state was changed ?Okay jeez Helge, all I was trying to do was help, I was in a rush since I had to go. If you want me to write an example for him, than I will. Was just trying to point him in the right direction.#include <GUIconstants.au3> Guicreate("test") $checkbox = Guictrlcreatecheckbox("CLICK ME", 10, 10) $label = GUICtrlCreateLabel("", 10, 40, 300) GuiSetState() While 1 If Guictrlread($checkbox) = $GUI_CHECKED Then GUICtrlSetData($label, "Checkbox = checked") ;Checks if checkbox = checked If Guictrlread($checkbox) = $GUI_UNCHECKED Then GUICtrlSetData($label, "Checkbox = unchecked") ;Checks if checkbox = unchecked $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEndThere ya go,Kurt Edited January 24, 2007 by _Kurt Awaiting Diablo III.. Link to comment Share on other sites More sharing options...
skippynz Posted January 24, 2007 Author Share Posted January 24, 2007 original:$state7 = GUICtrlGetState ( $Backup_Folder7d ) if $Backup_Folder7a <> "" and $state7 = $GUI_CHECKED Then ... oÝ÷ Úw°jëh×6If $Backup_Folder7a <> "" and IsChecked($Backup_Folder7d) Then ... Func IsChecked($control) Return BitAnd(GUICtrlRead($control),$GUI_CHECKED) = $GUI_CHECKED EndFuncthanks for this - its done the trick but just strange that the $gui_checked stopped working out of the blue Link to comment Share on other sites More sharing options...
Helge Posted January 24, 2007 Share Posted January 24, 2007 (edited) Okay jeez Helge, all I was trying to do was help, I was in a rush since I had to go.What are you jeezing me for ? You wrote $state = GUICtrlCreateCheckbox(....), so what am I to think ?It's kind of hard for me to know what you intend with whatever you write, so when you write it like that....Seriously, what do you expect us to make out of it ? I followed my logic and how you wrote it like thatthere's no way I could in any way figure out that you meant to throw in a GUICtrlRead, and because ofthat I said what I said : $state would hold the controlId, and that's the truth.EDIT : And just so that you know it...I was trying to help as well, by telling Craig that it wouldn't work. Edited January 24, 2007 by Helge 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