Sign in to follow this  
Followers 0
vincentg

updown limits

4 posts in this topic

In an updown, I just want to set the minimum value. But, because I can only set a minimum value after i set a maximum value, i tried to set the maximum value to "Default". The updown acts really strange when it's maximum is set to Default. The maximum value becomes 1 and the minimum -1 (minimum is set to 1), and if i click on the upper arrow (on the updown) it decreases and when i click on the down arrow it increases. When i try to set the maximum value to a high value (like 40000) It acts the same except for the minimum value, which is now much lower value (-25.536 when max is set to 40000).

What do I do wrong, or does there exists any other way to just set the minimum and not the maximum to an updown?

Vincent

Share this post


Link to post
Share on other sites



In an updown, I just want to set the minimum value. But, because I can only set a minimum value after i set a maximum value, i tried to set the maximum value to "Default". The updown acts really strange when it's maximum is set to Default. The maximum value becomes 1 and the minimum -1 (minimum is set to 1), and if i click on the upper arrow (on the updown) it decreases and when i click on the down arrow it increases. When i try to set the maximum value to a high value (like 40000) It acts the same except for the minimum value, which is now much lower value (-25.536 when max is set to 40000).

What do I do wrong, or does there exists any other way to just set the minimum and not the maximum to an updown?

Vincent

You cannot set higher than 0x7fff, or lower than -0x7fff and the difference between the min and max cannot be more than 0x7fff

0x7fff = 32767 so your choice of 40000 was a bit unlucky.

see this


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

hmm.. is there any other way to set just a minimum?

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

hmm.. is there any other way to set just a minimum?

Presumably you don't know what the maximum value is otherwise you could simply set the minimum using GUICtrlSetLimit($UpDown, $UDMax,$UDMin).

So here is the way to find the max and min values for an updown control called $Updown1

Const $UDM_GETRANGE = (0x400 + 102)

$range = GUICtrlSendMsg($Updown1,$UDM_GETRANGE,0,0 )

$UDMax = BitAnd($range,0xffff)

$UDMin = BitAND(Bitrotate($rr,16,"D"),0xffff)

Edit:simplified the calcs a bit

Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0