This is a status control which is great for dashboards to show multiple live status items and alert users to values outside normal thresholds.
It shows a different picture depending on 3 runtime properties:
- The control's value
- A 'warning' threshold
- A 'danger' threshold
If the danger threshold is greater than the warning threshold (a higher value indicates bad, low value is good) then:
If the control value < Warning then it shows the OK picture
If the control value >= Warning and < Danger then it shows the Warning picture
If the control value >= Danger then it shows the Danger picture
If the danger is set below the warning threshold then the operation is reversed (a low value indicates bad, high value is good)
If the control value > Warning then it shows the OK picture
If the control value <= Warning and > Danger then it shows the Warning picture
If the control value <= Danger then it shows the Danger picture
I know you can do this with pictures, labels and rules, but if you want to put more than a couple on a form it gets tedious. With this control you just set the threshold properties accordingly and everything else is done for you.
For the blank image sets (Discs/Squares) the value can be placed in the centre of the image (using Label Position property).
If you wish to use your own image sets, then you will need a smartobject which contains an identifier named ID plus 3 mandatory columns - OK, Warning, Danger. It doesn't matter if there are additional columns in the smartobject. These need to resolve to base64 images. I have included a package (in the 0.2 version) which has a smartbox table with 9 more imagesets. To use these custom image sets, simply set the Image Set property to 'SMO (below)' and then use the SMO Name property to set the SMO to use and SMO Index property to reference the smartobject row to get the image data from.
If you have images you would like to use, then you can convert the image to base64 using a utility, code or one of the numerous web sides which do it. I used https://www.base64-image.de/ for mine.
Please feed back any comments.
Enjoy.
Restrictions:
- Currently it will only use smartobjects located on 'localhost'. I intend to remove that restriction for a proper release.
- The custom attributes of the label don't show up in the designer preview