hmes Posted September 26, 2010 Share Posted September 26, 2010 I was coping it so this may contains some spellings1st questionsif i made function like this$ASD = GUICtrlCreateCombo("0",190, 8,30) GUICtrlSetData(-1, "1|2|3|4|5|6", "") Func _QWE() Send(GUICtrlRead($ASD)) EndFunc HotKeySet("q"), "_QWE")Then, func _qwe reads data from $ASD whenever i change itSo why this isnt working?$ZXC = GUICtrlCreateCombo("q",260, 8,30) GUICtrlSetData(-1, "w|e|r|t|y|u|i|o|p", "") $ASD = GUICtrlCreateCombo("0",190, 8,30) GUICtrlSetData(-1, "1|2|3|4|5|6", "") Func _QWE() Send(GUICtrlRead($ASD)) EndFunc HotKeySet(GUICtrlRead($ZXC)), "_QWE")So why HoyKeySet reads only "q" from $ZXC, even if i change it?2nd questionsIs it possible to 'lock' a combo? So you cant edit it like in input, you can choose only from those options that i put in it?And last 3rd questionsI want this function to work only while its selected in menuSo i write something like this$ASD = GUICtrlCreateCombo("0",190, 8,30) GUICtrlSetData(-1, "1|2|3|4|5|6", "") Func _QWE() Send(GUICtrlRead($ASD)) EndFunc Func _TYU() send("q") endfunc $settings = GUICtrlCreateMenu("Settings") $enable = GUICtrlCreateMenuItem("Enable", $settings) GUICtrlSetState(-1, $GUI_UNCHECKED) While 1 $msg = GUIGetMsg() If $msg = $enable Then If BitAND(GUICtrlRead($enable), $GUI_UNCHECKED) = $GUI_UNCHECKED Then GUICtrlSetState($enable, $GUI_CHECKED) HotKeySet("q", "_QWE") Else GUICtrlSetState($enableRSB, $GUI_UNCHECKED) HotKeySet("q", "_TYU") EndIf EndIfBut its working only once, and then its disabling QAny suggestions? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 26, 2010 Moderators Share Posted September 26, 2010 hmes,Please try and post completed code - it gets annoying to have to add lots of extra lines to get something to debug! I have used a label for the HotKey to action rather than using Send as I was not sure what you were Sending to! Answers 1 & 2 combined:expandcollapse popup#include <GUIConstantsEx.au3> #include <ComboConstants.au3> $hGUI = GUICreate("Test", 500, 500) $ZXC = GUICtrlCreateCombo("q", 260, 8, 40, 15, $CBS_DROPDOWNLIST) ; Cannot write in combo edit GUICtrlSetData(-1, "w|e|r|t|y|u|i|o|p", "") $ASD = GUICtrlCreateCombo("0", 190, 8, 40, 15, $CBS_DROPDOWNLIST) GUICtrlSetData(-1, "1|2|3|4|5|6", "") $hLabel = GUICtrlCreateLabel("", 10, 10, 50, 20) GUISetState() ; Use for comparison $LastZXC = "" While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $ZXC ; Clear label GUICtrlSetData($hLabel, "") ; read HotKey combo $CurrZXC = GUICtrlRead($ZXC) ; If it has changed If $CurrZXC <> $LastZXC Then ; Unset current hotkey HotKeySet($LastZXC) ; Set new hotkey HotKeySet($CurrZXC, "_QWE") ; Reset comparison $LastZXC = $CurrZXC EndIf EndSwitch WEnd Func _QWE() GUICtrlSetData($hLabel, GUICtrlRead($ASD) & @CRLF) EndFunc ;==>_QWEAnswer 3:expandcollapse popup#include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) $settings = GUICtrlCreateMenu("Settings") $enable = GUICtrlCreateMenuItem("Enable", $settings) GUICtrlSetState(-1, $GUI_UNCHECKED) $ASD = GUICtrlCreateCombo("0", 190, 8, 30) GUICtrlSetData(-1, "1|2|3|4|5|6", "") $hLabel = GUICtrlCreateLabel("", 10, 10, 50, 20) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $enable If BitAND(GUICtrlRead($enable), $GUI_UNCHECKED) = $GUI_UNCHECKED Then GUICtrlSetState($enable, $GUI_CHECKED) HotKeySet("q", "_QWE") Else GUICtrlSetState($enable, $GUI_UNCHECKED) HotKeySet("q", "_TYU") EndIf EndSwitch WEnd Func _QWE() GUICtrlSetData($hLabel, GUICtrlRead($ASD) & @CRLF) Sleep(1000) ; Clear label GUICtrlSetData($hLabel, "") EndFunc ;==>_QWE Func _TYU() GUICtrlSetData($hLabel, "q" & @CRLF) Sleep(1000) ; Clear label GUICtrlSetData($hLabel, "") EndFunc ;==>_TYUI have commented liberally, but please ask if you have any questions. 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...
MvGulik Posted September 26, 2010 Share Posted September 26, 2010 Please try and post completed code - it gets annoying to have to add lots of extra lines to get something to debug! Not forgetting that the problem might be in the left out parts.But "completed code" ... Better is something like a slimmed down "working code" example/test thats still giving you the problem. "Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions.""The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014) "Believing what you know ain't so" ... Knock Knock ... Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 26, 2010 Moderators Share Posted September 26, 2010 MvGulik, You are quite correct - bad choice of words on my part. Blame it on advanced years - I do! 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...
hmes Posted September 26, 2010 Author Share Posted September 26, 2010 Yay, fast and great reply, thanks And yea, next time i will post a working code : ) 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