Suppir Posted November 11, 2009 Share Posted November 11, 2009 (edited) I need to create digits-only input with up-down with maximum range from 0 to 999999999999 (12 digits) My code: $Input1 = GUICtrlCreateInput("0", 395, 35, 96, 21, BitOR($ES_AUTOHSCROLL,$ES_NUMBER)) $Updown1 = GUICtrlCreateUpdown($Input1) GUICtrlSetLimit($Input1, 12) GUICtrlSetLimit($Updown1, 999999999999, 0) but maximum value of up-down is restricted to 32767. How to set higher value with up-down? Edited November 11, 2009 by Suppir Link to comment Share on other sites More sharing options...
water Posted November 11, 2009 Share Posted November 11, 2009 (edited) GUICtrlSetLimit "limits the number of characters/pixels for a control." So "GUICtrlSetLimit($Updown1, 4, 1)" does not mean that you can only enter the values 1,2,3,4. It means that you can enter values with a LENGTH between1 and 4 characters. Please search the forum. There are scripts available that limit the values you can enter. Edited November 11, 2009 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Suppir Posted November 11, 2009 Author Share Posted November 11, 2009 (edited) GUICtrlSetLimit "limits the number of characters/pixels for a control."I know it. I setGUICtrlSetLimit($Input1, 12) to prevent manual entering more than 12 digits. And I setGUICtrlSetLimit($Updown1, 999999999999, 0)to up-down between zero and 999999999999 (to exlude negative digits)BUTup-down is stopping on 32767. And deny go higher. I think, problem is in memory type. Can not solve it. Edited November 11, 2009 by Suppir Link to comment Share on other sites More sharing options...
whim Posted November 11, 2009 Share Posted November 11, 2009 I know it. I setGUICtrlSetLimit($Input1, 12) to prevent manual entering more than 12 digits. And I setGUICtrlSetLimit($Updown1, 999999999999, 0)to up-down between zero and 999999999999 (to exlude negative digits)BUTup-down is stopping on 32767. And deny go higher. I think, problem is in memory type. Can not solve it.Why not just drop the up/down, it's gonna take days (weeks?) anyway to go from 0 -> 999999999999 whim Link to comment Share on other sites More sharing options...
Suppir Posted November 11, 2009 Author Share Posted November 11, 2009 (edited) Why not just drop the up/down, it's gonna take days (weeks?) anyway to go from 0 -> 999999999999 whimYou know, this Input is needed to adjust some $variable by -1 or +1.But $variable can be 8 or 9-digit length.Example:$var=23812345I need to up and down (want to get 23812346, 23812347) this variable in Input.But up/down does not allow me set values greather than 32767How to do this? Edited November 11, 2009 by Suppir Link to comment Share on other sites More sharing options...
water Posted November 11, 2009 Share Posted November 11, 2009 It's a limitation of GUICtrlCreateUpdown. Try the following script and you'll see that you can't go beyond 32767. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $title, $input, $updown, $msg $title = "My GUI UpDown" GUICreate($title, -1, -1, -1, -1, $WS_SIZEBOX) $input = GUICtrlCreateInput(32769, 10, 10, 100, 20) $updown = GUICtrlCreateUpdown($input) GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 11, 2009 Moderators Share Posted November 11, 2009 Suppir, Why not write your own up-down? It is not difficult - peek here if you have problems: #include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) $hInput = GUICtrlCreateInput("555555555", 10, 10, 200, 20) $hButton_Up = GUICtrlCreateButton("5", 210, 10, 20, 10) GUICtrlSetFont(-1, 10, 400, 0, "Webdings") ; "5" = ^, "6" = v $hButton_Dn = GUICtrlCreateButton("6", 210, 20, 20, 10) GUICtrlSetFont(-1, 10, 400, 0, "Webdings") GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hButton_Up $iTemp = GUICtrlRead($hInput) If $iTemp < 999999999999 Then GUICtrlSetData($hInput, $iTemp + 1) Case $hButton_Dn $iTemp = GUICtrlRead($hInput) If $iTemp > 0 Then GUICtrlSetData($hInput, $iTemp - 1) EndSwitch WEnd 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...
Suppir Posted November 11, 2009 Author Share Posted November 11, 2009 It's a limitation of GUICtrlCreateUpdown. Try the following script and you'll see that you can't go beyond 32767.Yes, I know - this is a limitation. And I ask how to pass through this limitation. (Sorry my English...) Link to comment Share on other sites More sharing options...
Suppir Posted November 11, 2009 Author Share Posted November 11, 2009 (edited) Melba23 - very thanks! I'm new to AutoIt and your code will help me much. And I ask authors of AutoIt to make possible changing this limitation. Edited November 11, 2009 by Suppir Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 11, 2009 Share Posted November 11, 2009 And I ask authors of AutoIt to make possible changing this limitation.The limitation in a native Windows UpDown control does not come from AutoIt. The values for upper and lower limit are packed together into a single LONG type (32-bits). So each is limited to 16-bits, and is signed, so the values range from -32K to +32K. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Suppir Posted November 12, 2009 Author Share Posted November 12, 2009 PsaltyDS, yes, it is understood. GUICtrlEdit is also have limits (32 kb of text) - and this is really tiny amount of data. You can not load little txt-file in GUICtrlEdit. But it is possible to change this limit of GUICtrlEdit. As for up-down control - I just showed an practical example where limit to 32767 is really not enough: I have item-ID in database, and this item may be from 1 to 9-digits long. And I need up-down this ID in GUI. I think other people may have the same problem. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 12, 2009 Moderators Share Posted November 12, 2009 Suppir,As PSaltyDS told you, it a Windows limitation, so how do you expect the AutoIt Devs to change it? I do not think MS will alter their API just for you. What is wrong with using the user-drawn version I showed you above?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...
Suppir Posted November 12, 2009 Author Share Posted November 12, 2009 Suppir,As PSaltyDS told you, it a Windows limitation, so how do you expect the AutoIt Devs to change it? I do not think MS will alter their API just for you. What is wrong with using the user-drawn version I showed you above?M23Your version is very nice (I used it in my script). Link to comment Share on other sites More sharing options...
Bert Posted November 12, 2009 Share Posted November 12, 2009 You know, you could just have a series of one digit fields with each of them having a up-down control on them. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
PenDragyn21 Posted December 21, 2009 Share Posted December 21, 2009 For anyone else who may be looking for a solution to this I made a function that allows an input box with an up/down control to contain a value greater than 32767. Func _GUICtrlUpdownSetRange32($h_updown=0, $i_Low=-999999, $i_High=999999) ; Windows message ID for the UDM_SETRANGE32 message ; UDM_SETRANGE32 - Sets the 32-bit range of an up-down control. ; http://msdn.microsoft.com/en-us/library/bb759968%28VS.85%29.aspx Const $UDM_SETRANGE32 = $WM_USER+111 GUICtrlSendMsg($h_updown, $UDM_SETRANGE32, $i_Low, $i_High) EndFunc This sets the range to a default of -999999/999999 but I believe the Low and High values can be any value less than (2^32)-1. 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