<!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"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>AlbumShaper: dynamicSlider.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.6.2 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <h1>dynamicSlider.h</h1><a href="dynamicSlider_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">//==============================================</span> <a name="l00002"></a>00002 <span class="comment">// copyright : (C) 2003-2005 by Will Stokes</span> <a name="l00003"></a>00003 <span class="comment">//==============================================</span> <a name="l00004"></a>00004 <span class="comment">// This program is free software; you can redistribute it</span> <a name="l00005"></a>00005 <span class="comment">// and/or modify it under the terms of the GNU General</span> <a name="l00006"></a>00006 <span class="comment">// Public License as published by the Free Software</span> <a name="l00007"></a>00007 <span class="comment">// Foundation; either version 2 of the License, or</span> <a name="l00008"></a>00008 <span class="comment">// (at your option) any later version.</span> <a name="l00009"></a>00009 <span class="comment">//==============================================</span> <a name="l00010"></a>00010 <a name="l00011"></a>00011 <span class="preprocessor">#ifndef GUI_DYNAMICSLIDER_H</span> <a name="l00012"></a>00012 <span class="preprocessor"></span><span class="preprocessor">#define GUI_DYNAMICSLIDER_H</span> <a name="l00013"></a>00013 <span class="preprocessor"></span> <a name="l00014"></a>00014 <span class="preprocessor">#include <qslider.h></span> <a name="l00015"></a>00015 <span class="preprocessor">#include <qlabel.h></span> <a name="l00016"></a>00016 <span class="preprocessor">#include <qpoint.h></span> <a name="l00017"></a>00017 <a name="l00018"></a>00018 <span class="keyword">class </span><a class="code" href="classSliderToolTip.html" title="private class used by the DynamicSlider to show tooltips. do not use!">SliderToolTip</a>; <a name="l00019"></a>00019 <span class="comment">//==========================================</span> <a name="l00021"></a><a class="code" href="classDynamicSlider.html">00021</a> <span class="comment"></span><span class="keyword">class </span><a class="code" href="classDynamicSlider.html" title="A more dynamic slider that provides moving tooltips that show the slider value.">DynamicSlider</a> : <span class="keyword">public</span> <a class="code" href="classQSlider.html">QSlider</a> <a name="l00022"></a>00022 { <a name="l00023"></a>00023 Q_OBJECT <a name="l00024"></a>00024 <span class="keyword">public</span>: <a name="l00025"></a>00025 <a class="code" href="classDynamicSlider.html#aec619f4dc976a4af83d645709469c11f">DynamicSlider</a>( Orientation orientation, <a class="code" href="classQWidget.html">QWidget</a>* parent, <span class="keyword">const</span> <span class="keywordtype">char</span>* name=0 ); <a name="l00026"></a>00026 <a class="code" href="classDynamicSlider.html#af1137a3524c8bf4a486dda3ea26985e9">~DynamicSlider</a>(); <a name="l00027"></a>00027 <a name="l00029"></a>00029 <span class="keywordtype">void</span> <a class="code" href="classDynamicSlider.html#a750e540c9e41e4ffcc04634d3c126ebe" title="when set, a zero string is shown instead of the current value/prefix/suffix when...">setZeroString</a>( QString val ); <a name="l00030"></a>00030 <a name="l00032"></a>00032 <span class="keywordtype">void</span> <a class="code" href="classDynamicSlider.html#a247eb6acc83ce4389654523e0a9318e3" title="set the prefix that is displayed before the current slider value">setPrefix</a>( QString val ); <a name="l00033"></a>00033 <a name="l00035"></a>00035 <span class="keywordtype">void</span> <a class="code" href="classDynamicSlider.html#a3468a9997b768c4464eede49b4c2b563" title="set two prefix values, one for when the value is positive and one for when the value...">setPrefixes</a>( QString <a class="code" href="classDynamicSlider.html#a67551c3c8bcddc13e26a2eaec39a5e28">prefix1</a>, QString <a class="code" href="classDynamicSlider.html#ab9a1627f1d42ea2fec66edb419b1ca17">prefix2</a> ); <a name="l00036"></a>00036 <a name="l00038"></a>00038 <span class="keywordtype">void</span> <a class="code" href="classDynamicSlider.html#ac831f79ca17aec39750abbd2becff8ec" title="set the suffix that is displayed after the current slider value">setSuffix</a>( QString val ); <a name="l00039"></a>00039 <a name="l00041"></a>00041 <span class="keywordtype">void</span> <a class="code" href="classDynamicSlider.html#a2087f6aa464708e9852be47a16c69d60" title="set two suffix values, one for when the value is positive and one for when the value...">setSuffixes</a>( QString <a class="code" href="classDynamicSlider.html#a6ded79116512c13de801ac9f68ea5b45">suffix1</a>, QString <a class="code" href="classDynamicSlider.html#af2c9d87b3f761f66f42d8878cc7a4dfe">suffix2</a> ); <a name="l00042"></a>00042 <a name="l00043"></a>00043 <span class="comment">//used by the tooltip class to determine the current mouse position</span> <a name="l00044"></a>00044 QPoint <a class="code" href="classDynamicSlider.html#a0616c467378ee6a213e8e62e629ce601">getMousePos</a>(); <a name="l00045"></a>00045 <a name="l00046"></a>00046 <span class="keyword">protected</span>: <a name="l00047"></a>00047 <span class="comment">//cache and announce to the tooltip class that the mouse has moved</span> <a name="l00048"></a>00048 <span class="keywordtype">void</span> <a class="code" href="classDynamicSlider.html#a68c456c52ccf9346b04330ec66314187">mouseMoveEvent</a>(QMouseEvent* e); <a name="l00049"></a>00049 <a name="l00052"></a>00052 <span class="keyword">virtual</span> QString <a class="code" href="classDynamicSlider.html#a8267948ae30b6c03ce1ab34e47ce864e" title="subclass DynamicSlider and reimplement this method to change the behavior used to...">mapValToString</a>(); <a name="l00053"></a>00053 <a name="l00054"></a>00054 <span class="keyword">private</span>: <a name="l00055"></a><a class="code" href="classDynamicSlider.html#a3eab6794aae3292d2c852dedfc4960ad">00055</a> QString <a class="code" href="classDynamicSlider.html#a3eab6794aae3292d2c852dedfc4960ad">zeroString</a>; <a name="l00056"></a>00056 <a name="l00057"></a><a class="code" href="classDynamicSlider.html#ab9a1627f1d42ea2fec66edb419b1ca17">00057</a> QString prefix1, prefix2; <a name="l00058"></a><a class="code" href="classDynamicSlider.html#af2c9d87b3f761f66f42d8878cc7a4dfe">00058</a> QString suffix1, suffix2; <a name="l00059"></a>00059 <a name="l00060"></a><a class="code" href="classDynamicSlider.html#abaec59346de86d20ab3b080017fe9ddd">00060</a> <a class="code" href="classSliderToolTip.html" title="private class used by the DynamicSlider to show tooltips. do not use!">SliderToolTip</a>* <a class="code" href="classDynamicSlider.html#abaec59346de86d20ab3b080017fe9ddd">tooltip</a>; <a name="l00061"></a><a class="code" href="classDynamicSlider.html#ab00ccc1a115d7e5d7f749e0f5f8f9b69">00061</a> QPoint <a class="code" href="classDynamicSlider.html#ab00ccc1a115d7e5d7f749e0f5f8f9b69">cachedMousePos</a>; <a name="l00062"></a>00062 <a name="l00063"></a>00063 signals: <a name="l00064"></a>00064 <span class="keywordtype">void</span> <a class="code" href="classDynamicSlider.html#a795da3b646f8b45c729e460254ba25b5">mouseHasMoved</a>(); <a name="l00065"></a>00065 <a name="l00066"></a>00066 <span class="keyword">private</span> slots: <a name="l00067"></a>00067 <span class="keywordtype">void</span> <a class="code" href="classDynamicSlider.html#ac47d3ba81f627f9733e48c918e6edf68">updateTooltipLabel</a>(); <a name="l00068"></a>00068 }; <a name="l00069"></a>00069 <span class="comment">//==========================================</span> <a name="l00071"></a><a class="code" href="classSliderToolTip.html">00071</a> <span class="comment"></span><span class="keyword">class </span><a class="code" href="classSliderToolTip.html" title="private class used by the DynamicSlider to show tooltips. do not use!">SliderToolTip</a> : <span class="keyword">public</span> <a class="code" href="classQLabel.html">QLabel</a> <a name="l00072"></a>00072 { <a name="l00073"></a>00073 Q_OBJECT <a name="l00074"></a>00074 <a name="l00075"></a>00075 <span class="keyword">public</span>: <a name="l00076"></a>00076 <a class="code" href="classSliderToolTip.html#a95194b0b82c3f67c0749856b6eebc340">SliderToolTip</a>( <a class="code" href="classQWidget.html">QWidget</a>* parent, <a class="code" href="classDynamicSlider.html" title="A more dynamic slider that provides moving tooltips that show the slider value.">DynamicSlider</a>* <a class="code" href="classSliderToolTip.html#a675a4a11a7dca57ee08601ab6c82dccc">slider</a>); <a name="l00077"></a>00077 <a name="l00078"></a>00078 <span class="keyword">private</span>: <a name="l00079"></a><a class="code" href="classSliderToolTip.html#a675a4a11a7dca57ee08601ab6c82dccc">00079</a> <a class="code" href="classDynamicSlider.html" title="A more dynamic slider that provides moving tooltips that show the slider value.">DynamicSlider</a>* slider; <a name="l00080"></a>00080 <a name="l00081"></a>00081 <span class="keyword">private</span> slots: <a name="l00082"></a>00082 <span class="keywordtype">void</span> <a class="code" href="classSliderToolTip.html#a4741a23998857159a43f8a6eeaa63728">showTooltip</a>(); <a name="l00083"></a>00083 <span class="keywordtype">void</span> <a class="code" href="classSliderToolTip.html#aeb87ea9e5448733241847a31ad8de4fa">update</a>(); <a name="l00084"></a>00084 <span class="keywordtype">void</span> <a class="code" href="classSliderToolTip.html#ad32e4f2734d2693bfe4211256d21f03d">hideTooltip</a>(); <a name="l00085"></a>00085 }; <a name="l00086"></a>00086 <span class="comment">//==========================================</span> <a name="l00087"></a>00087 <a name="l00088"></a>00088 <span class="preprocessor">#endif //GUI_DYNAMICSLIDER_H</span> </pre></div></div> <hr size="1"/><address style="text-align: right;"><small>Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address> </body> </html>