B4J Question Lack of basic controls

DMW

Member
Licensed User
Longtime User
Hello,

I decided to give B4J a try so I built a desktop application where I tried to explore almost everything with B4J.

The general impression is five stars out of five. It's easy to work with and it's similarity with B4A is indeed a booster for me with my background in VB (and B4A).

However, as a desktop application developer for the last 30 years I got curious to learn about the lack of controls. Coming from the Microsoft eco-system I have been used to since Win32 to have access to certain controls which I classify as basic controls.

The two controls I miss is the Spinner Control and the Toolbar Control. Are there any chances that they will be added (native to B4J or via the jControlFX plugin)?

Take this opportunity to say keep up the good work!

Thanks,
Dennis
 

DMW

Member
Licensed User
Longtime User
Even if it's for non-profitable organizations I develop end-user applications for I still want to achieve the goal of being user friendly UI.
It's something that some developers forget, that the products we create are supposed to be used by other users.

So when I write I miss ... it's not that I cannot see any other options... But it's to try to provide with solutions that they can use :)
 
Upvote 0

DMW

Member
Licensed User
Longtime User
Screen shot
Thanks for the input so far. Since JavaFX Scene Builder use the name "Spinner" for the control I assumed it was the de facto name for the control. To avoid any further questions about what controls I discuss I enclose a screen shot of the Desktop App I have been working with while exploring B4J.

The Spinner Control
I have managed to implement via code a Spinner Control. But since I have not yet found any solution to make it editable as well, i e allow the user write directly the numbers I find it, at this stage, limited. At present the arrows works as expected.

The workaround of using a text field control and a slider control is doable (with a control sub that controls only integers can be written in the textfield). But for me it's a primitive solution and take up space. Of course, a combo box can be used but only together with a very limited items.

The Toolbar Control
In my experiences user use the buttons best if both an image + text is available for each button. I know that for the Desktop the standard is image + tooltip but.

#1 Pane/ImageViews/Images
Time consuming to get the position right for each image, especially if the number of buttons increase. I have not been able to find a solution where the click on an image is "visualized". I have been able to switch cursor type when hovering over each image. Not tested to see if I can get image + text buttons.

#2 Standalone ImageViews/Images
The difference compared with #1 is that here I can get the click on an image to be "visualized". Not tested to see if I can get image + text buttons.

#3 Statusbar/Buttons
Compared with #1 and 2# this approach works best. The click on the image is "visualized" for the user. I can even add image + text on each button. But when we look we see that the images are too far top and text too close to the center. I have played around with image's and text's sizes to no avail.

Another personal point is that I'm not happy with "workarounds" as they, sooner or later, tend to come back and bite me.

Thanks again for all input and all the best,
Dennis
 

Attachments

  • licman.png
    licman.png
    54.4 KB · Views: 319
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
Re: Editable spinner
B4X:
    jo.InitializeNewInstance("javafx.scene.control.Spinner",Array(1,10,5))
    jo.RunMethod("setEditable",Array(True))
Note The enter key must be pressed after entering number to re-sync the control and the value. Also there is no cursor shown in the control initially unless you TAB to the control.
 
Last edited:
Upvote 0

jmon

Well-Known Member
Licensed User
Longtime User
To set your button images, try this:
https://www.b4x.com/android/forum/threads/how-to-add-an-icon-to-a-button-via-code.57733/#post-363608

Then on the css of your button you need to set a padding:
B4X:
CSSUtils.SetStyleProperty(btn, "-fx-padding", "4px")
Setting the padding with CSSUtils is the recommended method.

By the way, this is not a workaround, this is the way it has to be done.

[edit]Just a suggestion: I suggest removing your toolbar, as it seems not so important. You could use tooltips as the help for each node, the info button could be moved to you "about" tab, exit & save could be in a menu, or just by clicking the "X"button at the top right
 
Last edited:
Upvote 0

DMW

Member
Licensed User
Longtime User
Thanks for Your input which works great :)

My basic approach for this app is to explore as much features as possible in B4J. Practically I fully agree with You.
 
Upvote 0
Top