Dec 19, 2017 Replies: 47 This custom view class is compatible with B4A, B4J and B4i. A nice and simple gauge. You can easily customize it as needed. It uses the Crystal font: http://www.fontspace.com/allen-r-walden/crystal There are two types of gauges: half circle and full circle. Usage instructions: - Add the class and the font file to your project. - Add it with the designer and configure it: - Set the colored ranges: Code: Copy Gauge1.SetRanges(Array(Gauge1.CreateRange(0, 40, xui.Color_Green), _ Gauge1.CreateRange(40, 80, xui.Color_Yellow), _ Gauge1.CreateRange(80, 100, xui.Color_Red))) - In B4i the font file should be copied to Files\Special and the following line should be added to the main module: Code: Copy #AppFont: Crysta.ttf - Animations can be a bit jumpy in debug mode. Should be smooth in release mode. A B4A project is attached. See post #10 for adding numbers to the ticks: Attachments Gauges.zip Gauges.zip 19.4 KB · Views: 3,059 Last edited: Dec 24, 2017 Click to expand...
This custom view class is compatible with B4A, B4J and B4i. A nice and simple gauge. You can easily customize it as needed. It uses the Crystal font: http://www.fontspace.com/allen-r-walden/crystal There are two types of gauges: half circle and full circle. Usage instructions: - Add the class and the font file to your project. - Add it with the designer and configure it: - Set the colored ranges: Code: Copy Gauge1.SetRanges(Array(Gauge1.CreateRange(0, 40, xui.Color_Green), _ Gauge1.CreateRange(40, 80, xui.Color_Yellow), _ Gauge1.CreateRange(80, 100, xui.Color_Red))) - In B4i the font file should be copied to Files\Special and the following line should be added to the main module: Code: Copy #AppFont: Crysta.ttf - Animations can be a bit jumpy in debug mode. Should be smooth in release mode. A B4A project is attached. See post #10 for adding numbers to the ticks:
voxel Active Member Licensed User Feb 20, 2021 #42 Hello, is it possible to hide the gauge? I can't find any parameter visible = false Thanks for your help
Hello, is it possible to hide the gauge? I can't find any parameter visible = false Thanks for your help
Erel B4X founder Staff member Licensed User Longtime User Feb 21, 2021 #43 Make mBase as public variable. This is a convention used in most newer custom views. Code: Copy Gauge1.mBase.Visible = False
Make mBase as public variable. This is a convention used in most newer custom views. Code: Copy Gauge1.mBase.Visible = False
voxel Active Member Licensed User Feb 21, 2021 #44 Erel said: Make mBase as public variable. This is a convention used in most newer custom views. Code: Copy Gauge1.mBase.Visible = False Click to expand... I'm a newbie, adding this line: Public mBase As B4XView, it doesn't work Thank
Erel said: Make mBase as public variable. This is a convention used in most newer custom views. Code: Copy Gauge1.mBase.Visible = False Click to expand... I'm a newbie, adding this line: Public mBase As B4XView, it doesn't work Thank
Erel B4X founder Staff member Licensed User Longtime User Feb 22, 2021 #45 You shouldn't add anything. Go to the Gauge class. Look for mBase global variable and change its visibility modifier from private to public.
You shouldn't add anything. Go to the Gauge class. Look for mBase global variable and change its visibility modifier from private to public.
voxel Active Member Licensed User Feb 22, 2021 #46 Erel said: You shouldn't add anything. Go to the Gauge class. Look for mBase global variable and change its visibility modifier from private to public. Click to expand... Thank you very much, it works
Erel said: You shouldn't add anything. Go to the Gauge class. Look for mBase global variable and change its visibility modifier from private to public. Click to expand... Thank you very much, it works
voxel Active Member Licensed User Feb 23, 2021 #47 loonet said: View attachment 78322 Thanks Erel for your rapid answer, I forgotten to set the Alpha to zero... Gauge works fine !! Click to expand... Hello, I have the same problem and I don't have the Alpha Level Parameter. My application has a blue background, which distorts the colors. Is there a parameter to have the real colors in the gauge? Thank you
loonet said: View attachment 78322 Thanks Erel for your rapid answer, I forgotten to set the Alpha to zero... Gauge works fine !! Click to expand... Hello, I have the same problem and I don't have the Alpha Level Parameter. My application has a blue background, which distorts the colors. Is there a parameter to have the real colors in the gauge? Thank you
Erel B4X founder Staff member Licensed User Longtime User Feb 24, 2021 #48 Please start a new thread.