Source

cappuccino-docs / cappuccino docs / cappuccino.org / learn / documentation / class_c_p_alert.html

<!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">

<!-- Mirrored from cappuccino.org/learn/documentation/class_c_p_alert.html by HTTrack Website Copier/3.x [XR&CO'2006], Mon, 20 Sep 2010 02:16:42 GMT -->
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Cappuccino API: CPAlert Class Reference</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.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</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 class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="classes.html"><span>Class&nbsp;Index</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>CPAlert Class Reference<br/>
<small>
[<a class="el" href="group__appkit.html">AppKit</a>]</small>
</h1><!-- doxytag: class="CPAlert" -->
<p><a href="class_c_p_alert-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(void)&nbsp;</td><td class="memItemRight" valign="bottom">- <a class="el" href="class_c_p_alert.html#a96fe189b1b6494c8a6c5e27e6f513824">addButtonWithTitle:</a><code> [implementation]</code></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(CPAlertStyle)&nbsp;</td><td class="memItemRight" valign="bottom">- <a class="el" href="class_c_p_alert.html#af3f63bae310f0585de8324616e3369b5">alertStyle</a><code> [implementation]</code></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(void)&nbsp;</td><td class="memItemRight" valign="bottom">- <a class="el" href="class_c_p_alert.html#ac5b5666c0f6127b7da6f96e399240c80">delegate</a><code> [implementation]</code></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(id)&nbsp;</td><td class="memItemRight" valign="bottom">- <a class="el" href="class_c_p_alert.html#a57defaee78f2ef0a3805309489c1708c">init</a><code> [implementation]</code></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(<a class="el" href="class_c_p_string.html">CPString</a>)&nbsp;</td><td class="memItemRight" valign="bottom">- <a class="el" href="class_c_p_alert.html#a09b0539c96d43c0e86ffb76446c9769e">messageText</a><code> [implementation]</code></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(void)&nbsp;</td><td class="memItemRight" valign="bottom">- <a class="el" href="class_c_p_alert.html#a91c69b7cd99a7eecdfce90a3e772d764">runModal</a><code> [implementation]</code></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(void)&nbsp;</td><td class="memItemRight" valign="bottom">- <a class="el" href="class_c_p_alert.html#a419eb062673bb0bc48d6b000f8a90daf">setAlertStyle:</a><code> [implementation]</code></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(void)&nbsp;</td><td class="memItemRight" valign="bottom">- <a class="el" href="class_c_p_alert.html#aba078fe16d4bd904da13a0e0a896c3fc">setDelegate:</a><code> [implementation]</code></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(void)&nbsp;</td><td class="memItemRight" valign="bottom">- <a class="el" href="class_c_p_alert.html#ac84c2267b30f48d98f712cc8c2974f34">setMessageText:</a><code> [implementation]</code></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(void)&nbsp;</td><td class="memItemRight" valign="bottom">- <a class="el" href="class_c_p_alert.html#af605b4c2575069abb27eee652c98f13b">setTitle:</a><code> [implementation]</code></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(void)&nbsp;</td><td class="memItemRight" valign="bottom">- <a class="el" href="class_c_p_alert.html#ac8aa4e8ca3bea0bcbe4a6b2a9e7d04a5">setWindowStyle:</a><code> [implementation]</code></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(<a class="el" href="class_c_p_string.html">CPString</a>)&nbsp;</td><td class="memItemRight" valign="bottom">- <a class="el" href="class_c_p_alert.html#afc10202a64f2f89a3063980aa9232f59">title</a><code> [implementation]</code></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(int)&nbsp;</td><td class="memItemRight" valign="bottom">- <a class="el" href="class_c_p_alert.html#a057d961fbfba36d5dcb15c347b164668">windowStyle</a><code> [implementation]</code></td></tr>
<tr><td colspan="2"><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">(void)&nbsp;</td><td class="memItemRight" valign="bottom">+ <a class="el" href="class_c_p_alert.html#af3f44e3c397c22847f57a7ee3b3fcbad">initialize</a><code> [implementation]</code></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p><a class="el" href="class_c_p_alert.html">CPAlert</a> is an alert panel that can be displayed modally to present the user with a message and one or more options.</p>
<p>It can be used to display an information message <code>CPInformationalAlertStyle</code>, a warning message <code>CPWarningAlertStyle</code> (the default), or a critical alert <code>CPCriticalAlertStyle</code>. In each case the user can be presented with one or more options by adding buttons using the <code>-addButtonWithTitle</code>: method.</p>
<p>The panel is displayed modally by calling <code>-runModal</code> and once the user has dismissed the panel, a message will be sent to the panel's delegate (if set), informing it which button was clicked (see delegate methods).</p>
<p>-(void)alertDidEnd:(CPAlert)theAlert returnCode:(int)returnCode; Called when the user dismisses the alert by clicking one of the buttons. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>theAlert</em>&nbsp;</td><td>the alert panel that the user dismissed </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>returnCode</em>&nbsp;</td><td>the index of the button that the user clicked (starting from 0, representing the first button added to the alert which appears on the right, 1 representing the next button to the left and so on) </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_c_p_alert_8j_source.html#l00081">81</a> of file <a class="el" href="_c_p_alert_8j_source.html">CPAlert.j</a>.</p>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a96fe189b1b6494c8a6c5e27e6f513824"></a><!-- doxytag: member="CPAlert::addButtonWithTitle:" ref="a96fe189b1b6494c8a6c5e27e6f513824" args="(CPString title)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (void) addButtonWithTitle: </td>
          <td></td>
          <td class="paramtype">(<a class="el" href="class_c_p_string.html">CPString</a>)&nbsp;</td>
          <td class="paramname"> <em>title</em></td>
          <td>&nbsp;</td>
          <td><code> [implementation]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Adds a button with a given title to the receiver. Buttons will be added starting from the right hand side of the <code><a class="el" href="class_c_p_alert.html">CPAlert</a></code> panel. The first button will have the index 0, the second button 1 and so on.</p>
<p>You really shouldn't need more than 3 buttons. </p>

<p>Definition at line <a class="el" href="_c_p_alert_8j_source.html#l00257">257</a> of file <a class="el" href="_c_p_alert_8j_source.html">CPAlert.j</a>.</p>

</div>
</div>
<a class="anchor" id="af3f63bae310f0585de8324616e3369b5"></a><!-- doxytag: member="CPAlert::alertStyle" ref="af3f63bae310f0585de8324616e3369b5" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (CPAlertStyle) alertStyle </td>
          <td></td>
          <td class="paramname"></td>
          <td>&nbsp;</td>
          <td><code> [implementation]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Gets the alert style. </p>

<p>Definition at line <a class="el" href="_c_p_alert_8j_source.html#l00228">228</a> of file <a class="el" href="_c_p_alert_8j_source.html">CPAlert.j</a>.</p>

</div>
</div>
<a class="anchor" id="ac5b5666c0f6127b7da6f96e399240c80"></a><!-- doxytag: member="CPAlert::delegate" ref="ac5b5666c0f6127b7da6f96e399240c80" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (void) delegate </td>
          <td></td>
          <td class="paramname"></td>
          <td>&nbsp;</td>
          <td><code> [implementation]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Gets the receiver's delegate. </p>

<p>Definition at line <a class="el" href="_c_p_alert_8j_source.html#l00211">211</a> of file <a class="el" href="_c_p_alert_8j_source.html">CPAlert.j</a>.</p>

</div>
</div>
<a class="anchor" id="a57defaee78f2ef0a3805309489c1708c"></a><!-- doxytag: member="CPAlert::init" ref="a57defaee78f2ef0a3805309489c1708c" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (id) init </td>
          <td></td>
          <td class="paramname"></td>
          <td>&nbsp;</td>
          <td><code> [implementation]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Initializes a <code><a class="el" href="class_c_p_alert.html">CPAlert</a></code> panel with the default alert style <code>CPWarningAlertStyle</code>. </p>

<p>Definition at line <a class="el" href="_c_p_alert_8j_source.html#l00117">117</a> of file <a class="el" href="_c_p_alert_8j_source.html">CPAlert.j</a>.</p>

</div>
</div>
<a class="anchor" id="af3f44e3c397c22847f57a7ee3b3fcbad"></a><!-- doxytag: member="CPAlert::initialize" ref="af3f44e3c397c22847f57a7ee3b3fcbad" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">+ (void) initialize </td>
          <td></td>
          <td class="paramname"></td>
          <td>&nbsp;</td>
          <td><code> [implementation]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_c_p_alert_8j_source.html#l00097">97</a> of file <a class="el" href="_c_p_alert_8j_source.html">CPAlert.j</a>.</p>

</div>
</div>
<a class="anchor" id="a09b0539c96d43c0e86ffb76446c9769e"></a><!-- doxytag: member="CPAlert::messageText" ref="a09b0539c96d43c0e86ffb76446c9769e" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (<a class="el" href="class_c_p_string.html">CPString</a>) messageText </td>
          <td></td>
          <td class="paramname"></td>
          <td>&nbsp;</td>
          <td><code> [implementation]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Return's the receiver's message text body. </p>

<p>Definition at line <a class="el" href="_c_p_alert_8j_source.html#l00245">245</a> of file <a class="el" href="_c_p_alert_8j_source.html">CPAlert.j</a>.</p>

</div>
</div>
<a class="anchor" id="a91c69b7cd99a7eecdfce90a3e772d764"></a><!-- doxytag: member="CPAlert::runModal" ref="a91c69b7cd99a7eecdfce90a3e772d764" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (void) runModal </td>
          <td></td>
          <td class="paramname"></td>
          <td>&nbsp;</td>
          <td><code> [implementation]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Displays the <code><a class="el" href="class_c_p_alert.html">CPAlert</a></code> panel as a modal dialog. The user will not be able to interact with any other controls until s/he has dismissed the alert by clicking on one of the buttons. </p>

<p>Definition at line <a class="el" href="_c_p_alert_8j_source.html#l00284">284</a> of file <a class="el" href="_c_p_alert_8j_source.html">CPAlert.j</a>.</p>

</div>
</div>
<a class="anchor" id="a419eb062673bb0bc48d6b000f8a90daf"></a><!-- doxytag: member="CPAlert::setAlertStyle:" ref="a419eb062673bb0bc48d6b000f8a90daf" args="(CPAlertStyle style)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (void) setAlertStyle: </td>
          <td></td>
          <td class="paramtype">(CPAlertStyle)&nbsp;</td>
          <td class="paramname"> <em>style</em></td>
          <td>&nbsp;</td>
          <td><code> [implementation]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sets the alert style of the receiver. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>style</em>&nbsp;</td><td>- Alert style for the alert. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_c_p_alert_8j_source.html#l00220">220</a> of file <a class="el" href="_c_p_alert_8j_source.html">CPAlert.j</a>.</p>

</div>
</div>
<a class="anchor" id="aba078fe16d4bd904da13a0e0a896c3fc"></a><!-- doxytag: member="CPAlert::setDelegate:" ref="aba078fe16d4bd904da13a0e0a896c3fc" args="(id delegate)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (void) setDelegate: </td>
          <td></td>
          <td class="paramtype">(id)&nbsp;</td>
          <td class="paramname"> <em>delegate</em></td>
          <td>&nbsp;</td>
          <td><code> [implementation]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sets the receiver’s delegate. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>delegate</em>&nbsp;</td><td>- Delegate for the alert. nil removes the delegate. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_c_p_alert_8j_source.html#l00203">203</a> of file <a class="el" href="_c_p_alert_8j_source.html">CPAlert.j</a>.</p>

</div>
</div>
<a class="anchor" id="ac84c2267b30f48d98f712cc8c2974f34"></a><!-- doxytag: member="CPAlert::setMessageText:" ref="ac84c2267b30f48d98f712cc8c2974f34" args="(CPString messageText)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (void) setMessageText: </td>
          <td></td>
          <td class="paramtype">(<a class="el" href="class_c_p_string.html">CPString</a>)&nbsp;</td>
          <td class="paramname"> <em>messageText</em></td>
          <td>&nbsp;</td>
          <td><code> [implementation]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Set’s the receiver’s message text, or title, to a given text. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>messageText</em>&nbsp;</td><td>- Message text for the alert. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_c_p_alert_8j_source.html#l00237">237</a> of file <a class="el" href="_c_p_alert_8j_source.html">CPAlert.j</a>.</p>

</div>
</div>
<a class="anchor" id="af605b4c2575069abb27eee652c98f13b"></a><!-- doxytag: member="CPAlert::setTitle:" ref="af605b4c2575069abb27eee652c98f13b" args="(CPString aTitle)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (void) setTitle: </td>
          <td></td>
          <td class="paramtype">(<a class="el" href="class_c_p_string.html">CPString</a>)&nbsp;</td>
          <td class="paramname"> <em>aTitle</em></td>
          <td>&nbsp;</td>
          <td><code> [implementation]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sets the window's title. If this is not defined, a default title based on your warning level will be used. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>aTitle</em>&nbsp;</td><td>the title to use in place of the default. Set to nil to use default. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_c_p_alert_8j_source.html#l00178">178</a> of file <a class="el" href="_c_p_alert_8j_source.html">CPAlert.j</a>.</p>

</div>
</div>
<a class="anchor" id="ac8aa4e8ca3bea0bcbe4a6b2a9e7d04a5"></a><!-- doxytag: member="CPAlert::setWindowStyle:" ref="ac8aa4e8ca3bea0bcbe4a6b2a9e7d04a5" args="(int styleMask)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (void) setWindowStyle: </td>
          <td></td>
          <td class="paramtype">(int)&nbsp;</td>
          <td class="paramname"> <em>styleMask</em></td>
          <td>&nbsp;</td>
          <td><code> [implementation]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sets the window appearance. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>styleMask</em>&nbsp;</td><td>- Either CPHUDBackgroundWindowMask or nil for standard. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_c_p_alert_8j_source.html#l00135">135</a> of file <a class="el" href="_c_p_alert_8j_source.html">CPAlert.j</a>.</p>

</div>
</div>
<a class="anchor" id="afc10202a64f2f89a3063980aa9232f59"></a><!-- doxytag: member="CPAlert::title" ref="afc10202a64f2f89a3063980aa9232f59" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (<a class="el" href="class_c_p_string.html">CPString</a>) title </td>
          <td></td>
          <td class="paramname"></td>
          <td>&nbsp;</td>
          <td><code> [implementation]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Gets the window's title. </p>

<p>Definition at line <a class="el" href="_c_p_alert_8j_source.html#l00186">186</a> of file <a class="el" href="_c_p_alert_8j_source.html">CPAlert.j</a>.</p>

</div>
</div>
<a class="anchor" id="a057d961fbfba36d5dcb15c347b164668"></a><!-- doxytag: member="CPAlert::windowStyle" ref="a057d961fbfba36d5dcb15c347b164668" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">- (int) windowStyle </td>
          <td></td>
          <td class="paramname"></td>
          <td>&nbsp;</td>
          <td><code> [implementation]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Gets the window's style. </p>

<p>Definition at line <a class="el" href="_c_p_alert_8j_source.html#l00194">194</a> of file <a class="el" href="_c_p_alert_8j_source.html">CPAlert.j</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>AppKit/<a class="el" href="_c_p_alert_8j_source.html">CPAlert.j</a></li>
</ul>
</div>
<hr size="1"/><address style="text-align: right;"><small>Generated on Tue Apr 6 10:33:04 2010 for Cappuccino API by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>

<!-- Mirrored from cappuccino.org/learn/documentation/class_c_p_alert.html by HTTrack Website Copier/3.x [XR&CO'2006], Mon, 20 Sep 2010 02:16:43 GMT -->
</html>