CSWheelSwitch QML Type
Control a number with individual digit manipulation. More...
Import Statement: | import CSDataQuick.Components 1.0 |
Inherits: |
Properties
- format : string
Detailed Description
The WheelSwitch displays a number value. It has arrow buttons above and below the digits that are used to change individual digits. The up and down arrow buttons are the main feature of the WheelSwitch. You click them to increment the digit. Only the buttons that give allowable values, that is, those between the limits in effect and allowed by the format, are visible at any time.
The arrow buttons can also be navigated and operated via the keyboard. The up and down arrow keys increment or decrement the selected digit. The left and right arrows keys move the selected digit. The selected digit should be highlighted when the pointer is inside the WheelSwitch. Clicking on an arrow button moves the selected digit to that digit, in addition to incrementing or decrementing the digit.
The WheelSwitch will also accept input of a new value via the keyboard. When you start typing, the arrow buttons will disappear and what you type will be displayed. A minus sign can be typed at any time and toggles having a minus sign at the front of the number. Typing a plus sign will delete a minus sign. Backspace or Delete should delete the last character. (This is the only way to correct a typing mistake.) The arrow keys cannot be used to move within the input. Escape aborts the input. If the pointer leaves the WheelSwitch while you are in input mode, that will also abort the input. Type Enter to finish the input. If the number entered is invalid for the format or the limits, it will not be accepted.
If the number is larger than the format will hold or outside the low and high limits, the digits are replaced by astericks, but a minus sign remains if the value is negative.
The limits and precision can be changed via the DataLimits dialog.
CSWheelSwitch { width: 150 height: 30 anchors.centerIn: parent source: 'catest' format: 'PV Value: % 5.2f' }
Property Documentation
The format used to display the number
The Format is a string of characters that specifies how the value will be formatted. Its syntax is based on the format specification used in the C language, but is more limited. Valid formats are of the form “xxx%[space|+]m.nfyyy”. They consist of an arbitrary string of characters xxx (the prefix), followed by a % sign, followed by a flag, which can be a space or blank, followed by an integer m representing the total number of digits including the sign and the decimal point, followed by a decimal point, followed by an integer n representing the number of digits after the decimal point, followed by an f, followed by an arbitrary string of characters yyy (the postfix). If the flag is +, then the sign is always shown when the value is displayed. If the flag is a space, then the sign is shown only when the number is negative. The format, apart from the prefix and postfix, is interpreted as it is in the C language, but all the options allowed by C are not available. The WheelSwitch will check your format and suggest an alternative if it does not like it. If the Format is not specified, then the WheelSwitch calculates it based on the low and high limits and the precision.
% 6.2f | %+6.2f | Time: % 6.2f sec |
---|---|---|
10.00 | +10.00 | Time: 10.00 sec |
99.00 | +99.00 | Time: 99.00 sec |
-99.00 | -99.00 | Time: -99.00 sec |