B4J Library [ABMaterial]: Exploring rwblinn's CustomCanvasKnobEx

Hi there

After some curiosity about what rwblinn did on this component, I explored everything about it. It turns out there is a little bitsy additional eye candy, for me personally the Angle Arch and the Cursor property and the thickness of the dials.

So whats can be done new?

1. Ability to change the colors depending on values (DifferentColors = True) i.e. the colors will change between blue, red and green as you rotate the dial.
2. Set the value of the knob
3. Added a Refresh method to the knob
4. Added a Release call for the knob
3. Additional properties e.g. thickness turned on.

MashDial.png

Thanks to rwblinn for wrapping this for ABMaterial, I like it much.

The actual video footage..


PS: I was nicely surprised that someone actually did a B4A webview version of this back in 2012 using WebViewExtras. Cool.
 
Last edited:

Mashiane

Expert
Licensed User
Longtime User
What's coming:

Added additional property to make the knob/dial read only. This could be useful if one just wants to display the information without reading it back. You make it readonly by setting .ReadOnly = True.

Playing around with the AngleOffset and AngleAr provided some good eye candy.


MashDial.png


B4X:
Dim knob6 As MashDial
    knob6.Initialize(page,"knob6","250 x -305", "25", "200px","200px","wo")
    knob6.SetAngleArcOffset("250","-305")
    page.Cell(3,1).AddComponent(knob6.ABMComp)
    
    Dim knob7 As MashDial
    knob7.Initialize(page,"knob7","250 x -35", "25", "200px","200px","wo")
    knob7.SetAngleArcOffset("250","-35")
    page.Cell(3,1).AddComponent(knob7.ABMComp)
    
    Dim knob8 As MashDial
    knob8.Initialize(page,"knob8","250 x 145 (ReadOnly)", "25", "200px","200px","wo")
    knob8.SetAngleArcOffset("250","145")
    knob8.ReadOnly = True
    page.Cell(3,1).AddComponent(knob8.ABMComp)
    
    Dim knob9 As MashDial
    knob9.Initialize(page,"knob9","270 x -0", "25", "200px","200px","wo")
    knob9.SetAngleArcOffset("270","-0")
    page.Cell(3,1).AddComponent(knob9.ABMComp)
    
    Dim knob10 As MashDial
    knob10.Initialize(page,"knob10","270 x 90", "25", "200px","200px","wo")
    knob10.SetAngleArcOffset("270","90")
    page.Cell(3,1).AddComponent(knob10.ABMComp)
    
    Dim knob11 As MashDial
    knob11.Initialize(page,"knob11","270 x -0", "100", "200px","200px","wo")
    knob11.SetAngleArcOffset("270","-0")
    knob11.Tron = True
    knob11.thickness = "0.2"
    page.Cell(3,1).AddComponent(knob11.ABMComp)
    
    Dim knob12 As MashDial
    knob12.Initialize(page,"knob12","250 x -125", "100", "200px","200px","wo")
    knob12.SetAngleArcOffset("250","-125")
    knob12.Tron = True
    knob12.thickness = "0.2"
    page.Cell(3,1).AddComponent(knob12.ABMComp)
 

Mashiane

Expert
Licensed User
Longtime User
And now the last updated, finally I cracked it!!!

Ability to add a suffix to the value and also animate the dial..

MashDial.gif


B4X:
Dim knob6 As MashDial
    knob6.Initialize(page,"knob6","250 x -305", "90", "200px","200px","wo")
    knob6.SetAngleArcOffset("250","-305")
    knob6.Suffix = "%"
    knob6.Animated = True
    page.Cell(3,1).AddComponent(knob6.ABMComp)

This has been a very interesting component....

NB: MashDial does not do the clock as it emphasises reporting for dashboards etc...

PS: Have attached my own version, you can customise yours
 

Attachments

  • MashDial.bas
    13.7 KB · Views: 406
Top