You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kshowmail/doc/html/kshowmaildock_8cpp-source.html

106 lines
9.0 KiB

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>kshowmail: kshowmail/kshowmaildock.cpp Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.0 -->
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="classes.html"><span>Classes</span></a></li>
<li id="current"><a href="files.html"><span>Files</span></a></li>
<li><a href="dirs.html"><span>Directories</span></a></li>
</ul></div>
<div class="nav">
<a class="el" href="dir_656923b733374505e0e2f68ecb68d952.html">kshowmail</a></div>
<h1>kshowmaildock.cpp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/***************************************************************************</span>
<a name="l00002"></a>00002 <span class="comment"> kshowmaildock.cpp - description</span>
<a name="l00003"></a>00003 <span class="comment"> -------------------</span>
<a name="l00004"></a>00004 <span class="comment"> begin : Wed Jan 3 2001</span>
<a name="l00005"></a>00005 <span class="comment"> copyright : (C) 2001 by Eggert Ehmke</span>
<a name="l00006"></a>00006 <span class="comment"> email : eggert.ehmke@berlin.de</span>
<a name="l00007"></a>00007 <span class="comment"> ***************************************************************************/</span>
<a name="l00008"></a>00008
<a name="l00009"></a>00009 <span class="comment">/***************************************************************************</span>
<a name="l00010"></a>00010 <span class="comment"> * *</span>
<a name="l00011"></a>00011 <span class="comment"> * This program is free software; you can redistribute it and/or modify *</span>
<a name="l00012"></a>00012 <span class="comment"> * it under the terms of the GNU General Public License as published by *</span>
<a name="l00013"></a>00013 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or *</span>
<a name="l00014"></a>00014 <span class="comment"> * (at your option) any later version. *</span>
<a name="l00015"></a>00015 <span class="comment"> * *</span>
<a name="l00016"></a>00016 <span class="comment"> ***************************************************************************/</span>
<a name="l00017"></a>00017
<a name="l00018"></a>00018 <span class="preprocessor">#include &lt;ntqpixmap.h&gt;</span>
<a name="l00019"></a>00019 <span class="preprocessor">#include &lt;ntqpainter.h&gt;</span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &lt;ntqtooltip.h&gt;</span>
<a name="l00021"></a>00021
<a name="l00022"></a>00022 <span class="preprocessor">#include &lt;tdepopupmenu.h&gt;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;kstandarddirs.h&gt;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;tdeglobalsettings.h&gt;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;tdelocale.h&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;kdebug.h&gt;</span>
<a name="l00027"></a>00027
<a name="l00028"></a>00028 <span class="preprocessor">#include "kshowmail.h"</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include "kshowmaildock.h"</span>
<a name="l00030"></a>00030
<a name="l00031"></a><a class="code" href="classKShowMailDock.html#15d2f2f49e443745b1986d23c1a08df5">00031</a> <a class="code" href="classKShowMailDock.html#15d2f2f49e443745b1986d23c1a08df5">KShowMailDock::KShowMailDock</a>(TQWidget* parent, TDEAction *actionRefresh )
<a name="l00032"></a>00032 : KSystemTray (parent, 0),
<a name="l00033"></a>00033 m_background (TQPixmap(::locate (<span class="stringliteral">"data"</span>, <span class="stringliteral">"kshowmail/pics/kshowmail24.png"</span>)))
<a name="l00034"></a>00034 {
<a name="l00035"></a>00035 <span class="comment">// kdDebug () &lt;&lt; "KShowMailDock::KShowMailDock" &lt;&lt; endl;</span>
<a name="l00036"></a>00036 <a class="code" href="classKShowMailDock.html#c09e902133a084b547bdd29646a759b4">drawText</a> (<span class="stringliteral">"?"</span>, TQt::red);
<a name="l00037"></a>00037 TQToolTip::add (<span class="keyword">this</span>, i18n(<span class="stringliteral">"KShowmail: a powerful pop3 email checker"</span>));
<a name="l00038"></a>00038
<a name="l00039"></a>00039 show();
<a name="l00040"></a>00040
<a name="l00041"></a>00041 actionRefresh-&gt;plug( contextMenu() );
<a name="l00042"></a>00042 <span class="comment">//((KShowMailApp*)parent)-&gt;m_actionRefresh-&gt;plug (contextMenu());</span>
<a name="l00043"></a>00043 connect (contextMenu(),SIGNAL(activated(<span class="keywordtype">int</span>)),<span class="keyword">this</span>, SIGNAL(<a class="code" href="classKShowMailDock.html#33e30411ee0935453e742385268f7bc0">sigActivated</a>(<span class="keywordtype">int</span>)));
<a name="l00044"></a>00044 connect (contextMenu(),SIGNAL(highlighted(<span class="keywordtype">int</span>)),<span class="keyword">this</span>, SIGNAL(<a class="code" href="classKShowMailDock.html#ee1e61dcbf2fb183c309c0637ceb23e2">sigHighlighted</a>(<span class="keywordtype">int</span>)));
<a name="l00045"></a>00045 }
<a name="l00046"></a>00046
<a name="l00047"></a><a class="code" href="classKShowMailDock.html#c09e902133a084b547bdd29646a759b4">00047</a> <span class="keywordtype">void</span> <a class="code" href="classKShowMailDock.html#c09e902133a084b547bdd29646a759b4">KShowMailDock::drawText</a> (<span class="keyword">const</span> TQString str, <span class="keyword">const</span> TQColor&amp; color)
<a name="l00048"></a>00048 {
<a name="l00049"></a>00049 setPixmap (<a class="code" href="classKShowMailDock.html#3535a9e1ca33dce759bb066463879976">m_background</a>);
<a name="l00050"></a>00050 TQPixmap* pix = pixmap ();
<a name="l00051"></a>00051 <span class="keywordflow">if</span> (pix &amp;&amp; !pix-&gt;isNull ())
<a name="l00052"></a>00052 {
<a name="l00053"></a>00053 TQPainter p (pix);
<a name="l00054"></a>00054 <span class="comment">// p.setFont (TDEGlobalSettings::toolBarFont());</span>
<a name="l00055"></a>00055 p.setFont (TDEGlobalSettings::windowTitleFont());
<a name="l00056"></a>00056 p.setPen (color);
<a name="l00057"></a>00057 p.drawText (0,0,24,24,TQPainter::AlignCenter,str,str.length());
<a name="l00058"></a>00058 }
<a name="l00059"></a>00059 <span class="keywordflow">else</span>
<a name="l00060"></a>00060 kdError () &lt;&lt; <span class="stringliteral">"No pixmap for traybar !"</span> &lt;&lt; endl;
<a name="l00061"></a>00061 }
<a name="l00062"></a>00062
<a name="l00063"></a><a class="code" href="classKShowMailDock.html#c7a2ffc8a1356b33c3a71a8e1dcb08e5">00063</a> <span class="keywordtype">void</span> <a class="code" href="classKShowMailDock.html#c7a2ffc8a1356b33c3a71a8e1dcb08e5">KShowMailDock::drawNumber</a> (<span class="keywordtype">int</span> n, <span class="keyword">const</span> TQColor&amp; color)
<a name="l00064"></a>00064 {
<a name="l00065"></a>00065 setPixmap (<a class="code" href="classKShowMailDock.html#3535a9e1ca33dce759bb066463879976">m_background</a>);
<a name="l00066"></a>00066 TQPixmap* pix = pixmap ();
<a name="l00067"></a>00067 <span class="keywordflow">if</span> (pix &amp;&amp; !pix-&gt;isNull ())
<a name="l00068"></a>00068 {
<a name="l00069"></a>00069 TQString num (TQString::number(n));
<a name="l00070"></a>00070 TQPainter p (pix);
<a name="l00071"></a>00071 p.setFont (TDEGlobalSettings::toolBarFont());
<a name="l00072"></a>00072 p.setPen (color);
<a name="l00073"></a>00073 p.drawText (0,0,24,24,TQPainter::AlignCenter,num,num.length());
<a name="l00074"></a>00074 }
<a name="l00075"></a>00075 <span class="keywordflow">else</span>
<a name="l00076"></a>00076 kdError () &lt;&lt; <span class="stringliteral">"No pixmap for traybar !"</span> &lt;&lt; endl;
<a name="l00077"></a>00077 }
<a name="l00078"></a>00078
<a name="l00079"></a><a class="code" href="classKShowMailDock.html#60d63eca3fd1c24df211f88839ab197c">00079</a> <span class="keywordtype">void</span> <a class="code" href="classKShowMailDock.html#60d63eca3fd1c24df211f88839ab197c">KShowMailDock::clear</a> ()
<a name="l00080"></a>00080 {
<a name="l00081"></a>00081 setPixmap (<a class="code" href="classKShowMailDock.html#3535a9e1ca33dce759bb066463879976">m_background</a>);
<a name="l00082"></a>00082 }
<a name="l00083"></a>00083
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu Jul 5 19:36:06 2007 for kshowmail by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.0 </small></address>
</body>
</html>