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 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230
|
<!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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>wxWidgets: wxMessageOutput Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="extra_stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="page_container">
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0" style="width: 100%;">
<tbody>
<tr>
<td id="projectlogo">
<a href="http://www.wxwidgets.org/" target="_new">
<img alt="wxWidgets" src="logo.png"/>
</a>
</td>
<td style="padding-left: 0.5em; text-align: right;">
<span id="projectnumber">Version: 3.0.2</span>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.8.2 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Categories</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="#pub-static-methods">Static Public Member Functions</a> |
<a href="classwx_message_output-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">wxMessageOutput Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span><div class="ingroups"><a class="el" href="group__group__class__logging.html">Logging</a></div></div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include <wx/msgout.h></code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
<img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for wxMessageOutput:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="classwx_message_output__inherit__graph.png" border="0" usemap="#wx_message_output_inherit__map" alt="Inheritance graph"/></div>
<map name="wx_message_output_inherit__map" id="wx_message_output_inherit__map">
<area shape="rect" id="node3" href="classwx_message_output_message_box.html" title="Output messages by showing them in a message box." alt="" coords="5,83,205,111"/><area shape="rect" id="node5" href="classwx_message_output_stderr.html" title="Output messages to stderr or another STDIO file stream." alt="" coords="229,83,392,111"/><area shape="rect" id="node7" href="classwx_message_output_best.html" title="Output messages in the best possible way." alt="" coords="144,161,296,189"/><area shape="rect" id="node9" href="classwx_message_output_debug.html" title="Output messages to the system debug output channel." alt="" coords="320,161,483,189"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Simple class allowing to write strings to various output channels. </p>
<p><a class="el" href="classwx_message_output.html" title="Simple class allowing to write strings to various output channels.">wxMessageOutput</a> is a low-level class and doesn't provide any of the conveniences of <a class="el" href="classwx_log.html" title="wxLog class defines the interface for the log targets used by wxWidgets logging functions as explaine...">wxLog</a>. It simply allows to write a message to some output channel: usually file or standard error but possibly also a message box. While use of <a class="el" href="classwx_log.html" title="wxLog class defines the interface for the log targets used by wxWidgets logging functions as explaine...">wxLog</a> and related functions is preferable in many cases sometimes this simple interface may be more convenient.</p>
<p>This class itself is an abstract base class for various concrete derived classes:</p>
<ul>
<li><a class="el" href="classwx_message_output_stderr.html" title="Output messages to stderr or another STDIO file stream.">wxMessageOutputStderr</a></li>
<li><a class="el" href="classwx_message_output_best.html" title="Output messages in the best possible way.">wxMessageOutputBest</a></li>
<li><a class="el" href="classwx_message_output_message_box.html" title="Output messages by showing them in a message box.">wxMessageOutputMessageBox</a></li>
<li>wxMessageOutputLog</li>
</ul>
<p>It also provides access to the global message output object which is created by <a class="el" href="classwx_app_traits.html#a53c3290baa711f24d9fcf4883b3363a4" title="Creates the global object used for printing out messages.">wxAppTraits::CreateMessageOutput()</a> which creates an object of class <a class="el" href="classwx_message_output_stderr.html" title="Output messages to stderr or another STDIO file stream.">wxMessageOutputStderr</a> in console applications and <a class="el" href="classwx_message_output_best.html" title="Output messages in the best possible way.">wxMessageOutputBest</a> in the GUI ones but may be overridden in user-defined traits class.</p>
<p>Example of using this class: </p>
<div class="fragment"><div class="line"><a class="code" href="classwx_message_output_debug.html" title="Output messages to the system debug output channel.">wxMessageOutputDebug</a>().<a class="code" href="classwx_message_output.html#a233e76ce6c1b569f16b42b49151ab979" title="Output a message.">Printf</a>(<span class="stringliteral">"name=%s, preparing to greet..."</span>, name);</div>
<div class="line"><a class="code" href="classwx_message_output.html#aff0387f83c5ee4db7cf26b909e1057e7" title="Return the global message output object.">wxMessageOutput::Get</a>()-><a class="code" href="classwx_message_output.html#a233e76ce6c1b569f16b42b49151ab979" title="Output a message.">Printf</a>(<span class="stringliteral">"Hello, %s!"</span>, name);</div>
</div><!-- fragment --><h2></h2>
<div><span class="lib">Library:</span>  <span class="lib_text"><a class="el" href="page_libs.html#page_libs_wxbase">wxBase</a></span></div><div><span class="category">Category:</span>  <span class="category_text"><a class="el" href="group__group__class__logging.html">Logging</a></span></div> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a233e76ce6c1b569f16b42b49151ab979"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_message_output.html#a233e76ce6c1b569f16b42b49151ab979">Printf</a> (const <a class="el" href="classwx_string.html">wxString</a> &format,...)</td></tr>
<tr class="memdesc:a233e76ce6c1b569f16b42b49151ab979"><td class="mdescLeft"> </td><td class="mdescRight">Output a message. <a href="#a233e76ce6c1b569f16b42b49151ab979"></a><br/></td></tr>
<tr class="separator:a233e76ce6c1b569f16b42b49151ab979"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ae8b0b6734006e716bd80fd053a7b4e4d"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_message_output.html#ae8b0b6734006e716bd80fd053a7b4e4d">Output</a> (const <a class="el" href="classwx_string.html">wxString</a> &str)=0</td></tr>
<tr class="memdesc:ae8b0b6734006e716bd80fd053a7b4e4d"><td class="mdescLeft"> </td><td class="mdescRight">Method called by <a class="el" href="classwx_message_output.html#a233e76ce6c1b569f16b42b49151ab979" title="Output a message.">Printf()</a> to really output the text. <a href="#ae8b0b6734006e716bd80fd053a7b4e4d"></a><br/></td></tr>
<tr class="separator:ae8b0b6734006e716bd80fd053a7b4e4d"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:aff0387f83c5ee4db7cf26b909e1057e7"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classwx_message_output.html">wxMessageOutput</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_message_output.html#aff0387f83c5ee4db7cf26b909e1057e7">Get</a> ()</td></tr>
<tr class="memdesc:aff0387f83c5ee4db7cf26b909e1057e7"><td class="mdescLeft"> </td><td class="mdescRight">Return the global message output object. <a href="#aff0387f83c5ee4db7cf26b909e1057e7"></a><br/></td></tr>
<tr class="separator:aff0387f83c5ee4db7cf26b909e1057e7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac8a0f8cc3ff1c0582d7e3e3f490e7e0b"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classwx_message_output.html">wxMessageOutput</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_message_output.html#ac8a0f8cc3ff1c0582d7e3e3f490e7e0b">Set</a> (<a class="el" href="classwx_message_output.html">wxMessageOutput</a> *msgout)</td></tr>
<tr class="memdesc:ac8a0f8cc3ff1c0582d7e3e3f490e7e0b"><td class="mdescLeft"> </td><td class="mdescRight">Sets the global message output object. <a href="#ac8a0f8cc3ff1c0582d7e3e3f490e7e0b"></a><br/></td></tr>
<tr class="separator:ac8a0f8cc3ff1c0582d7e3e3f490e7e0b"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="aff0387f83c5ee4db7cf26b909e1057e7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="classwx_message_output.html">wxMessageOutput</a>* wxMessageOutput::Get </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Return the global message output object. </p>
<p>This object is never <span class="literal">NULL</span> while the program is running but may be <span class="literal">NULL</span> during initialization (before <a class="el" href="classwx_app.html" title="The wxApp class represents the application itself when wxUSE_GUI=1.">wxApp</a> object is instantiated) or shutdown.(after <a class="el" href="classwx_app.html" title="The wxApp class represents the application itself when wxUSE_GUI=1.">wxApp</a> destruction).</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_app_traits.html#a53c3290baa711f24d9fcf4883b3363a4" title="Creates the global object used for printing out messages.">wxAppTraits::CreateMessageOutput()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="ae8b0b6734006e716bd80fd053a7b4e4d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual void wxMessageOutput::Output </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>str</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Method called by <a class="el" href="classwx_message_output.html#a233e76ce6c1b569f16b42b49151ab979" title="Output a message.">Printf()</a> to really output the text. </p>
<p>This method is overridden in various derived classes and is also the one you should override if you implement a custom message output object.</p>
<p>It may also be called directly instead of <a class="el" href="classwx_message_output.html#a233e76ce6c1b569f16b42b49151ab979" title="Output a message.">Printf()</a>. This is especially useful when outputting a user-defined string because it can be simply called with this string instead of using </p>
<div class="fragment"><div class="line">msgout.Printf(<span class="stringliteral">"%s"</span>, str);</div>
</div><!-- fragment --><p> (notice that passing user-defined string to <a class="el" href="classwx_message_output.html#a233e76ce6c1b569f16b42b49151ab979" title="Output a message.">Printf()</a> directly is, of course, a security risk). </p>
</div>
</div>
<a class="anchor" id="a233e76ce6c1b569f16b42b49151ab979"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void wxMessageOutput::Printf </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>format</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"> </td>
<td class="paramname"><em>...</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Output a message. </p>
<p>This function uses the same conventions as standard <code>printf()</code>. </p>
</div>
</div>
<a class="anchor" id="ac8a0f8cc3ff1c0582d7e3e3f490e7e0b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="classwx_message_output.html">wxMessageOutput</a>* wxMessageOutput::Set </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classwx_message_output.html">wxMessageOutput</a> * </td>
<td class="paramname"><em>msgout</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the global message output object. </p>
<p>Using this function may be a simpler alternative to changing the message output object used for your program than overriding <a class="el" href="classwx_app_traits.html#a53c3290baa711f24d9fcf4883b3363a4" title="Creates the global object used for printing out messages.">wxAppTraits::CreateMessageOutput()</a>.</p>
<p>Remember to delete the returned pointer or restore it later with another call to <a class="el" href="classwx_message_output.html#ac8a0f8cc3ff1c0582d7e3e3f490e7e0b" title="Sets the global message output object.">Set()</a>. </p>
</div>
</div>
</div><!-- contents -->
<address class="footer">
<small>
Generated on Thu Nov 27 2014 13:46:51 for wxWidgets by <a href="http://www.doxygen.org/index.html" target="_new">Doxygen</a> 1.8.2
</small>
</address>
<script src="wxwidgets.js" type="text/javascript"></script>
</div><!-- #page_container -->
</body>
</html>
|