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,093 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:
Erel B4X founder Staff member Licensed User Longtime User Mar 12, 2019 #21 Works fine here. Tested with B4A. Can you upload a project that demonstrates this issue?
L loonet Member Licensed User Mar 12, 2019 #22 Erel said: Works fine here. Tested with B4A. Can you upload a project that demonstrates this issue? Click to expand... Thanks Erel for your rapid answer, I forgotten to set the Alpha to zero... Gauge works fine !!
Erel said: Works fine here. Tested with B4A. Can you upload a project that demonstrates this issue? Click to expand... Thanks Erel for your rapid answer, I forgotten to set the Alpha to zero... Gauge works fine !!
dimasarfin New Member Licensed User Jun 29, 2019 #23 hi erel i have some problem when i debug in my phone. im tested in B4A
DonManfred Expert Licensed User Longtime User Jun 29, 2019 #24 dimasarfin said: hi erel i have some problem when i debug in my phone. im tested in B4A Click to expand... 1. You should always start a new thread for your questions. 2. You should post errors as TEXT. Rightclick to copy it
dimasarfin said: hi erel i have some problem when i debug in my phone. im tested in B4A Click to expand... 1. You should always start a new thread for your questions. 2. You should post errors as TEXT. Rightclick to copy it
Alberto Iglesias Well-Known Member Licensed User Longtime User Nov 16, 2019 #25 Is possible to put this gauge in a Customlistview and attribute the value for each one, like this? Code: Copy Dim objGauge As Gauge = p.GetView(0) objGauge.CurrentValue=dTemperture because on the first line says: TYPES DO NOT MATCH
Is possible to put this gauge in a Customlistview and attribute the value for each one, like this? Code: Copy Dim objGauge As Gauge = p.GetView(0) objGauge.CurrentValue=dTemperture because on the first line says: TYPES DO NOT MATCH
DonManfred Expert Licensed User Longtime User Nov 16, 2019 #26 Alberto Iglesias said: because on the first line says: TYPES DO NOT MATCH Click to expand... do you have another Variable or Class/Activity/Service named objGauge which is not of type Gauge?
Alberto Iglesias said: because on the first line says: TYPES DO NOT MATCH Click to expand... do you have another Variable or Class/Activity/Service named objGauge which is not of type Gauge?
Alberto Iglesias Well-Known Member Licensed User Longtime User Nov 16, 2019 #27 nope! is a simple project with customlistview with gauge in each row of CLV. and then try to change the value of each gauge. you will see this TYPE DO NOT MATCH
nope! is a simple project with customlistview with gauge in each row of CLV. and then try to change the value of each gauge. you will see this TYPE DO NOT MATCH
Erel B4X founder Staff member Licensed User Longtime User Nov 17, 2019 #28 Custom views classes are not views by themselves. Make those changes in the class: 1. Make mBase a public variable - line 21. 2. Add this line to DesignerCreateView after mBase is set: Code: Copy mBase.Tag = Me Now you can get reference to the gauge class like this: Code: Copy Dim objGague As Gauge = p.GetView(0).Tag
Custom views classes are not views by themselves. Make those changes in the class: 1. Make mBase a public variable - line 21. 2. Add this line to DesignerCreateView after mBase is set: Code: Copy mBase.Tag = Me Now you can get reference to the gauge class like this: Code: Copy Dim objGague As Gauge = p.GetView(0).Tag
Alberto Iglesias Well-Known Member Licensed User Longtime User Nov 17, 2019 #29 @Erel, thank you! I will make the changes right now!
Alberto Iglesias Well-Known Member Licensed User Longtime User Nov 17, 2019 #30 Erel said: Custom views classes are not views by themselves. Make those changes in the class: 1. Make mBase a public variable - line 21. 2. Add this line to DesignerCreateView after mBase is set: Code: Copy mBase.Tag = Me Now you can get reference to the gauge class like this: Code: Copy Dim objGague As Gauge = p.GetView(0).Tag Click to expand... Works like a charm! thanks @Erel
Erel said: Custom views classes are not views by themselves. Make those changes in the class: 1. Make mBase a public variable - line 21. 2. Add this line to DesignerCreateView after mBase is set: Code: Copy mBase.Tag = Me Now you can get reference to the gauge class like this: Code: Copy Dim objGague As Gauge = p.GetView(0).Tag Click to expand... Works like a charm! thanks @Erel
F foretek Member Licensed User Dec 27, 2019 #31 Some gauges require the warning(orange) and alarm (red) at low end area . e.g. fuel tank.. can this indication be customizable?
Some gauges require the warning(orange) and alarm (red) at low end area . e.g. fuel tank.. can this indication be customizable?
M Mahares Expert Licensed User Longtime User Dec 27, 2019 #32 foretek said: can this indication be customizable? Click to expand... Code: Copy Gauge1.SetRanges(Array(Gauge1.CreateRange(70, 80, xui.Color_yellow), _ Gauge1.CreateRange(80, 100, xui.Color_green)))
foretek said: can this indication be customizable? Click to expand... Code: Copy Gauge1.SetRanges(Array(Gauge1.CreateRange(70, 80, xui.Color_yellow), _ Gauge1.CreateRange(80, 100, xui.Color_green)))
swChef Active Member Licensed User Longtime User Apr 5, 2020 #33 I combined this with (an offsetted) radial gradient to get a highlighted edge effect. Incomplete project, so a few details left to adjust. Last edited: Apr 6, 2020
I combined this with (an offsetted) radial gradient to get a highlighted edge effect. Incomplete project, so a few details left to adjust.
A Aidan Ruff Member Licensed User Longtime User Sep 27, 2020 #34 Any idea how would I use this with b4i? Thanks
Erel B4X founder Staff member Licensed User Longtime User Sep 29, 2020 #35 Exactly the same as you use it in B4J or B4A.
A Aidan Ruff Member Licensed User Longtime User Sep 29, 2020 #36 Erel said: Exactly the same as you use it in B4J or B4A. Click to expand... Sorry, I'm having mental problems here! Is it an additional library? I can see the example but not how to incorporate it into a program
Erel said: Exactly the same as you use it in B4J or B4A. Click to expand... Sorry, I'm having mental problems here! Is it an additional library? I can see the example but not how to incorporate it into a program
Erel B4X founder Staff member Licensed User Longtime User Sep 29, 2020 #37 It is a class (it was written before the simple b4xlib format was available). Project - Add Existing Modules.
It is a class (it was written before the simple b4xlib format was available). Project - Add Existing Modules.
klaus Expert Licensed User Longtime User Sep 29, 2020 #38 Have you seen the xGauges class and b4xlib? It is another chart library. Last edited: Sep 29, 2020
S stephans Member Licensed User Nov 21, 2020 #39 Hello, the gauge view looks very interesting for me and I would like to use it in my Android app. The sample file works, but how can I implement the class in my app Can everybody help me? Thanks in advance Stephan
Hello, the gauge view looks very interesting for me and I would like to use it in my Android app. The sample file works, but how can I implement the class in my app Can everybody help me? Thanks in advance Stephan
klaus Expert Licensed User Longtime User Nov 21, 2020 #40 Copy the Gauges.bas file to your project. Menu Project/AddExistingModules. Then, you can add the Gauges in the Designer.
Copy the Gauges.bas file to your project. Menu Project/AddExistingModules. Then, you can add the Gauges in the Designer.