SpinBar Precision
Posted
#1
(In Topic #1162)
Regular

I have a project where I want to set the percision (number of decimal places) on a SpinBar to 4 (aka 0.0001). No matter what I do I can't get it work. It usually just gives me 3 places instead (0.001) or sometimes even resets it to zero places (0).
My end goal is to have the precision set at run time depending on the measuring units the user wants to use. Thus if the user wants to enter the value in millimeters, the SpinBox will have a range of 0.000 to 0.400, or if using inches then the SpinBox will have a range of 0.0000 to 0.0160.
In my program I have tried setting the SpinBox directly with values for Max and Step without success. Thinking it might be Gambas assuming I am using a different datatype, I tried the following:
But again, no success. Any ideas?
Posted
Guru

<IMG src="https://www.cogier.com/gambas/SpinBarReplacement.png">
</IMG>Code (gambas)
- BuildControl
- LabelText.Text = "Select value "
- .Arrangement = Arrange.Vertical
- .Padding = 5
- .W = 500
- .H = 50
- .H = 28
- .Padding = 5
- .maxValue = 4000
- .MinValue = 0
- .W = 75
- .Padding = 5
- .Text = "0.0000"
Posted
Regular

By manipulating the "SpinBar" Control a bit, I got :? this:PartierSP said
a range of 0.0000 to 0.0160.
Code (gambas)
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Regular

I have done very little work on custom controls so these techniques are little new to me.
Posted
Regular

Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
1 guest and 0 members have just viewed this.


