Mic Posted June 24, 2014 Share Posted June 24, 2014 Have the #include and have setting vert or horz arrow keys for this control without success. Is there a working example of this? tia. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 24, 2014 Moderators Share Posted June 24, 2014 Mic,Your question is unclear - what exactly are you trying to 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...
Mic Posted June 24, 2014 Author Share Posted June 24, 2014 I guess I'm old too :-) - trying to get the arrow keys to increment/decrement value of the UpDown control when it is selected. Have #include <UpDownConstants.au3> and $UDS_ARROWKEYS but the arrow keys are not altering control. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 24, 2014 Moderators Share Posted June 24, 2014 Mic,The easiest way is to use _IsPressed: #include <GUIConstantsEx.au3> #include <Misc.au3> Local $hDLL = DllOpen("user32.dll") $hGUI = GUICreate("Test", 500, 500) $cInput = GUICtrlCreateInput(100, 10, 10, 200, 20) GUICtrlCreateUpdown($cInput) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE DllClose($hDLL) Exit EndSwitch If _IsPressed("26", $hDLL) Then ; Up GUICtrlSetData($cInput, GUICtrlRead($cInput) + 1) Sleep(100) ElseIf _IsPressed("28", $hDLL) Then ; Down GUICtrlSetData($cInput, GUICtrlRead($cInput) - 1) Sleep(100) EndIf WEndGood enough - or do we have to get fancy? M23 Syxguns 1 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...
mrider Posted June 24, 2014 Share Posted June 24, 2014 (edited) The easiest way is to use _IsPressed: Or else using $UDS_ARROWKEYS #include <GUIConstantsEx.au3> #include <UpdownConstants.au3> $hGUI = GUICreate("Test", 500, 500) $cInput = GUICtrlCreateInput(100, 10, 10, 200, 20) GUICtrlCreateUpdown($cInput, $UDS_ARROWKEYS) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd [EDIT] I kept leaving in the DLL stuff... Edited June 24, 2014 by mrider iamtheky 1 How's my riding? Dial 1-800-Wait-There Trying to use a computer with McAfee installed is like trying to read a book at a rock concert. Link to comment Share on other sites More sharing options...
iamtheky Posted June 24, 2014 Share Posted June 24, 2014 I vote that should be default behavior, and you should have to specify $UDS_NoArrowKeys ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 24, 2014 Moderators Share Posted June 24, 2014 mrider,Nice catch - learnt something new (again)! 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...
Mic Posted June 24, 2014 Author Share Posted June 24, 2014 Thanks for the working examples. I am using $UDS_ARROWKEYS from within ISN AutoIt Studio where arrow keys are not changing control values .... the working example will allow me to debug this - thanks again! Link to comment Share on other sites More sharing options...
Mic Posted June 24, 2014 Author Share Posted June 24, 2014 removing ISN from the equation for the moment and using the $cinput example above, I can set the default with GUICtrlSetData($cinput, 5) but GUICtrlSetLimit( $cinput, 30, 0) does not set the max and min for this control ... it's 'cos I'm old, right? :-) Link to comment Share on other sites More sharing options...
mrider Posted June 24, 2014 Share Posted June 24, 2014 (edited) That fails because you are setting the limit on the input box, not the up/down control. BAD: #include <GUIConstantsEx.au3> #include <UpdownConstants.au3> $hGUI = GUICreate("Test", 500, 500) $cInput = GUICtrlCreateInput(10, 10, 10, 200, 20) GUICtrlCreateUpdown($cInput, $UDS_ARROWKEYS) GUICtrlSetLimit($cInput, 30) GUICtrlCreateButton("Button", 10, 60) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd GOOD: #include <GUIConstantsEx.au3> #include <UpdownConstants.au3> $hGUI = GUICreate("Test", 500, 500) $cInput = GUICtrlCreateInput(10, 10, 10, 200, 20) GUICtrlCreateUpdown($cInput, $UDS_ARROWKEYS) GUICtrlSetLimit(-1, 30) GUICtrlCreateButton("Button", 10, 60) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Edited June 24, 2014 by mrider How's my riding? Dial 1-800-Wait-There Trying to use a computer with McAfee installed is like trying to read a book at a rock concert. Link to comment Share on other sites More sharing options...
mrider Posted June 24, 2014 Share Posted June 24, 2014 Two other things to keep in mind: You might consider $ES_NUMBER as part of the style in the input field. GUICtrlSetLimit won't block direct input into the text field, you'll need to enforce that yourself. Unless someone knows something about up/down controls that I don't - which is a distinct possibility. A better version: #include <GUIConstantsEx.au3> #include <UpdownConstants.au3> #include <GuiEdit.au3> Global Const $MIN = 0 Global const $MAX = 30 $hGUI = GUICreate("Test", 500, 500) $cInput = GUICtrlCreateInput("10", 10, 10, 200, 20, $ES_NUMBER) GUICtrlCreateUpdown($cInput, BitOR($UDS_ARROWKEYS, $UDS_NOTHOUSANDS)) GUICtrlSetLimit(-1, $MAX, $MIN) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch Local $value = Number(GUICtrlRead($cInput)) If $value < $MIN Then GUICtrlSetData($cInput, $MIN) ElseIf $value > $MAX Then GUICtrlSetData($cInput, $MAX) EndIf WEnd How's my riding? Dial 1-800-Wait-There Trying to use a computer with McAfee installed is like trying to read a book at a rock concert. Link to comment Share on other sites More sharing options...
Mic Posted June 26, 2014 Author Share Posted June 26, 2014 Thanks for all the info - all works without ISN's attempt to automatically do this with "click and point" - am coding UpDowns manually. 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