Vermont Energy Control Systems

Practical monitoring and control for the real world

Bar and Setbar Widgets

Screenshot of both vertical and horizontal bars screenshot of the code to create a bar bar widget in the menu bar vertical bar widget in the menu bar setbar widget in the menu bar vertical setbar in the menu bar

Both these widgets look the same and have the same parameters. The bar widget is passive and simply displays values graphically relative to a fixed minimum and maximum. The setbar widget will set the value of the associated data element to a value determined by where the bar is clicked. In both cases,there is no numeric value displayed. If a numeric value is desired, place a text widget adjacent to the bar or setbar widget.

Bar graphs have a specified height and width. If the width is greater than the height, then the bar graph is horizontal, increasing to the right. If the height is greater than the width, then the bar is displayed vertically with values increasing upwards.

There are four options for this type of widget in the Custom GUI menu bar: Bar, Vertical Bar, Setbar, and Vertical Setbar. The horizontal and vertical versions of each type of bar function identically, and you can convert an existing bar from one orientation to the other; these options are just for convenience.

Besides the normal five required parameters, the bar widget has seven additional parameters. The first five are required.

Parameter Value in Example Description If Not Present Default
Height 20 Bar height in pixels Required 20 (100 for vertical)
Width 100 Bar width in pixels Required 100 (20 for vertical)
Minimum 0 Minimum scale value Required 0
Maximum 200 Maximum scale value Required 100
Bar Color red Color for the bar Required Green (blue for setbar)
Background Colorwhite Color for the background TransparentLightgreen (lightblue for setbar)
Label Text Horizontal Label text to be displayed to left of widget No label Bar, Vertical Bar, Setbar, or Vertical Setbar