Lunatic Posted February 2, 2009 Posted February 2, 2009 I've been awake far too long trying to figure this one out - likely at this point it's staring me in the face and I don't know it. I've checked through the help file in SciTe, done some searching here on the forums, and am still not getting it fixed. I've had no trouble creating the GUI I want through Koda, but I can't seem to call a result from it. Specifically I'm working with $Checkbox1 = GUICtrlCreateCheckbox("Text", 0, 0, 0, 0) As I stated, CREATING the GUI is no problem. I can get it opened up without issue, but after the fact I can't seem to pull a result from the check boxes. (I haven't at this time attempted the other interactive formats; Radio, Button's, Etc.) After reading the Help file in SciTe, I've tried variations of $GUI_CHECKED and $GUI_UNCHECKED without success. So, yea. Dumb question of the day. Thanks. [center][/center]
Moderators Melba23 Posted February 2, 2009 Moderators Posted February 2, 2009 Lunatic,Try:If BitAnd(GUICtrlRead($hCheckBox_Handle),$GUI_CHECKED) = $GUI_CHECKEDIt works for me.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
Lunatic Posted February 2, 2009 Author Posted February 2, 2009 (edited) Nevermind, I'm special. Found my own answer - Thanks for any attempted assistance anyway. (And thanks to Pain for answering other dude's question, and thus my own.) Answer is Here if anyone has the same issue. -CORRECTION- this answer only works if you're using an .ini file. (Apparently I forget to read everything when I'm tired.)Woops - thanks Melba23 - I'll look into that too. Always good to have multiple outlooks. Edited February 2, 2009 by Lunatic [center][/center]
Moderators Melba23 Posted February 2, 2009 Moderators Posted February 2, 2009 Lunatic,Re the PM you sent me. You need to have the If...Then statement inside the While...Wend loop or it is never activated. So you need something along the lines of:#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=D:\Frank's Documents\Auto-It Scripts Archive\Scripts in Devlopment\Form1.kxf $Form1 = GUICreate("Test GUI", 327, 351, 193, 125) $Label1 = GUICtrlCreateLabel("Checkbox Test GUI", 24, 16, 279, 17) $Checkbox1 = GUICtrlCreateCheckbox("My Checkbox", 25, 40, 97, 15) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 If BitAnd(GUICtrlRead($Checkbox1),$GUI_CHECKED) = $GUI_CHECKED THEN; MsgBox(4096, "Test", "CHECKED", 10) ElseIf BitAnd(GUICtrlRead($Checkbox1),$GUI_UNCHECKED) = $GUI_UNCHECKED THEN; MsgBox(4096, "Test", "UNCHECKED", 10) EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEndBut you will notice that the MsgBox is triggered each time you loop - which is pretty often. So I would suggest adding a flag to prevent this:#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form=D:\Frank's Documents\Auto-It Scripts Archive\Scripts in Devlopment\Form1.kxf $Form1 = GUICreate("Test GUI", 327, 351, 193, 125) $Label1 = GUICtrlCreateLabel("Checkbox Test GUI", 24, 16, 279, 17) $Checkbox1 = GUICtrlCreateCheckbox("My Checkbox", 25, 40, 97, 15) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $Checked_State = False While 1 If BitAnd(GUICtrlRead($Checkbox1),$GUI_CHECKED) <> $Checked_State Then $Checked_State = Not $Checked_State If BitAnd(GUICtrlRead($Checkbox1),$GUI_CHECKED) = $GUI_CHECKED THEN; MsgBox(4096, "Test", "CHECKED", 10) ElseIf BitAnd(GUICtrlRead($Checkbox1),$GUI_UNCHECKED) = $GUI_UNCHECKED THEN; MsgBox(4096, "Test", "UNCHECKED", 10) EndIf EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEndM23P.S. Please do not use PMs to ask questions - that is why we have a forum. Then any interested member or guest can see the problems and solutions. :-) 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
Lunatic Posted February 2, 2009 Author Posted February 2, 2009 Ah, makes sense now. Thanks for the assistance again. And understood - Sent via PM only because it was your assistance specifically I was trying to clarify, and I wasn't sure if you'd see the response to the thread. Won't happen again. [center][/center]
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