Android Tutorial [B4X] B4XPlusMinus - Spinner / wheel alternative

B4XPlusMinus is a cross platform control introduced in XUI Views v2.05: https://www.b4x.com/android/forum/threads/b4x-xui-views-cross-platform-views-and-dialogs.100836/

SS-2019-04-29_13.26.45.png


As you can see in the above image it supports three different formations: horizontal, vertical and bottom. The bottom formation is useful with smaller controls to prevent the user finger from hiding the value.

There are two ways to set the values:

SetStringItems - A list or array with the items:
B4X:
pm.SetStringItems(Array("aaa", "bbb"))
SetNumericRange - A numeric range:
B4X:
pm.SetNumericRange(1, 100, 2) '1 - 100 with interval of 2.

Numeric values are converted to strings with the help of B4XFormatter.
The controls color and text size is set with the designer. Other options:
SS-2019-04-29_13.31.46.png


Cyclic - Whether to move to the first item after the last item.
Rapid - Whether to allow rapid changes with long clicks. Note that you can change the durations used for the rapid effect (RapidPeriod1 and RapidPeriod2 fields - default values are 1000ms and 30ms).

Example is attached.
 

Attachments

  • B4XPlusMinusExample.zip
    11.8 KB · Views: 1,958

sigster

Active Member
Licensed User
Longtime User
Hi

is this right way to change arrow size then nothing happend

or is ArrowsSize not size of button

B4XPlusMinus3.ArrowsSize = 50
 
Last edited:

irda

Member
Licensed User
Longtime User
Hello everybody.

I'm looking for a control equivalent to a numericalupdown and this one almost worked for me. This looks like but does not allow manual entry of numbers. Can the "click" event be added in some way to associate an input dialog with it?
Do you know of any control that allows manual input and limits the input range and behaves like this control?
Thanks.
 
Top