B4J Library [B4X] [XUI] xGauges Class

klaus

Expert
Licensed User
Here is version 0.9 of a new class xGaugesRect.
Instead of adding the rectangular gauges to the current circular ones I made a new class.
It is easier for users because of the new specific properties which would overcrowd the current class.
For the moment, it works only with B4J and B4A, I have problems with B4i and BitmapCreator.

B4J
1596464567844.png
B4A
1596464727934.png


I would be pleased to have some beta testers.

Attached the class module and a demo project.
 

Attachments

klaus

Expert
Licensed User
Hi Erel, I already had in mind to write a small project (the class has more than 1000 lines )showing the problem, try to understand what happens and submit it to you.
 

Diceman

Active Member
Licensed User
Klaus, the gauges look really good. The silver gradient makes it look real.
Suggestions: It would be nice to be able to have NeedleShadowColor & CursorShadowColor (or at least some sort of outline) so it gives some depth to these 2 important indicators. This will give the needle and cursor some relief from the background so they appear to be separate from the background as if floating above the background.

Problem. I haven't found anything wrong with your code, but the sample B4J form is acting kind of weird (release mode and debug mode). I loaded xGuagesRect.B4j into B4J v8.50 and ran it. A blank form appeared with no controls on it. No errors were reported. I ran the designer and saw the 3 xGaugesRect views. I resaved the form and reran it. Same thing; blank form appears. I went back into Designer and moved the gauges around and resaved it, thinking it would update the form. When I reran the sample app it still displayed a blank form. I solved the problem by going back into the Designer and dropping a label somewhere on the form. Recompiling it and running it showed the gauges working just fine. It appears to me that a regular view has to be on the form otherwise B4J won't display the gauges at all. I went back into Designer and deleted the Label view and when I ran the app the form was blank again. Adding the Label back on the form got the form to display the gauges again. I told you it was weird.

In B4A you have Layout.bal in the Files manager and its not needed. B4A complains when the app is loaded that Layout.bal is missing. I removed Layout.bal in the Files Manager and the app ran just fine. No problem like I had with B4J. Looks good in Android.

That's it from me, at least for now. The gauges look really professional and will save a lot of screen space.
Rect gauges are slim and trim (conserves space). If you have more than 1 round gauge they are fat and need a lot of screen space to display properly.
Once you've gone Rect, you'll never go back (to Round). :D
 

klaus

Expert
Licensed User
Your blank screen sounds very strange.
I develop with B4J version 8.50 like you.
I added shadows, but not yet convinced.
Can you please check the attached version, I post only the B4J demo program.
 

Attachments

Last edited:

Diceman

Active Member
Licensed User
Your blank screen sounds very strange.
I develop with B4J version 8.50 like you.
I added shadows, but not yet convinced.
Can you please check the attached version, I post only the B4J demo program.
Klaus,

I tried your example and the shadows do appear, but like you implied they look flat without any dimension to them.
I looked around for a solution and found JordiCP's suggestion #13 for creating shadows at this link Neumorphism UI - how would you do this

Would this work?
 

rodmcm

Active Member
Licensed User
Is it possible to redraw a guage with a change of Max and Min value in code
I would like to use guage.click to change the range.. An option is of course to have a another hidden quage appear I suppose
 
Top