Files
gitea-pages/software/CSDataQuick/docs/qml-csdataquick-components-cswheelswitch.html
T
2025-07-08 08:18:09 +02:00

128 lines
8.3 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- CSWheelSwitch.qml -->
<title>CSWheelSwitch QML Type | CSDataQuick Documentation 1.2</title>
<link rel="stylesheet" type="text/css" href="style/online.css" />
<script type="text/javascript">
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date(); a = s.createElement(o),
m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-24645639-4', 'qt.io');
ga('set', 'forceSSL', true);
ga('send', 'pageview');
</script>
</head>
<body>
<div class="header" id="header">
<header id="navbar" class="">
</header>
</div>
<div class="main">
<div class="main-rounded">
<div class="navigationbar">
<ul class="sub-navigation">
<li><a href="../../CSDataQuick.html">Home</a></li>
<li><a href="../docs.html" class="active">Documentation</a></li>
<li><a href="http://github.com/xiaoqiangwang/CSDataQuick/">Code</a></li>
<li><a href="https://github.com/xiaoqiangwang/CSDataQuick/issues/">Bug Reports</a></li>
</ul>
<div id="main_title_bar">
<h1>CSDataQuick Documentation</h1>
<div class="search_bar">
<script>
(function() {
var cx = '001693341472456439948:u9v0snkru3q';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:searchbox-only resultsUrl="search-results.html"></gcse:searchbox-only>
</div></div>
<ul>
<li><a href="index.html">CSDataQuick Documentation</a></li>
<li><a href="csdataquick-qmlmodules.html">QML Types</a></li>
<li>CSWheelSwitch QML Type</li>
</ul>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="qml-csdataquick-components-cswheelswitch.html#properties">Properties</a></li>
<li class="level1"><a href="qml-csdataquick-components-cswheelswitch.html#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<div class="context">
<h1 class="title">CSWheelSwitch QML Type</h1>
<span class="subtitle"></span>
<!-- $$$CSWheelSwitch-brief -->
<p>Control a number with individual digit manipulation. <a href="qml-csdataquick-components-cswheelswitch.html#details">More...</a></p>
<!-- @@@CSWheelSwitch -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Import Statement:</td><td class="memItemRight bottomAlign"> import CSDataQuick.Components 1.0</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> <p><a href="qml-csdataquick-components-cscontrol.html">CSControl</a></p>
</td></tr></table></div><ul>
<li><a href="qml-csdataquick-components-cswheelswitch-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="properties"></a>
<h2 id="properties">Properties</h2>
<ul>
<li class="fn"><b><b><a href="qml-csdataquick-components-cswheelswitch.html#format-prop">format</a></b></b> : string</li>
</ul>
<!-- $$$CSWheelSwitch-description -->
<a name="details"></a>
<h2 id="details">Detailed Description</h2>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>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.</p>
<p>The limits and precision can be changed via the DataLimits dialog.</p>
<pre class="qml"><span class="type"><a href="qml-csdataquick-components-cswheelswitch.html">CSWheelSwitch</a></span> {
<span class="name">width</span>: <span class="number">150</span>
<span class="name">height</span>: <span class="number">30</span>
<span class="name">anchors</span>.centerIn: <span class="name">parent</span>
<span class="name">source</span>: <span class="string">'catest'</span>
<span class="name">format</span>: <span class="string">'PV Value: % 5.2f'</span>
}</pre>
<p class="centerAlign"><img src="images/wheelswitch.png" alt="" /></p><!-- @@@CSWheelSwitch -->
<h2>Property Documentation</h2>
<!-- $$$format -->
<div class="qmlitem"><div class="qmlproto">
<div class="table"><table class="qmlname">
<tr valign="top" class="odd" id="format-prop">
<td class="tblQmlPropNode"><p>
<a name="format-prop"></a><span class="name">format</span> : <span class="type">string</span></p></td></tr>
</table></div>
</div><div class="qmldoc"><p>The format used to display the number</p>
<p>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.</p>
<div class="table"><table class="generic">
<thead><tr class="qt-style"><th >% 6.2f</th><th >%+6.2f</th><th >Time: % 6.2f sec</th></tr></thead>
<tr valign="top" class="odd"><td >10.00</td><td >+10.00</td><td >Time: 10.00 sec</td></tr>
<tr valign="top" class="even"><td >99.00</td><td >+99.00</td><td >Time: 99.00 sec</td></tr>
<tr valign="top" class="odd"><td >-99.00</td><td >-99.00</td><td >Time: -99.00 sec</td></tr>
</table></div>
</div></div><!-- @@@format -->
<br/>
</div>
</div>
</div>
</div>
</div>
<div class="footer">Copyright (C) 2012-2021 Xiaoqiang Wang, Paul Scherrer Institute.</div>
</body>
</html>