<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_US"> <head> <title>kalarm/lib: spinbox2.h Source File (kalarm/lib)</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="pics-label" content='(pics-1.1 "http://www.icra.org/ratingsv02.html" comment "ICRAonline DE v2.0" l gen true for "http://www.kde.org" r (nz 1 vz 1 lz 1 oz 1 cb 1) "http://www.rsac.org/ratingsv01.html" l gen true for "http://www.kde.org" r (n 0 s 0 v 0 l 0))' /> <meta name="trademark" content="KDE e.V." /> <meta name="description" content="K Desktop Environment Homepage, KDE.org" /> <meta name="MSSmartTagsPreventParsing" content="true" /> <meta name="robots" content="all" /> <link rel="shortcut icon" href="../../../favicon.ico" /> <link rel="stylesheet" media="screen" type="text/css" title="APIDOX" href="doxygen.css" /> <style type="text/css"> <!-- hr { display: none; } #content h2 { margin-left: 0px; } table.mdTable { background-color: #f8f8f8; border: .2em solid #d7d7d7; } td.mdRow { padding: 8px 20px; } td.md { font-weight: bold; } td.mdname1 { font-weight: bold; color: #602020; } td.mdname { font-weight: bold; color: #602020; } --> </style> </head> <body> <div id="nav_header_top" align="right"> <a href="#content" class="doNotDisplay" accesskey="2">Skip to main content ::</a> <a href="../../.."><img id="nav_header_logo" alt="Home" align="left" src="../../../kde_gear_64.png" border="0" /></a> <span class="doNotDisplay">::</span> <img id="nav_header_logo_right" alt="" align="right" src="../../../pimlogo.png" border="0" /> <div id="nav_header_title" align="left">KDE PIM API Reference</div> </div> <div id="nav_header_bottom" align="right"> <span class="doNotDisplay">:: <a href="#navigation" accesskey="5">Skip to Link Menu</a><br/></span> <div id="nav_header_bottom_left" style="text-align: left;"> / <a href="../../../">API Reference</a> / <a href="../../html/index.html">kalarm</a> / <a href=".">lib</a> </div> </div> <table id="main" border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td valign="top" class="menuheader" height="0"></td> <td id="contentcolumn" valign="top" rowspan="2" > <div id="content" style="padding-top: 0px;"><div style="width:100%; margin: 0px; padding: 0px;"> <h2><a name="content"></a>kalarm/lib</h2> <!-- Generated by Doxygen 1.5.5 --> <h1>spinbox2.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment"> * spinbox2.h - spin box with extra pair of spin buttons (for Qt 3)</span> <a name="l00003"></a>00003 <span class="comment"> * Program: kalarm</span> <a name="l00004"></a>00004 <span class="comment"> * Copyright © 2001-2007 by David Jarvie <software@astrojar.org.uk></span> <a name="l00005"></a>00005 <span class="comment"> *</span> <a name="l00006"></a>00006 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span> <a name="l00007"></a>00007 <span class="comment"> * it under the terms of the GNU General Public License as published by</span> <a name="l00008"></a>00008 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span> <a name="l00009"></a>00009 <span class="comment"> * (at your option) any later version.</span> <a name="l00010"></a>00010 <span class="comment"> *</span> <a name="l00011"></a>00011 <span class="comment"> * This program is distributed in the hope that it will be useful,</span> <a name="l00012"></a>00012 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00013"></a>00013 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span> <a name="l00014"></a>00014 <span class="comment"> * GNU General Public License for more details.</span> <a name="l00015"></a>00015 <span class="comment"> *</span> <a name="l00016"></a>00016 <span class="comment"> * You should have received a copy of the GNU General Public License along</span> <a name="l00017"></a>00017 <span class="comment"> * with this program; if not, write to the Free Software Foundation, Inc.,</span> <a name="l00018"></a>00018 <span class="comment"> * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</span> <a name="l00019"></a>00019 <span class="comment"> */</span> <a name="l00020"></a>00020 <a name="l00021"></a>00021 <span class="preprocessor">#ifndef SPINBOX2_H</span> <a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#define SPINBOX2_H</span> <a name="l00023"></a>00023 <span class="preprocessor"></span> <a name="l00024"></a>00024 <span class="preprocessor">#include <qglobal.h></span> <a name="l00025"></a>00025 <span class="preprocessor">#include <qlineedit.h></span> <a name="l00026"></a>00026 <a name="l00027"></a>00027 <span class="keyword">class </span>SpinMirror; <a name="l00028"></a>00028 <span class="keyword">class </span>ExtraSpinBox; <a name="l00029"></a>00029 <span class="preprocessor">#include "spinbox.h"</span> <a name="l00030"></a>00030 <a name="l00031"></a>00031 <a name="l00056"></a><a class="code" href="classSpinBox2.html">00056</a> <span class="keyword">class </span><a class="code" href="classSpinBox2.html" title="Spin box with a pair of spin buttons on either side.">SpinBox2</a> : <span class="keyword">public</span> QFrame <a name="l00057"></a>00057 { <a name="l00058"></a>00058 Q_OBJECT <a name="l00059"></a>00059 <span class="keyword">public</span>: <a name="l00064"></a>00064 <span class="keyword">explicit</span> <a class="code" href="classSpinBox2.html#f27fc972e124affcdde99513ad96ed1e" title="Constructor.">SpinBox2</a>(QWidget* parent = 0, <span class="keyword">const</span> <span class="keywordtype">char</span>* name = 0); <a name="l00073"></a>00073 <a class="code" href="classSpinBox2.html#f27fc972e124affcdde99513ad96ed1e" title="Constructor.">SpinBox2</a>(<span class="keywordtype">int</span> <a class="code" href="classSpinBox2.html#24787abcfb292da29508c83bb576d12c" title="Returns the minimum value of the spin box.">minValue</a>, <span class="keywordtype">int</span> <a class="code" href="classSpinBox2.html#6ba6fa2d29504bac439ad6195b75df2e" title="Returns the maximum value of the spin box.">maxValue</a>, <span class="keywordtype">int</span> step = 1, <span class="keywordtype">int</span> step2 = 1, <a name="l00074"></a>00074 QWidget* parent = 0, <span class="keyword">const</span> <span class="keywordtype">char</span>* name = 0); <a name="l00078"></a>00078 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#a47a99cba06202e8fd366657d9e334f6" title="Sets whether the spin box can be changed by the user.">setReadOnly</a>(<span class="keywordtype">bool</span> readOnly); <a name="l00080"></a><a class="code" href="classSpinBox2.html#ed85e6ac63a497e6749388210ebd73d5">00080</a> <span class="keywordtype">bool</span> <a class="code" href="classSpinBox2.html#ed85e6ac63a497e6749388210ebd73d5" title="Returns true if the widget is read only.">isReadOnly</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mSpinbox->isReadOnly(); } <a name="l00082"></a><a class="code" href="classSpinBox2.html#688f08106a48f23d8bac5c821f3e41be">00082</a> <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#688f08106a48f23d8bac5c821f3e41be" title="Sets whether the spin box value text should be selected when its value is stepped...">setSelectOnStep</a>(<span class="keywordtype">bool</span> sel) { mSpinbox->setSelectOnStep(sel); } <a name="l00086"></a>00086 <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#755926e228b28affff5fa91f85a67d41" title="Sets whether the spin button pairs should be reversed for a right-to-left language...">setReverseWithLayout</a>(<span class="keywordtype">bool</span> reverse); <a name="l00088"></a><a class="code" href="classSpinBox2.html#ec04e843d7122d1fb62fba2a8c3fa9e9">00088</a> <span class="keywordtype">bool</span> <a class="code" href="classSpinBox2.html#ec04e843d7122d1fb62fba2a8c3fa9e9" title="Returns whether the spin button pairs will be reversed for a right-to-left language...">reverseButtons</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mReverseLayout && !mReverseWithLayout; } <a name="l00089"></a>00089 <a name="l00091"></a><a class="code" href="classSpinBox2.html#0c2719a7c84ac84e0562883201b9874f">00091</a> QString <a class="code" href="classSpinBox2.html#0c2719a7c84ac84e0562883201b9874f" title="Returns the spin box&#39;s text, including any prefix() and suffix().">text</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mSpinbox->text(); } <a name="l00093"></a><a class="code" href="classSpinBox2.html#09cf447ca8afa9ea37c5d51d99a3e51a">00093</a> <span class="keyword">virtual</span> QString <a class="code" href="classSpinBox2.html#09cf447ca8afa9ea37c5d51d99a3e51a" title="Returns the prefix for the spin box&#39;s text.">prefix</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mSpinbox->prefix(); } <a name="l00095"></a><a class="code" href="classSpinBox2.html#e6ef99f4aee3c2e655dad8ef43927130">00095</a> <span class="keyword">virtual</span> QString <a class="code" href="classSpinBox2.html#e6ef99f4aee3c2e655dad8ef43927130" title="Returns the suffix for the spin box&#39;s text.">suffix</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mSpinbox->suffix(); } <a name="l00097"></a><a class="code" href="classSpinBox2.html#270b8b62aabb27286b763a2842c7db1a">00097</a> <span class="keyword">virtual</span> QString <a class="code" href="classSpinBox2.html#270b8b62aabb27286b763a2842c7db1a" title="Returns the spin box&#39;s text with no prefix(), suffix() or leading or trailing...">cleanText</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mSpinbox->cleanText(); } <a name="l00098"></a>00098 <a name="l00102"></a><a class="code" href="classSpinBox2.html#c1c403897a155e502464b9eeb70e0c25">00102</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#c1c403897a155e502464b9eeb70e0c25" title="Sets the special-value text which, if non-null, is displayed instead of a numeric...">setSpecialValueText</a>(<span class="keyword">const</span> QString& <a class="code" href="classSpinBox2.html#0c2719a7c84ac84e0562883201b9874f" title="Returns the spin box&#39;s text, including any prefix() and suffix().">text</a>) { mSpinbox->setSpecialValueText(text); } <a name="l00106"></a><a class="code" href="classSpinBox2.html#c587b812485be31cad7b8cf0df6d40cf">00106</a> QString <a class="code" href="classSpinBox2.html#c587b812485be31cad7b8cf0df6d40cf" title="Returns the special-value text which, if non-null, is displayed instead of a numeric...">specialValueText</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mSpinbox->specialValueText(); } <a name="l00107"></a>00107 <a name="l00111"></a>00111 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#baefe63a1ff1ca4bb8bcc8d0ff466aeb" title="Sets whether it is possible to step the value from the highest value to the lowest...">setWrapping</a>(<span class="keywordtype">bool</span> on); <a name="l00115"></a><a class="code" href="classSpinBox2.html#ae1112b2a40a0341cc133c6378635108">00115</a> <span class="keywordtype">bool</span> <a class="code" href="classSpinBox2.html#ae1112b2a40a0341cc133c6378635108" title="Returns whether it is possible to step the value from the highest value to the lowest...">wrapping</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mSpinbox->wrapping(); } <a name="l00116"></a>00116 <a name="l00118"></a><a class="code" href="classSpinBox2.html#1b71d1c6ffd08a43f244551bd50d64f4">00118</a> <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#1b71d1c6ffd08a43f244551bd50d64f4" title="Set the text alignment of the widget.">setAlignment</a>(<span class="keywordtype">int</span> a) { mSpinbox->setAlignment(a); } <a name="l00120"></a>00120 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#11aae6a913c5b7f6d428ab0b61b3c5a0" title="Sets the button symbols to use (arrows or plus/minus).">setButtonSymbols</a>(QSpinBox::ButtonSymbols); <a name="l00122"></a><a class="code" href="classSpinBox2.html#e6df7b71ccb2808b86150d324f8afd2b">00122</a> QSpinBox::ButtonSymbols <a class="code" href="classSpinBox2.html#e6df7b71ccb2808b86150d324f8afd2b" title="Returns the button symbols currently in use (arrows or plus/minus).">buttonSymbols</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mSpinbox->buttonSymbols(); } <a name="l00123"></a>00123 <a name="l00127"></a><a class="code" href="classSpinBox2.html#187b6f27853daba0bb43d29e4e2839dd">00127</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#187b6f27853daba0bb43d29e4e2839dd" title="Sets the validator to v.">setValidator</a>(<span class="keyword">const</span> QValidator* v) { mSpinbox->setValidator(v); } <a name="l00131"></a><a class="code" href="classSpinBox2.html#2bb237df2f2677986d92f820684fcf58">00131</a> <span class="keyword">const</span> QValidator* <a class="code" href="classSpinBox2.html#2bb237df2f2677986d92f820684fcf58" title="Returns the current validator.">validator</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mSpinbox->validator(); } <a name="l00132"></a>00132 <a name="l00133"></a>00133 <span class="keyword">virtual</span> QSize sizeHint() <span class="keyword">const</span>; <a name="l00134"></a>00134 <span class="keyword">virtual</span> QSize minimumSizeHint() <span class="keyword">const</span>; <a name="l00135"></a>00135 <a name="l00137"></a><a class="code" href="classSpinBox2.html#24787abcfb292da29508c83bb576d12c">00137</a> <span class="keywordtype">int</span> <a class="code" href="classSpinBox2.html#24787abcfb292da29508c83bb576d12c" title="Returns the minimum value of the spin box.">minValue</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mMinValue; } <a name="l00139"></a><a class="code" href="classSpinBox2.html#6ba6fa2d29504bac439ad6195b75df2e">00139</a> <span class="keywordtype">int</span> <a class="code" href="classSpinBox2.html#6ba6fa2d29504bac439ad6195b75df2e" title="Returns the maximum value of the spin box.">maxValue</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mMaxValue; } <a name="l00141"></a>00141 <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#8f8b12c00209937484957f96f267cd68" title="Sets the minimum value of the spin box.">setMinValue</a>(<span class="keywordtype">int</span> val); <a name="l00143"></a>00143 <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#a87bbb86839e5c0c76ad3c54eac6d76c" title="Sets the maximum value of the spin box.">setMaxValue</a>(<span class="keywordtype">int</span> val); <a name="l00145"></a><a class="code" href="classSpinBox2.html#3f5359cdecf39719b6faf6ee00427d7b">00145</a> <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#3f5359cdecf39719b6faf6ee00427d7b" title="Sets the minimum and maximum values of the spin box.">setRange</a>(<span class="keywordtype">int</span> minValue, <span class="keywordtype">int</span> maxValue) { <a class="code" href="classSpinBox2.html#8f8b12c00209937484957f96f267cd68" title="Sets the minimum value of the spin box.">setMinValue</a>(minValue); <a class="code" href="classSpinBox2.html#a87bbb86839e5c0c76ad3c54eac6d76c" title="Sets the maximum value of the spin box.">setMaxValue</a>(maxValue); } <a name="l00147"></a><a class="code" href="classSpinBox2.html#b9b0a3cc4f3c4492e3e580f115eb6d5b">00147</a> <span class="keywordtype">int</span> <a class="code" href="classSpinBox2.html#b9b0a3cc4f3c4492e3e580f115eb6d5b" title="Returns the current value of the spin box.">value</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mSpinbox->value(); } <a name="l00149"></a>00149 <span class="keywordtype">int</span> <a class="code" href="classSpinBox2.html#29ced7fb335762d20facb6185cb6bcd9" title="Returns the specified value clamped to the range of the spin box.">bound</a>(<span class="keywordtype">int</span> val) <span class="keyword">const</span>; <a name="l00150"></a>00150 <a name="l00152"></a><a class="code" href="classSpinBox2.html#18d52e2b08ee4a4a71a6ba971a2ebacc">00152</a> QRect <a class="code" href="classSpinBox2.html#18d52e2b08ee4a4a71a6ba971a2ebacc" title="Returns the geometry of the right-hand &quot;up&quot; button.">upRect</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mSpinbox->upRect(); } <a name="l00154"></a><a class="code" href="classSpinBox2.html#6cced4d2a442ab7a37c46c643270817b">00154</a> QRect <a class="code" href="classSpinBox2.html#6cced4d2a442ab7a37c46c643270817b" title="Returns the geometry of the right-hand &quot;down&quot; button.">downRect</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mSpinbox->downRect(); } <a name="l00156"></a>00156 QRect <a class="code" href="classSpinBox2.html#1bd9346f494381dc6d13f5b41ca5c7c3" title="Returns the geometry of the left-hand &quot;up&quot; button.">up2Rect</a>() <span class="keyword">const</span>; <a name="l00158"></a>00158 QRect <a class="code" href="classSpinBox2.html#ff1d6aef8bdb1813c23e2ba15a5887f8" title="Returns the geometry of the left-hand &quot;down&quot; button.">down2Rect</a>() <span class="keyword">const</span>; <a name="l00159"></a>00159 <a name="l00164"></a><a class="code" href="classSpinBox2.html#833a11cde865ec464938112c150fd0ba">00164</a> <span class="keywordtype">int</span> <a class="code" href="classSpinBox2.html#833a11cde865ec464938112c150fd0ba" title="Returns the unshifted step increment for the right-hand spin buttons, i.e.">lineStep</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mLineStep; } <a name="l00169"></a><a class="code" href="classSpinBox2.html#028cc9b64377acca06b5bae5e5b02347">00169</a> <span class="keywordtype">int</span> <a class="code" href="classSpinBox2.html#028cc9b64377acca06b5bae5e5b02347" title="Returns the shifted step increment for the right-hand spin buttons, i.e.">lineShiftStep</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mLineShiftStep; } <a name="l00174"></a><a class="code" href="classSpinBox2.html#f437b7357e3728ded5764862cb326d26">00174</a> <span class="keywordtype">int</span> <a class="code" href="classSpinBox2.html#f437b7357e3728ded5764862cb326d26" title="Returns the unshifted step increment for the left-hand spin buttons, i.e.">pageStep</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mPageStep; } <a name="l00179"></a><a class="code" href="classSpinBox2.html#51fe5dfd72900ae4c228046c9f70844e">00179</a> <span class="keywordtype">int</span> <a class="code" href="classSpinBox2.html#51fe5dfd72900ae4c228046c9f70844e" title="Returns the shifted step increment for the left-hand spin buttons, i.e.">pageShiftStep</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mPageShiftStep; } <a name="l00184"></a>00184 <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#8d19a6362f88722da93f86bab400d938" title="Sets the unshifted step increment for the right-hand spin buttons, i.e.">setLineStep</a>(<span class="keywordtype">int</span> step); <a name="l00191"></a>00191 <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#6db1d1b35ef216f815d9ec15711054f9" title="Sets the unshifted step increments for the two pairs of spin buttons, i.e.">setSteps</a>(<span class="keywordtype">int</span> line, <span class="keywordtype">int</span> page); <a name="l00198"></a>00198 <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#f91f511b836777b16fd9925e2ee882e5" title="Sets the shifted step increments for the two pairs of spin buttons, i.e.">setShiftSteps</a>(<span class="keywordtype">int</span> line, <span class="keywordtype">int</span> page); <a name="l00199"></a>00199 <a name="l00203"></a><a class="code" href="classSpinBox2.html#08ad74f48282464a5d682d30a0949df5">00203</a> <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#08ad74f48282464a5d682d30a0949df5" title="Increments the current value by adding the unshifted step increment for the left-hand...">addPage</a>() { <a class="code" href="classSpinBox2.html#2689026085b2e48be0d9bd94724eda85" title="Adjusts the current value by adding change.">addValue</a>(mPageStep); } <a name="l00207"></a><a class="code" href="classSpinBox2.html#87e265f522c027c1cec5979122d54b50">00207</a> <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#87e265f522c027c1cec5979122d54b50" title="Decrements the current value by subtracting the unshifted step increment for the...">subtractPage</a>() { <a class="code" href="classSpinBox2.html#2689026085b2e48be0d9bd94724eda85" title="Adjusts the current value by adding change.">addValue</a>(-mPageStep); } <a name="l00211"></a><a class="code" href="classSpinBox2.html#3549ead15d2aa4b83449d5d3a6f7dd65">00211</a> <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#3549ead15d2aa4b83449d5d3a6f7dd65" title="Increments the current value by adding the unshifted step increment for the right-hand...">addLine</a>() { <a class="code" href="classSpinBox2.html#2689026085b2e48be0d9bd94724eda85" title="Adjusts the current value by adding change.">addValue</a>(mLineStep); } <a name="l00215"></a><a class="code" href="classSpinBox2.html#dfe9940cbfb584d5fe7496c5762ecb96">00215</a> <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#dfe9940cbfb584d5fe7496c5762ecb96" title="Decrements the current value by subtracting the unshifted step increment for the...">subtractLine</a>() { <a class="code" href="classSpinBox2.html#2689026085b2e48be0d9bd94724eda85" title="Adjusts the current value by adding change.">addValue</a>(-mLineStep); } <a name="l00217"></a><a class="code" href="classSpinBox2.html#2689026085b2e48be0d9bd94724eda85">00217</a> <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#2689026085b2e48be0d9bd94724eda85" title="Adjusts the current value by adding change.">addValue</a>(<span class="keywordtype">int</span> change) { mSpinbox->addValue(change); } <a name="l00218"></a>00218 <a name="l00219"></a>00219 <span class="keyword">public</span> slots: <a name="l00221"></a><a class="code" href="classSpinBox2.html#d71f3957ae296ba400a9226a6d361b71">00221</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#d71f3957ae296ba400a9226a6d361b71" title="Sets the current value to val.">setValue</a>(<span class="keywordtype">int</span> val) { mSpinbox->setValue(val); } <a name="l00223"></a><a class="code" href="classSpinBox2.html#eafe43de9be346ca9cbd72a3a2a35b71">00223</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#eafe43de9be346ca9cbd72a3a2a35b71" title="Sets the prefix which is prepended to the start of the displayed text.">setPrefix</a>(<span class="keyword">const</span> QString& <a class="code" href="classSpinBox2.html#0c2719a7c84ac84e0562883201b9874f" title="Returns the spin box&#39;s text, including any prefix() and suffix().">text</a>) { mSpinbox->setPrefix(text); } <a name="l00225"></a><a class="code" href="classSpinBox2.html#39ec64451f08983d44f9597c64e0cbdb">00225</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#39ec64451f08983d44f9597c64e0cbdb" title="Sets the suffix which is prepended to the start of the displayed text.">setSuffix</a>(<span class="keyword">const</span> QString& <a class="code" href="classSpinBox2.html#0c2719a7c84ac84e0562883201b9874f" title="Returns the spin box&#39;s text, including any prefix() and suffix().">text</a>) { mSpinbox->setSuffix(text); } <a name="l00229"></a><a class="code" href="classSpinBox2.html#e5442b8a54069d293e3fa94703b4c6be">00229</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#e5442b8a54069d293e3fa94703b4c6be" title="Increments the current value by adding the unshifted step increment for the right-hand...">stepUp</a>() { <a class="code" href="classSpinBox2.html#2689026085b2e48be0d9bd94724eda85" title="Adjusts the current value by adding change.">addValue</a>(mLineStep); } <a name="l00233"></a><a class="code" href="classSpinBox2.html#a5a4bcc750eb8a7486925ef276efb75e">00233</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#a5a4bcc750eb8a7486925ef276efb75e" title="Decrements the current value by subtracting the unshifted step increment for the...">stepDown</a>() { <a class="code" href="classSpinBox2.html#2689026085b2e48be0d9bd94724eda85" title="Adjusts the current value by adding change.">addValue</a>(-mLineStep); } <a name="l00237"></a><a class="code" href="classSpinBox2.html#a5c99e3c16027796ec91e4dcc5381fdf">00237</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#a5c99e3c16027796ec91e4dcc5381fdf" title="Increments the current value by adding the unshifted step increment for the left-hand...">pageUp</a>() { <a class="code" href="classSpinBox2.html#2689026085b2e48be0d9bd94724eda85" title="Adjusts the current value by adding change.">addValue</a>(mPageStep); } <a name="l00241"></a><a class="code" href="classSpinBox2.html#22e2c45f4d9b17e141c8e2c21f3b8b66">00241</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#22e2c45f4d9b17e141c8e2c21f3b8b66" title="Decrements the current value by subtracting the unshifted step increment for the...">pageDown</a>() { <a class="code" href="classSpinBox2.html#2689026085b2e48be0d9bd94724eda85" title="Adjusts the current value by adding change.">addValue</a>(-mPageStep); } <a name="l00243"></a><a class="code" href="classSpinBox2.html#d741f021f5e3179830adb065460bbc46">00243</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#d741f021f5e3179830adb065460bbc46" title="Selects all the text in the spin box&#39;s editor.">selectAll</a>() { mSpinbox->selectAll(); } <a name="l00245"></a>00245 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#f285b762f5199480b4239d456e900b9e" title="Sets whether the widget is enabled.">setEnabled</a>(<span class="keywordtype">bool</span> enabled); <a name="l00246"></a>00246 <a name="l00247"></a>00247 signals: <a name="l00249"></a>00249 <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#3707364129b2435d585abebc62c7d82a" title="Signal which is emitted whenever the value of the spin box changes.">valueChanged</a>(<span class="keywordtype">int</span> <a class="code" href="classSpinBox2.html#b9b0a3cc4f3c4492e3e580f115eb6d5b" title="Returns the current value of the spin box.">value</a>); <a name="l00251"></a>00251 <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#3707364129b2435d585abebc62c7d82a" title="Signal which is emitted whenever the value of the spin box changes.">valueChanged</a>(<span class="keyword">const</span> QString& valueText); <a name="l00252"></a>00252 <a name="l00253"></a>00253 <span class="keyword">protected</span>: <a name="l00254"></a>00254 <span class="keyword">virtual</span> QString mapValueToText(<span class="keywordtype">int</span> v) { <span class="keywordflow">return</span> mSpinbox->mapValToText(v); } <a name="l00255"></a>00255 <span class="keyword">virtual</span> <span class="keywordtype">int</span> mapTextToValue(<span class="keywordtype">bool</span>* ok) { <span class="keywordflow">return</span> mSpinbox->mapTextToVal(ok); } <a name="l00256"></a>00256 <span class="keyword">virtual</span> <span class="keywordtype">void</span> resizeEvent(QResizeEvent*) { arrange(); } <a name="l00257"></a>00257 <span class="keyword">virtual</span> <span class="keywordtype">void</span> showEvent(QShowEvent*); <a name="l00258"></a>00258 <span class="keyword">virtual</span> <span class="keywordtype">void</span> styleChange(QStyle&); <a name="l00259"></a>00259 <span class="keyword">virtual</span> <span class="keywordtype">void</span> getMetrics() <span class="keyword">const</span>; <a name="l00260"></a>00260 <a name="l00261"></a>00261 <span class="keyword">mutable</span> <span class="keywordtype">int</span> wUpdown2; <span class="comment">// width of second spin widget</span> <a name="l00262"></a>00262 <span class="keyword">mutable</span> <span class="keywordtype">int</span> xUpdown2; <span class="comment">// x offset of visible area in 'mUpdown2'</span> <a name="l00263"></a>00263 <span class="keyword">mutable</span> <span class="keywordtype">int</span> xSpinbox; <span class="comment">// x offset of visible area in 'mSpinbox'</span> <a name="l00264"></a>00264 <span class="keyword">mutable</span> <span class="keywordtype">int</span> wGap; <span class="comment">// gap between mUpdown2Frame and mSpinboxFrame</span> <a name="l00265"></a>00265 <a name="l00266"></a>00266 <span class="keyword">protected</span> slots: <a name="l00267"></a>00267 <span class="keyword">virtual</span> <span class="keywordtype">void</span> valueChange(); <a name="l00268"></a>00268 <span class="keyword">virtual</span> <span class="keywordtype">void</span> stepPage(<span class="keywordtype">int</span>); <a name="l00269"></a>00269 <a name="l00270"></a>00270 <span class="keyword">private</span> slots: <a name="l00271"></a>00271 <span class="keywordtype">void</span> updateMirror(); <a name="l00272"></a>00272 <a name="l00273"></a>00273 <span class="keyword">private</span>: <a name="l00274"></a>00274 <span class="keywordtype">void</span> init(); <a name="l00275"></a>00275 <span class="keywordtype">void</span> arrange(); <a name="l00276"></a>00276 <span class="keywordtype">int</span> whichButton(QObject* spinWidget, <span class="keyword">const</span> QPoint&); <a name="l00277"></a>00277 <span class="keywordtype">void</span> setShiftStepping(<span class="keywordtype">bool</span> on); <a name="l00278"></a>00278 <a name="l00279"></a>00279 <span class="comment">// Visible spin box class.</span> <a name="l00280"></a>00280 <span class="comment">// Declared here to allow use of mSpinBox in inline methods.</span> <a name="l00281"></a>00281 <span class="keyword">class </span>MainSpinBox : <span class="keyword">public</span> <a class="code" href="classSpinBox.html" title="Spin box with accelerated shift key stepping and read-only option.">SpinBox</a> <a name="l00282"></a>00282 { <a name="l00283"></a>00283 <span class="keyword">public</span>: <a name="l00284"></a>00284 MainSpinBox(<a class="code" href="classSpinBox2.html" title="Spin box with a pair of spin buttons on either side.">SpinBox2</a>* sb2, QWidget* parent, <span class="keyword">const</span> <span class="keywordtype">char</span>* name = 0) <a name="l00285"></a>00285 : <a class="code" href="classSpinBox.html" title="Spin box with accelerated shift key stepping and read-only option.">SpinBox</a>(parent, name), owner(sb2) { } <a name="l00286"></a>00286 MainSpinBox(<span class="keywordtype">int</span> minValue, <span class="keywordtype">int</span> maxValue, <span class="keywordtype">int</span> step, <a class="code" href="classSpinBox2.html" title="Spin box with a pair of spin buttons on either side.">SpinBox2</a>* sb2, QWidget* parent, <span class="keyword">const</span> <span class="keywordtype">char</span>* name = 0) <a name="l00287"></a>00287 : <a class="code" href="classSpinBox.html" title="Spin box with accelerated shift key stepping and read-only option.">SpinBox</a>(minValue, maxValue, step, parent, name), owner(sb2) { } <a name="l00288"></a>00288 <span class="keywordtype">void</span> <a class="code" href="classSpinBox2.html#1b71d1c6ffd08a43f244551bd50d64f4" title="Set the text alignment of the widget.">setAlignment</a>(<span class="keywordtype">int</span> a) { editor()->setAlignment(a); } <a name="l00289"></a>00289 <span class="keyword">virtual</span> QString mapValueToText(<span class="keywordtype">int</span> v) { <span class="keywordflow">return</span> owner->mapValueToText(v); } <a name="l00290"></a>00290 <span class="keyword">virtual</span> <span class="keywordtype">int</span> mapTextToValue(<span class="keywordtype">bool</span>* ok) { <span class="keywordflow">return</span> owner->mapTextToValue(ok); } <a name="l00291"></a>00291 QString mapValToText(<span class="keywordtype">int</span> v) { <span class="keywordflow">return</span> SpinBox::mapValueToText(v); } <a name="l00292"></a>00292 <span class="keywordtype">int</span> mapTextToVal(<span class="keywordtype">bool</span>* ok) { <span class="keywordflow">return</span> SpinBox::mapTextToValue(ok); } <a name="l00293"></a>00293 <span class="keyword">virtual</span> <span class="keywordtype">int</span> shiftStepAdjustment(<span class="keywordtype">int</span> oldValue, <span class="keywordtype">int</span> shiftStep); <a name="l00294"></a>00294 <span class="keyword">private</span>: <a name="l00295"></a>00295 <a class="code" href="classSpinBox2.html" title="Spin box with a pair of spin buttons on either side.">SpinBox2</a>* owner; <span class="comment">// owner SpinBox2</span> <a name="l00296"></a>00296 }; <a name="l00297"></a>00297 <a name="l00298"></a>00298 <span class="keyword">enum</span> { NO_BUTTON = -1, UP, DOWN, UP2, DOWN2 }; <a name="l00299"></a>00299 <a name="l00300"></a>00300 <span class="keyword">static</span> <span class="keywordtype">int</span> mReverseLayout; <span class="comment">// widgets are mirrored right to left</span> <a name="l00301"></a>00301 QFrame* mUpdown2Frame; <span class="comment">// contains visible part of the extra pair of spin buttons</span> <a name="l00302"></a>00302 QFrame* mSpinboxFrame; <span class="comment">// contains the main spin box</span> <a name="l00303"></a>00303 ExtraSpinBox* mUpdown2; <span class="comment">// the extra pair of spin buttons</span> <a name="l00304"></a>00304 MainSpinBox* mSpinbox; <span class="comment">// the visible spin box</span> <a name="l00305"></a>00305 SpinMirror* mSpinMirror; <span class="comment">// image of the extra pair of spin buttons</span> <a name="l00306"></a>00306 <span class="keywordtype">int</span> mMinValue; <a name="l00307"></a>00307 <span class="keywordtype">int</span> mMaxValue; <a name="l00308"></a>00308 <span class="keywordtype">int</span> mLineStep; <span class="comment">// right button increment</span> <a name="l00309"></a>00309 <span class="keywordtype">int</span> mLineShiftStep; <span class="comment">// right button increment with shift pressed</span> <a name="l00310"></a>00310 <span class="keywordtype">int</span> mPageStep; <span class="comment">// left button increment</span> <a name="l00311"></a>00311 <span class="keywordtype">int</span> mPageShiftStep; <span class="comment">// left button increment with shift pressed</span> <a name="l00312"></a>00312 <span class="keywordtype">bool</span> mReverseWithLayout; <span class="comment">// reverse button positions if reverse layout (default = true)</span> <a name="l00313"></a>00313 <a name="l00314"></a>00314 <span class="keyword">friend</span> <span class="keyword">class </span>MainSpinBox; <a name="l00315"></a>00315 }; <a name="l00316"></a>00316 <a name="l00317"></a>00317 <span class="preprocessor">#endif // SPINBOX2_H</span> </pre></div></div> </div></div> </td> </tr> <tr> <td valign="top" id="leftmenu" width="25%"> <a name="navigation"></a> <div class="menu_box"><h2>kalarm/lib</h2> <div class="nav_list"> <ul><li><a href="index.html">Main Page</a></li><li><a href="hierarchy.html">Class Hierarchy</a></li><li><a href="classes.html">Alphabetical List</a></li><li><a href="annotated.html">Class List</a></li><li><a href="files.html">File List</a></li><li><a href="functions.html">Class Members</a></li></ul> <!-- <h2>Class Picker</h2> <div style="text-align: center;"> <form name="guideform"> <select name="guidelinks" style="width:100%;" onChange="window.location=document.guideform.guidelinks.options[document.guideform.guidelinks.selectedIndex].value"> <option value="annotated.html">-- Choose --</option> <option value="classButtonGroup.html">buttongroup</option>, <option value="classCheckBox.html">checkbox</option>, <option value="classColourCombo.html">colourcombo</option>, <option value="classColourList.html">colourlist</option>, <option value="classComboBox.html">combobox</option>, <option value="classDailyTimer.html">dailytimer</option>, <option value="classDateEdit.html">dateedit</option>, <option value="classDateTime.html">datetime</option>, <option value="classLabel.html">label</option>, <option value="classLineEdit.html">lineedit</option>, <option value="classMessageBox.html">messagebox</option>, <option value="classMidnightTimer.html">midnighttimer</option>, <option value="classMinuteTimer.html">minutetimer</option>, <option value="classPushButton.html">pushbutton</option>, <option value="classRadioButton.html">radiobutton</option>, <option value="classShellProcess.html">shellprocess</option>, <option value="classSlider.html">slider</option>, <option value="classSpinBox.html">spinbox</option>, <option value="classSpinBox2.html">spinbox2</option>, <option value="classSynchTimer.html">synchtimer</option>, <option value="classTimeEdit.html">timeedit</option>, <option value="classTimePeriod.html">timeperiod</option>, <option value="classTimeSpinBox.html">timespinbox</option>, </select> </form> </div> --> </div></div> <div class="menu_box"><h2>API Dox</h2> <div class="nav_list"> <ul> <li><a href="../../../akregator/html/index.html">akregator</a></li><li> <a href="../../../akregator/src/html/index.html">src</a></li><li> <a href="../../../akregator/src/librss/html/index.html">librss</a></li><li><a href="../../../certmanager/html/index.html">certmanager</a></li><li> <a href="../../../certmanager/lib/html/index.html">lib</a></li><li><a href="../../../kaddressbook/html/index.html">kaddressbook</a></li><li><a href="../../../kalarm/html/index.html">kalarm</a></li><li> <a href="../../../kalarm/lib/html/index.html">lib</a></li><li><a href="../../../kandy/html/index.html">kandy</a></li><li><a href="../../../karm/html/index.html">karm</a></li><li><a href="../../../kdgantt/html/index.html">kdgantt</a></li><li><a href="../../../kgantt/html/index.html">kgantt</a></li><li><a href="../../../kioslaves/html/index.html">kioslaves</a></li><li> <a href="../../../kioslaves/imap4/html/index.html">imap4</a></li><li> <a href="../../../kioslaves/mbox/html/index.html">mbox</a></li><li><a href="../../../kitchensync/html/index.html">kitchensync</a></li><li><a href="../../../kmail/html/index.html">kmail</a></li><li><a href="../../../knotes/html/index.html">knotes</a></li><li><a href="../../../konsolekalendar/html/index.html">konsolekalendar</a></li><li><a href="../../../kontact/html/index.html">kontact</a></li><li><a href="../../../korganizer/html/index.html">korganizer</a></li><li><a href="../../../kpilot/html/index.html">kpilot</a></li><li> <a href="../../../kpilot/kpilot/html/index.html">kpilot</a></li><li> <a href="../../../kpilot/lib/html/index.html">lib</a></li><li><a href="../../../libemailfunctions/html/index.html">libemailfunctions</a></li><li><a href="../../../libkcal/html/index.html">libkcal</a></li><li><a href="../../../libkdepim/html/index.html">libkdepim</a></li><li><a href="../../../libkholidays/html/index.html">libkholidays</a></li><li><a href="../../../libkmime/html/index.html">libkmime</a></li><li><a href="../../../libkpgp/html/index.html">libkpgp</a></li><li><a href="../../../libkpimidentities/html/index.html">libkpimidentities</a></li> </ul></div></div> </td> </tr> </table> <span class="doNotDisplay"> <a href="http://www.kde.org/" accesskey="8">KDE Home</a> | <a href="http://accessibility.kde.org/" accesskey="9">KDE Accessibility Home</a> | <a href="http://www.kde.org/media/accesskeys.php" accesskey="0">Description of Access Keys</a> </span> <div style="height: 8px"></div> <div id="footer"> <div id="footer_left"> Maintained by <a href="mailto:groot@kde.org">Adriaan de Groot</a> and <a href="mailto:winter@kde.org">Allen Winter</a>. <br/> KDE and K Desktop Environment are trademarks of <a href="http://www.kde.org/areas/kde-ev/" title="Homepage of the KDE non-profit Organization">KDE e.V.</a> | <a href="http://www.kde.org/contact/impressum.php">Legal</a> </div> <div id="footer_right"><img src="/media/images/footer_right.png" style="margin: 0px" alt="" /></div> </div> <!-- WARNING: DO NOT SEND MAIL TO THE FOLLOWING EMAIL ADDRESS! YOU WILL BE BLOCKED INSTANTLY AND PERMANENTLY! <a href="mailto:aaaatrap-425acc3b5374943f@kde.org">Block me</a> WARNING END --> </body> </html>