Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > b3a1f4d91c26f535919e39e25606614a > files > 711

wt-doc-3.2.3-1.fc18.noarch.rpm

<!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>Wt examples: Drag and Drop example</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Wt examples
   &#160;<span id="projectnumber">3.2.3</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Drag and Drop example</div>  </div>
</div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCharacter.html">Character</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">A Matrix character that takes red and/or blue pills.  <a href="classCharacter.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WImage.html">WImage</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dragexample.html#ga2dce13ff08ea69ed783345ee01669a68">createDragImage</a> (const char *url, const char *smallurl, const char *mimeType, <a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html">WContainerWidget</a> *p)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Create an image which can be dragged.  <a href="#ga2dce13ff08ea69ed783345ee01669a68"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dragexample.html#ga14e2e7211ec4b667b4ba39d7cfe89dc1">DragExample::DragExample</a> (<a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html">Wt::WContainerWidget</a> *parent)</td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga2dce13ff08ea69ed783345ee01669a68"></a><!-- doxytag: member="DragExample.C::createDragImage" ref="ga2dce13ff08ea69ed783345ee01669a68" args="(const char *url, const char *smallurl, const char *mimeType, WContainerWidget *p)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WImage.html">WImage</a>* createDragImage </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>url</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>smallurl</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>mimeType</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html">WContainerWidget</a> *&#160;</td>
          <td class="paramname"><em>p</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Create an image which can be dragged. </p>
<p>The image to be displayed when dragging is given by smallurl, and configured with the given mime type </p>

<p>Definition at line <a class="el" href="DragExample_8C_source.html#l00019">19</a> of file <a class="el" href="DragExample_8C_source.html">DragExample.C</a>.</p>
<div class="fragment"><pre class="fragment">{
  <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WImage.html">WImage</a> *result = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WImage.html">WImage</a>(url, p);
  <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WImage.html">WImage</a> *dragImage = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WImage.html">WImage</a>(smallurl, p);

  <span class="comment">/*</span>
<span class="comment">   * Set the image to be draggable, showing the other image (dragImage)</span>
<span class="comment">   * to be used as the widget that is visually dragged.</span>
<span class="comment">   */</span>
  result-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WInteractWidget.html#a556c14d02388720b1d95b2149be2e867">setDraggable</a>(mimeType, dragImage, <span class="keyword">true</span>);

  <span class="keywordflow">return</span> result;
}
</pre></div>
</div>
</div>
<a class="anchor" id="ga14e2e7211ec4b667b4ba39d7cfe89dc1"></a><!-- doxytag: member="DragExample::DragExample" ref="ga14e2e7211ec4b667b4ba39d7cfe89dc1" args="(Wt::WContainerWidget *parent)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">DragExample::DragExample </td>
          <td>(</td>
          <td class="paramtype"><a class="elRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html">Wt::WContainerWidget</a> *&#160;</td>
          <td class="paramname"><em>parent</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="DragExample_8C_source.html#l00035">35</a> of file <a class="el" href="DragExample_8C_source.html">DragExample.C</a>.</p>
<div class="fragment"><pre class="fragment">                                                :
  <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html#a520ba6e52a36a7f2efbef1a31a69e898">WContainerWidget</a>(parent)
{
  <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WText.html">WText</a>(<span class="stringliteral">&quot;&lt;p&gt;Help these people with their decision by dragging one of &quot;</span>
            <span class="stringliteral">&quot;the pills.&lt;/p&gt;&quot;</span>, <span class="keyword">this</span>);

  <span class="keywordflow">if</span> (!wApp-&gt;environment().javaScript()) {
    <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WText.html">WText</a>(<span class="stringliteral">&quot;&lt;i&gt;This examples requires that javascript support is &quot;</span>
              <span class="stringliteral">&quot;enabled.&lt;/i&gt;&quot;</span>, <span class="keyword">this</span>);
  }

  <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html">WContainerWidget</a> *pills = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html#a520ba6e52a36a7f2efbef1a31a69e898">WContainerWidget</a>(<span class="keyword">this</span>);
  pills-&gt;<a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html#aba13c9e62c74bcba53519ee9cf41f40a">setContentAlignment</a>(AlignCenter);

  <a class="code" href="group__dragexample.html#ga2dce13ff08ea69ed783345ee01669a68" title="Create an image which can be dragged.">createDragImage</a>(<span class="stringliteral">&quot;icons/blue-pill.jpg&quot;</span>,
                  <span class="stringliteral">&quot;icons/blue-pill-small.png&quot;</span>,
                  <span class="stringliteral">&quot;blue-pill&quot;</span>, pills);
  <a class="code" href="group__dragexample.html#ga2dce13ff08ea69ed783345ee01669a68" title="Create an image which can be dragged.">createDragImage</a>(<span class="stringliteral">&quot;icons/red-pill.jpg&quot;</span>,
                  <span class="stringliteral">&quot;icons/red-pill-small.png&quot;</span>,
                  <span class="stringliteral">&quot;red-pill&quot;</span>, pills);

  <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html">WContainerWidget</a> *dropSites = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html" href="../../reference/html/classWt_1_1WContainerWidget.html#a520ba6e52a36a7f2efbef1a31a69e898">WContainerWidget</a>(<span class="keyword">this</span>);

  <span class="keyword">new</span> <a class="code" href="classCharacter.html" title="A Matrix character that takes red and/or blue pills.">Character</a>(<span class="stringliteral">&quot;Neo&quot;</span>, dropSites);
  <span class="keyword">new</span> <a class="code" href="classCharacter.html" title="A Matrix character that takes red and/or blue pills.">Character</a>(<span class="stringliteral">&quot;Morpheus&quot;</span>, dropSites);
  <span class="keyword">new</span> <a class="code" href="classCharacter.html" title="A Matrix character that takes red and/or blue pills.">Character</a>(<span class="stringliteral">&quot;Trinity&quot;</span>, dropSites);

}
</pre></div>
</div>
</div>
</div>
<hr size="1"><address style="text-align: right; margin: 3px"><small>
Generated on Thu Nov 1 2012 for <a href="http://www.webtoolkit.eu/wt">the
C++ Web Toolkit (Wt)</a> by&nbsp;<a
href="http://www.doxygen.org/index.html"><img src="doxygen.png"
alt="doxygen" border="0" style="vertical-align: middle; display:
inline-block; height: 2em"></a> 1.7.5.1</small></address>
</body>
</html>