B4J Question (Solved) Fixing my design problem...

BlueVision

Active Member
Licensed User
Longtime User
Sample.png


The fields I have coloured yellow in the picture are to be filled with numbers. A logic then checks the values for dependencies on each other. The actual problem in this case is a design problem. The application is a B4J-application and will later run on laptops, netbooks and tablets.
How can I select the individual fields and fill them with numbers without adding additional controls to the layout (+/- buttons or similar)? These controls would only cause confusion.

1st variant:
Left-click with the mouse to increment the numerical value in the field. A right click with the mouse decrements the value.
But how do you create a right click on a tablet without a keyboard?

2nd variant:
A single click with the mouse creates the increment, a double click the decrement. This could also work with a tablet.

3rd variant:
A single additional control element is built in (+/- button). The element to be filled is selected and marked in some way (tag value or similar). Then the value is changed with the control element.

Does anyone else have another and, above all, more intuitive idea?

Looking forward to your solutions for this problem...

Cheers from Berlin, BV
 

stevel05

Expert
Licensed User
Longtime User
What is the range of the values that can be entered?

Some other options:

On click / touch, open a popup (just a pane / panel with the numbers, or in a customlistview if too many not to be scrolled) to allow the numbers to be selected.

On drag on the box, if dragged up (or maybe to the right) increment the number, and decrement the other way. May not be too easy on a small screen with a finger.

On touch / click, show that the box is selected and have one global button pair (+/-) also selected / highlighted to control the values, situated above, or below the boxes.

I don't think you necessarily need to have the same method on all platforms, as long as it is obvious what is expected.
 
Upvote 0

BlueVision

Active Member
Licensed User
Longtime User
What is the range of the values that can be entered?

Thank you for your answer.
Values should not raise above 10.
Agree completely with your way of thinking...
Easy to understand, the amount of controls decreased to a minimum.
On Android there is another option a click/longclick, but this is B4J, so I think this is not an option.

I like your idea with the pop-up:
Click on the field in which the value is to be entered, a number array becomes visible. Select the number there, the number array disappears and the choosen value is entered in the first selected field. Two clicks, that's all!
 
Last edited:
Upvote 0

stevel05

Expert
Licensed User
Longtime User
If you use the mouseclicked event, you can capture a right click from the passed event object.
 
Last edited:
Upvote 0

BlueVision

Active Member
Licensed User
Longtime User
If you use the mousclicked event, you can capture a right click from the passed event object.
I do exactly this:
This routine is returns an increase with a single click, a double click will decrease and is additionally freezing the value at a minimum of one.
The remarked (commented) part does the same with the right mouse button. But right clicking on a tablet without mouse and keyboard...

B4X:
    If EventData.ClickCount = 1 And EventData.PrimaryButtonPressed = True Then
        Amount = Amount + 1
        LAmount.Text = Amount
    End If
   
    If EventData.ClickCount = 2 And EventData.PrimaryButtonPressed = True Then
        Amount = Amount - 2
        If Amount < 1 Then Amount = 1
        LAmount.Text = Amount
    End If
 
'    If EventData.SecondaryButtonPressed =True Then
'        If Amount > 1 Then Amount = Amount - 1
'        LAmount.Text = Amount
'    End If
 
Upvote 0

BlueVision

Active Member
Licensed User
Longtime User
Steve, this is especially for you...
I followed your idea and built a sliding panel. This is moving out if you tab (tablet) or click (mouse) on one of the 15 grey fields on the right of the screenshot.
Then you simply have to choose a number from the numberpane, this fills the choosen value into the grey field you tapped previously. Works like a charm without using the keyboard. (There is no need of values above 15 in this case).

Thank You very much!

Sample.jpg
 
Upvote 0
Top