Reference for the Mosaic class WidgetSet::ValueDisplay

WidgetSet::ValueDisplay
Appearance
CurrentBias
CurrentFactor
CurrentValue
NoOfDigits
Outlet
Precision
Unit
Core::Group
AlphaBlended
Buffered
ClipViews
DeriveEnabledState
Embedded
Enabled
Focus
Opacity
Visible
Add()
AddBehind()
BroadcastEvent()
BroadcastEventAtPosition()
CountDialogs()
CountViews()
DismissDialog()
DispatchEvent()
DrawBackground()
DrawForeground()
ExtendClipping()
FadeGroup()
FindActiveDialogByClass()
FindCurrentDialog()
FindDialogByClass()
FindNextView()
FindPrevView()
FindSiblingView()
FindViewAtPosition()
FindViewInDirection()
FindViewWithStackingPriority()
FindViewWithinArea()
GetContentArea()
GetDialogAtIndex()
GetIndexOfDialog()
GetIndexOfView()
GetMaximalSize()
GetMinimalSize()
GetViewAtIndex()
GlobalPosition()
HasViewState()
Init()
InvalidateArea()
InvalidateLayout()
InvalidateViewState()
IsActiveDialog()
IsCurrentDialog()
IsDialog()
LocalPosition()
ObtainFocus()
PresentDialog()
Remove()
RemoveAll()
Restack()
RestackBack()
RestackBehind()
RestackTop()
SwitchToDialog()
UpdateLayout()
UpdateViewState()
Core::RectView
Bounds
Core::View
Layout
Owner
StackingPriority
AdjustDrawingArea()
ArrangeView()
ChangeViewState()
CursorHitTest()
Draw()
GetClipping()
GetExtent()
GetRoot()
HandleEvent()
MoveView()

SEE ALSO

Using and customizing the Value Display widget.

This class implements a 'value display' widget. The widget is intended to display a numerical value together with the associated unit (e.g. °C or Volt). The actual value is determined in the property CurrentValue. Since CurrentValue is 'int32', you can use the properties CurrentFactor and CurrentBias to convert the original value to the expected value range. The conversion follows the equation below:

ValueToDisplay = ( CurrentValue * CurrentFactor ) + CurrentBias

Alternative to modify directly the property CurrentValue, the property Outlet can refer to any other 'int32' property the widget should remain synchronized with. When the referred property is modified by another one, the widget is automatically notified to remain in sync with the property.

This approach follows the Model-View-Controller (MVC) programming paradigm. Here the value display widget represents the 'View' and the property referred via 'Outlet' can be seen as a part of the 'Model'.

During its lifetime the widget remains always in one of the both states: 'positive' or 'negative'. The state 'positive' is true if the value resulting from the above equation is greater than or equal to 0 (zero). The state 'negative' is true, if the resulting value is less than 0 (zero).

The exact look and feel of the widget is determined by the 'Value Display Configuration' object assigned to the property Appearance. The configuration object provides fonts, colors and other configuration parameters needed to construct and display the widget. Usually, you will manage in your project your own configuration objects and customize the value display widgets according to your design expectations.

Per default the both views 'Value' and 'Unit' are arranged within the widget area independently. In the configuration object you can specify other layout modes to e.g. arrange the unit to appear appended at the right edge of the displayed value.

For more details regarding the customization of the value display widget see the description of WidgetSet::ValueDisplayConfig class.

property WidgetSet::ValueDisplayConfig Appearance = null;

The property 'Appearance' refers to a 'Value Display Config' object containing fonts, colors and further configuration attributes to customize this widget. By assigning a configuration object to the property 'Appearance', the widget automatically assumes the look and feel as determined in the properties of the configuration object.

If there is no configuration object associated to the widget (the property 'Appearance' is 'null') the widget appears empty (transparent).

Please note, configuration objects can be shared among multiple value display widgets. When the properties of the configuration object change, all value display widgets (connected actually to it) are notified and updated to assume the new appearance.

property float CurrentBias = 0.0;

The property 'CurrentBias' determines the value to add to CurrentValue in order to move it to the expected range. The resulting value is then displayed. The operation follows the equation below:

ValueToDisplay = ( CurrentValue * CurrentFactor ) + CurrentBias

property float CurrentFactor = 1.0;

The property 'CurrentFactor' determines the value to multiply CurrentValue in order to convert it to the expected range. The resulting value is then displayed. The operation follows the equation below:

ValueToDisplay = ( CurrentValue * CurrentFactor ) + CurrentBias

property int32 CurrentValue = 0;

The property 'CurrentValue' stores the momentary value of the widget. You can use the properties CurrentFactor and CurrentBias to simply convert this value to the expected range before it is formatted and displayed. The conversion follows the equation below:

ValueToDisplay = ( CurrentValue * CurrentFactor ) + CurrentBias

With the properties NoOfDigits and Precision you can control how the resulting value should be formatted. Localization specific aspects (e.g. decimal sign, digit group sign, etc.) are determined in the configuration object stored in the property Appearance.

property int32 NoOfDigits = 0;

The property 'NoOfDigits' determines the minimum number of digits to display the number resulting from the equation below:

ValueToDisplay = ( CurrentValue * CurrentFactor ) + CurrentBias

The eventually displayed '+' (plus), '-' (minus), decimal or digit group signs are not counted. If the displayed number contains less digits, additional leading 0 (zero) signs will be put in front of the leftmost digit.

property ^int32 Outlet = null;

The property 'Outlet' can refer to any other 'int32' property the widget should remain synchronized with. When the referred property is modified, the widget is automatically notified to remain in sync with the property (the property CurrentValue is updated to the value of the property referred in Outlet).

This approach follows the Model-View-Controller (MVC) programming paradigm. Here the value display widget represents the 'View' and the property referred via 'Outlet' can be seen as a part of the 'Model'.

property int32 Precision = 0;

The property 'Precision' determines the number of digits to display after the decimal sign (after the integer part) of the number resulting from the equation below:

ValueToDisplay = ( CurrentValue * CurrentFactor ) + CurrentBias

If this property is 0 (zero), only the integer part of the resulting number is displayed. The decimal sign is per default '.' (dot). You can configure another localization specific decimal sign in the configuration object assigned to the property Appearance. The total number of digits to display is determined in the property NoOfDigits.

property string Unit = "";

The property 'Unit' specifies the text to display as unit in this widget. The desired font as well as the colors for all individual widget states have to be specified in the configuration object assigned to the property Appearance. If there is no configuration object associated to this widget (the property Appearance is 'null'), no unit is displayed.

Per default, the unit is displayed centered within the widget area. You can modify the alignment of the unit as well as its margins by specifying them in the configuration object.