File: ChartsExample_8C.html

package info (click to toggle)
witty 3.1.2-3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 45,512 kB
  • ctags: 35,832
  • sloc: cpp: 69,469; ansic: 66,945; xml: 4,383; sh: 594; perl: 108; makefile: 106
file content (100 lines) | stat: -rw-r--r-- 6,174 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!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>Wt examples: /home/koen/project/wt/public-git/wt/examples/charts/ChartsExample.C File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;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 class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>/home/koen/project/wt/public-git/wt/examples/charts/ChartsExample.C File Reference</h1><code>#include &lt;math.h&gt;</code><br>
<code>#include &lt;fstream&gt;</code><br>
<code>#include &quot;<a class="el" href="ChartsExample_8h-source.html">ChartsExample.h</a>&quot;</code><br>
<code>#include &quot;<a class="el" href="ChartConfig_8h-source.html">ChartConfig.h</a>&quot;</code><br>
<code>#include &quot;<a class="el" href="charts_2CsvUtil_8h-source.html">CsvUtil.h</a>&quot;</code><br>
<code>#include &lt;Wt/WApplication&gt;</code><br>
<code>#include &lt;Wt/WDate&gt;</code><br>
<code>#include &lt;Wt/WEnvironment&gt;</code><br>
<code>#include &lt;Wt/WStandardItemModel&gt;</code><br>
<code>#include &lt;Wt/WText&gt;</code><br>
<code>#include &lt;Wt/WBorderLayout&gt;</code><br>
<code>#include &lt;Wt/WFitLayout&gt;</code><br>
<code>#include &lt;Wt/Ext/Calendar&gt;</code><br>
<code>#include &lt;Wt/Ext/Container&gt;</code><br>
<code>#include &lt;Wt/Ext/DateField&gt;</code><br>
<code>#include &lt;Wt/Ext/LineEdit&gt;</code><br>
<code>#include &lt;Wt/Ext/NumberField&gt;</code><br>
<code>#include &lt;Wt/Ext/Panel&gt;</code><br>
<code>#include &lt;Wt/Ext/TableView&gt;</code><br>
<code>#include &lt;Wt/Chart/WCartesianChart&gt;</code><br>
<code>#include &lt;Wt/Chart/WPieChart&gt;</code><br>

<p>
<a href="ChartsExample_8C-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WAbstractItemModel.html">WAbstractItemModel</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ChartsExample_8C.html#ffec5e7d98eb601a40bf039d67cd7982">readCsvFile</a> (const char *fname, <a class="elRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WContainerWidget.html">WContainerWidget</a> *parent)</td></tr>

</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="ffec5e7d98eb601a40bf039d67cd7982"></a><!-- doxytag: member="ChartsExample.C::readCsvFile" ref="ffec5e7d98eb601a40bf039d67cd7982" args="(const char *fname, WContainerWidget *parent)" -->
<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_1WAbstractItemModel.html">WAbstractItemModel</a>* @92::readCsvFile           </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>fname</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> *&nbsp;</td>
          <td class="paramname"> <em>parent</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>

<p>Definition at line <a class="el" href="ChartsExample_8C-source.html#l00037">37</a> of file <a class="el" href="ChartsExample_8C-source.html">ChartsExample.C</a>.</p>
<div class="fragment"><pre class="fragment"><a name="l00039"></a>00039   {
<a name="l00040"></a>00040     <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WStandardItemModel.html">WStandardItemModel</a> *model = <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WStandardItemModel.html">WStandardItemModel</a>(0, 0, parent);
<a name="l00041"></a>00041     std::ifstream f(fname);
<a name="l00042"></a>00042     
<a name="l00043"></a>00043     <span class="keywordflow">if</span> (f) {
<a name="l00044"></a>00044       <a class="code" href="group__chartsexample.html#g1ce51cd14c57073cb7839d5e05b59c65" title="Utility function that reads a model from a CSV file.">readFromCsv</a>(f, model);
<a name="l00045"></a>00045       <span class="keywordflow">return</span> model;
<a name="l00046"></a>00046     } <span class="keywordflow">else</span> {
<a name="l00047"></a>00047       <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WString.html">WString</a> error(WString::tr(<span class="stringliteral">"error-missing-data"</span>));
<a name="l00048"></a>00048       error.arg(fname, UTF8);
<a name="l00049"></a>00049       <span class="keyword">new</span> <a class="codeRef" doxygen="wt.tags:../../reference/html/" href="../../reference/html/classWt_1_1WText.html">WText</a>(error, parent);
<a name="l00050"></a>00050       <span class="keywordflow">return</span> 0;
<a name="l00051"></a>00051     }
<a name="l00052"></a>00052   }
</pre></div>
<p>

</div>
</div><p>
</div>
<hr size="1"><address style="align: right;"><small>
Generated on Fri Mar 26 17:12:12 2010 for <a href="http://www.webtoolkit.eu/wt/">Wt</a> by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6</small></address>
</body>
</html>