Source

cappuccino-docs / cappuccino docs / cappuccino.org / learn / documentation / _c_p_alert_8j_source.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/_c_p_alert_8j_source.html by HTTrack Website Copier/3.x [XR&CO'2006], Mon, 20 Sep 2010 02:19:28 GMT -->
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Cappuccino API: AppKit/CPAlert.j Source File</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><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>AppKit/CPAlert.j</h1><a href="_c_p_alert_8j.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * CPAlert.j</span>
<a name="l00003"></a>00003 <span class="comment"> * AppKit</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> * Created by Jake MacMullin.</span>
<a name="l00006"></a>00006 <span class="comment"> * Copyright 2008, Jake MacMullin.</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> * 11/10/2008 Ross Boucher</span>
<a name="l00009"></a>00009 <span class="comment"> *     - Make it conform to style guidelines, general cleanup and ehancements</span>
<a name="l00010"></a>00010 <span class="comment"> *</span>
<a name="l00011"></a>00011 <span class="comment"> * This library is free software; you can redistribute it and/or</span>
<a name="l00012"></a>00012 <span class="comment"> * modify it under the terms of the GNU Lesser General Public</span>
<a name="l00013"></a>00013 <span class="comment"> * License as published by the Free Software Foundation; either</span>
<a name="l00014"></a>00014 <span class="comment"> * version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00015"></a>00015 <span class="comment"> *</span>
<a name="l00016"></a>00016 <span class="comment"> * This library is distributed in the hope that it will be useful,</span>
<a name="l00017"></a>00017 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00018"></a>00018 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>
<a name="l00019"></a>00019 <span class="comment"> * Lesser General Public License for more details.</span>
<a name="l00020"></a>00020 <span class="comment"> *</span>
<a name="l00021"></a>00021 <span class="comment"> * You should have received a copy of the GNU Lesser General Public</span>
<a name="l00022"></a>00022 <span class="comment"> * License along with this library; if not, write to the Free Software</span>
<a name="l00023"></a>00023 <span class="comment"> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA</span>
<a name="l00024"></a>00024 <span class="comment"> */</span>
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 @<span class="keyword">import</span> &lt;Foundation/<a class="code" href="class_c_p_object.html" title="The root class from which most classes are subclassed.">CPObject</a>.j&gt;
<a name="l00027"></a>00027 @<span class="keyword">import</span> &lt;Foundation/<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>.j&gt;
<a name="l00028"></a>00028 
<a name="l00029"></a>00029 @<span class="keyword">import</span> &lt;AppKit/<a class="code" href="class_c_p_application.html">CPApplication</a>.j&gt;
<a name="l00030"></a>00030 @<span class="keyword">import</span> &lt;AppKit/<a class="code" href="class_c_p_button.html">CPButton</a>.j&gt;
<a name="l00031"></a>00031 @<span class="keyword">import</span> &lt;AppKit/<a class="code" href="class_c_p_color.html">CPColor</a>.j&gt;
<a name="l00032"></a>00032 @<span class="keyword">import</span> &lt;AppKit/<a class="code" href="class_c_p_font.html">CPFont</a>.j&gt;
<a name="l00033"></a>00033 @<span class="keyword">import</span> &lt;AppKit/<a class="code" href="class_c_p_image.html">CPImage</a>.j&gt;
<a name="l00034"></a>00034 @<span class="keyword">import</span> &lt;AppKit/<a class="code" href="class_c_p_image_view.html">CPImageView</a>.j&gt;
<a name="l00035"></a>00035 @<span class="keyword">import</span> &lt;AppKit/<a class="code" href="class_c_p_panel.html">CPPanel</a>.j&gt;
<a name="l00036"></a>00036 @<span class="keyword">import</span> &lt;AppKit/<a class="code" href="class_c_p_text_field.html">CPTextField</a>.j&gt;
<a name="l00037"></a>00037 
<a name="l00038"></a>00038 <span class="comment">/*</span>
<a name="l00039"></a>00039 <span class="comment">    @global</span>
<a name="l00040"></a>00040 <span class="comment">    @group CPAlertStyle</span>
<a name="l00041"></a>00041 <span class="comment">*/</span>
<a name="l00042"></a><a class="code" href="_c_p_alert_8j.html#aa27ae7f57cd7b70555f25d7e811c0ae4">00042</a> <a class="code" href="_c_p_alert_8j.html#aa27ae7f57cd7b70555f25d7e811c0ae4">CPWarningAlertStyle</a> =        0;
<a name="l00043"></a>00043 <span class="comment">/*</span>
<a name="l00044"></a>00044 <span class="comment">    @global</span>
<a name="l00045"></a>00045 <span class="comment">    @group CPAlertStyle</span>
<a name="l00046"></a>00046 <span class="comment">*/</span>
<a name="l00047"></a><a class="code" href="_c_p_alert_8j.html#a18a146df27f411508976cd4bc4cac534">00047</a> <a class="code" href="_c_p_alert_8j.html#a18a146df27f411508976cd4bc4cac534">CPInformationalAlertStyle</a> =  1;
<a name="l00048"></a>00048 <span class="comment">/*</span>
<a name="l00049"></a>00049 <span class="comment">    @global</span>
<a name="l00050"></a>00050 <span class="comment">    @group CPAlertStyle</span>
<a name="l00051"></a>00051 <span class="comment">*/</span>
<a name="l00052"></a><a class="code" href="_c_p_alert_8j.html#aab1faaf140db7366cdf0fe6ea008c975">00052</a> <a class="code" href="_c_p_alert_8j.html#aab1faaf140db7366cdf0fe6ea008c975">CPCriticalAlertStyle</a> =       2;
<a name="l00053"></a>00053 
<a name="l00054"></a>00054 
<a name="l00055"></a><a class="code" href="_c_p_alert_8j.html#ab64bc576f5fcc02f6e25b3d94a95600c">00055</a> var <a class="code" href="_c_p_alert_8j.html#ab64bc576f5fcc02f6e25b3d94a95600c">CPAlertWarningImage</a>,
<a name="l00056"></a>00056     <a class="code" href="_c_p_alert_8j.html#abe637ca921990f9bad0aec4058364bb5">CPAlertInformationImage</a>,
<a name="l00057"></a>00057     <a class="code" href="_c_p_alert_8j.html#a2aedba1b47777ff10e8099fdce421e3a">CPAlertErrorImage</a>;
<a name="l00058"></a>00058 
<a name="l00081"></a><a class="code" href="class_c_p_alert.html">00081</a> <span class="keyword">@implementation </span><a class="code" href="class_c_p_alert.html">CPAlert</a> : <a class="code" href="class_c_p_object.html" title="The root class from which most classes are subclassed.">CPObject</a>
<a name="l00082"></a>00082 {
<a name="l00083"></a>00083     <a class="code" href="class_c_p_panel.html">CPPanel</a>         _alertPanel;
<a name="l00084"></a>00084 
<a name="l00085"></a>00085     <a class="code" href="class_c_p_text_field.html">CPTextField</a>     _messageLabel;
<a name="l00086"></a>00086     <a class="code" href="class_c_p_image_view.html">CPImageView</a>     _alertImageView;
<a name="l00087"></a>00087 
<a name="l00088"></a>00088     CPAlertStyle    _alertStyle;
<a name="l00089"></a>00089     <a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>        _windowTitle;
<a name="l00090"></a>00090     <span class="keywordtype">int</span>             _windowStyle;
<a name="l00091"></a>00091     <span class="keywordtype">int</span>             _buttonCount;
<a name="l00092"></a>00092     <a class="code" href="class_c_p_array.html" title="A mutable array backed by a JavaScript Array.A mutable array class backed by a JavaScript...">CPArray</a>         _buttons;
<a name="l00093"></a>00093 
<a name="l00094"></a>00094     <span class="keywordtype">id</span>              _delegate;
<a name="l00095"></a>00095 }
<a name="l00096"></a>00096 
<a name="l00097"></a><a class="code" href="class_c_p_alert.html#af3f44e3c397c22847f57a7ee3b3fcbad">00097</a> + (void)initialize
<a name="l00098"></a>00098 {
<a name="l00099"></a>00099     <span class="keywordflow">if</span> (<span class="keyword">self</span> != <a class="code" href="class_c_p_alert.html">CPAlert</a>)
<a name="l00100"></a>00100         <span class="keywordflow">return</span>;
<a name="l00101"></a>00101 
<a name="l00102"></a>00102     var bundle = [<a class="code" href="class_c_p_bundle.html" title="Groups information about an application&amp;#39;s code &amp;amp; resources.">CPBundle</a> <a class="code" href="class_c_p_bundle.html#a6b2401dce4d84d49261126169d966567">bundleForClass</a>:[<span class="keyword">self</span> class]];   
<a name="l00103"></a>00103 
<a name="l00104"></a>00104     <a class="code" href="_c_p_alert_8j.html#ab64bc576f5fcc02f6e25b3d94a95600c">CPAlertWarningImage</a>     = [[<a class="code" href="class_c_p_image.html">CPImage</a> alloc] initWithContentsOfFile:[bundle pathForResource:@&quot;CPAlert/dialog-warning.png&quot;] 
<a name="l00105"></a>00105                                                                  size:CGSizeMake(32.0, 32.0)];
<a name="l00106"></a>00106                                                              
<a name="l00107"></a>00107     <a class="code" href="_c_p_alert_8j.html#abe637ca921990f9bad0aec4058364bb5">CPAlertInformationImage</a> = [[<a class="code" href="class_c_p_image.html">CPImage</a> alloc] initWithContentsOfFile:[bundle pathForResource:@&quot;CPAlert/dialog-information.png&quot;] 
<a name="l00108"></a>00108                                                                  size:CGSizeMake(32.0, 32.0)];
<a name="l00109"></a>00109                                                                  
<a name="l00110"></a>00110     <a class="code" href="_c_p_alert_8j.html#a2aedba1b47777ff10e8099fdce421e3a">CPAlertErrorImage</a>       = [[<a class="code" href="class_c_p_image.html">CPImage</a> alloc] initWithContentsOfFile:[bundle pathForResource:@&quot;CPAlert/dialog-error.png&quot;] 
<a name="l00111"></a>00111                                                                  size:CGSizeMake(32.0, 32.0)];
<a name="l00112"></a>00112 }
<a name="l00113"></a>00113 
<a name="l00117"></a><a class="code" href="class_c_p_alert.html#a57defaee78f2ef0a3805309489c1708c">00117</a> - (id)init
<a name="l00118"></a>00118 {
<a name="l00119"></a>00119     <span class="keywordflow">if</span> (<span class="keyword">self</span> = [super init])
<a name="l00120"></a>00120     {
<a name="l00121"></a>00121         _buttonCount = 0;
<a name="l00122"></a>00122         _buttons = [<a class="code" href="class_c_p_array.html" title="A mutable array backed by a JavaScript Array.A mutable array class backed by a JavaScript...">CPArray</a> <a class="code" href="class_c_p_array.html#aafeaf98dd280821940da2ec8be05b776">array</a>];
<a name="l00123"></a>00123         _alertStyle = <a class="code" href="_c_p_alert_8j.html#aa27ae7f57cd7b70555f25d7e811c0ae4">CPWarningAlertStyle</a>;
<a name="l00124"></a>00124 
<a name="l00125"></a>00125         [<span class="keyword">self</span> <a class="code" href="class_c_p_alert.html#ac8aa4e8ca3bea0bcbe4a6b2a9e7d04a5">setWindowStyle</a>:nil];
<a name="l00126"></a>00126     }
<a name="l00127"></a>00127     
<a name="l00128"></a>00128     <span class="keywordflow">return</span> <span class="keyword">self</span>;
<a name="l00129"></a>00129 }
<a name="l00130"></a>00130 
<a name="l00135"></a><a class="code" href="class_c_p_alert.html#ac8aa4e8ca3bea0bcbe4a6b2a9e7d04a5">00135</a> - (void)setWindowStyle:(<span class="keywordtype">int</span>)styleMask
<a name="l00136"></a>00136 {
<a name="l00137"></a>00137     _windowStyle = styleMask;
<a name="l00138"></a>00138     
<a name="l00139"></a>00139     _alertPanel = [[<a class="code" href="class_c_p_panel.html">CPPanel</a> alloc] initWithContentRect:CGRectMake(0.0, 0.0, 400.0, 110.0) styleMask:styleMask ? styleMask | CPTitledWindowMask : CPTitledWindowMask];
<a name="l00140"></a>00140     [_alertPanel setFloatingPanel:YES];
<a name="l00141"></a>00141     [_alertPanel center];
<a name="l00142"></a>00142 
<a name="l00143"></a>00143     [_messageLabel setTextColor:(styleMask &amp; CPHUDBackgroundWindowMask) ? [<a class="code" href="class_c_p_color.html">CPColor</a> whiteColor] : [<a class="code" href="class_c_p_color.html">CPColor</a> blackColor]];
<a name="l00144"></a>00144 
<a name="l00145"></a>00145     var count = [_buttons count];
<a name="l00146"></a>00146     <span class="keywordflow">for</span>(var i=0; i &lt; count; i++)
<a name="l00147"></a>00147     {
<a name="l00148"></a>00148         var button = _buttons[i];
<a name="l00149"></a>00149         
<a name="l00150"></a>00150         [button setFrameSize:CGSizeMake([button frame].size.width, (styleMask == CPHUDBackgroundWindowMask) ? 20.0 : 24.0)];
<a name="l00151"></a>00151         
<a name="l00152"></a>00152         [button setTheme:(_windowStyle === CPHUDBackgroundWindowMask) ? [<a class="code" href="class_c_p_theme.html">CPTheme</a> <a class="code" href="class_c_p_theme.html#a1fa892cba378f23063a7be7c1704ae38">themeNamed</a>:&quot;Aristo-HUD&quot;] : [<a class="code" href="class_c_p_theme.html">CPTheme</a> <a class="code" href="class_c_p_theme.html#a19028d2f26f8d89be574ebdbdcfa5f16">defaultTheme</a>]];
<a name="l00153"></a>00153 
<a name="l00154"></a>00154         [[_alertPanel contentView] addSubview:button];
<a name="l00155"></a>00155     }
<a name="l00156"></a>00156     
<a name="l00157"></a>00157     <span class="keywordflow">if</span> (!_messageLabel)
<a name="l00158"></a>00158     {
<a name="l00159"></a>00159         var bounds = [[_alertPanel contentView] bounds];
<a name="l00160"></a>00160 
<a name="l00161"></a>00161         _messageLabel = [[<a class="code" href="class_c_p_text_field.html">CPTextField</a> alloc] initWithFrame:CGRectMake(57.0, 10.0, CGRectGetWidth(bounds) - 73.0, 62.0)];
<a name="l00162"></a>00162         [_messageLabel setFont:[<a class="code" href="class_c_p_font.html">CPFont</a> <a class="code" href="class_c_p_font.html#ad01b27fa98100994a257ecc5f2c51a47">boldSystemFontOfSize</a>:13.0]];
<a name="l00163"></a>00163         [_messageLabel setLineBreakMode:CPLineBreakByWordWrapping];
<a name="l00164"></a>00164         [_messageLabel setAlignment:CPJustifiedTextAlignment];
<a name="l00165"></a>00165         [_messageLabel setAutoresizingMask:CPViewWidthSizable|CPViewHeightSizable];
<a name="l00166"></a>00166 
<a name="l00167"></a>00167         _alertImageView = [[<a class="code" href="class_c_p_image_view.html">CPImageView</a> alloc] initWithFrame:CGRectMake(15.0, 12.0, 32.0, 32.0)];
<a name="l00168"></a>00168     }
<a name="l00169"></a>00169 
<a name="l00170"></a>00170     [[_alertPanel contentView] addSubview:_messageLabel];
<a name="l00171"></a>00171     [[_alertPanel contentView] addSubview:_alertImageView];
<a name="l00172"></a>00172 }
<a name="l00173"></a>00173 
<a name="l00178"></a><a class="code" href="class_c_p_alert.html#af605b4c2575069abb27eee652c98f13b">00178</a> - (void)setTitle:(<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)aTitle
<a name="l00179"></a>00179 {
<a name="l00180"></a>00180     _windowTitle = aTitle;
<a name="l00181"></a>00181 }
<a name="l00182"></a>00182 
<a name="l00186"></a><a class="code" href="class_c_p_alert.html#afc10202a64f2f89a3063980aa9232f59">00186</a> - (<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)title
<a name="l00187"></a>00187 {
<a name="l00188"></a>00188     <span class="keywordflow">return</span> _windowTitle;
<a name="l00189"></a>00189 }
<a name="l00190"></a>00190 
<a name="l00194"></a><a class="code" href="class_c_p_alert.html#a057d961fbfba36d5dcb15c347b164668">00194</a> - (int)windowStyle
<a name="l00195"></a>00195 {
<a name="l00196"></a>00196     <span class="keywordflow">return</span> _windowStyle;
<a name="l00197"></a>00197 }
<a name="l00198"></a>00198 
<a name="l00203"></a><a class="code" href="class_c_p_alert.html#aba078fe16d4bd904da13a0e0a896c3fc">00203</a> - (void)setDelegate:(<span class="keywordtype">id</span>)delegate
<a name="l00204"></a>00204 {
<a name="l00205"></a>00205     _delegate = delegate;
<a name="l00206"></a>00206 }
<a name="l00207"></a>00207 
<a name="l00211"></a><a class="code" href="class_c_p_alert.html#ac5b5666c0f6127b7da6f96e399240c80">00211</a> - (void)delegate
<a name="l00212"></a>00212 {
<a name="l00213"></a>00213     <span class="keywordflow">return</span> _delegate;
<a name="l00214"></a>00214 }
<a name="l00215"></a>00215 
<a name="l00220"></a><a class="code" href="class_c_p_alert.html#a419eb062673bb0bc48d6b000f8a90daf">00220</a> - (void)setAlertStyle:(CPAlertStyle)style
<a name="l00221"></a>00221 {
<a name="l00222"></a>00222     _alertStyle = style;
<a name="l00223"></a>00223 }
<a name="l00224"></a>00224 
<a name="l00228"></a><a class="code" href="class_c_p_alert.html#af3f63bae310f0585de8324616e3369b5">00228</a> - (CPAlertStyle)alertStyle
<a name="l00229"></a>00229 {
<a name="l00230"></a>00230     <span class="keywordflow">return</span> _alertStyle;
<a name="l00231"></a>00231 }
<a name="l00232"></a>00232 
<a name="l00237"></a><a class="code" href="class_c_p_alert.html#ac84c2267b30f48d98f712cc8c2974f34">00237</a> - (void)setMessageText:(<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)messageText
<a name="l00238"></a>00238 {
<a name="l00239"></a>00239     [_messageLabel setStringValue:messageText];
<a name="l00240"></a>00240 }
<a name="l00241"></a>00241 
<a name="l00245"></a><a class="code" href="class_c_p_alert.html#a09b0539c96d43c0e86ffb76446c9769e">00245</a> - (<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)messageText
<a name="l00246"></a>00246 {
<a name="l00247"></a>00247     <span class="keywordflow">return</span> [_messageLabel stringValue];
<a name="l00248"></a>00248 }
<a name="l00249"></a>00249 
<a name="l00257"></a><a class="code" href="class_c_p_alert.html#a96fe189b1b6494c8a6c5e27e6f513824">00257</a> - (void)addButtonWithTitle:(<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)title
<a name="l00258"></a>00258 {
<a name="l00259"></a>00259     var bounds = [[_alertPanel contentView] bounds],
<a name="l00260"></a>00260         button = [[<a class="code" href="class_c_p_button.html">CPButton</a> alloc] initWithFrame:CGRectMake(CGRectGetWidth(bounds) - ((_buttonCount + 1) * 90.0), CGRectGetHeight(bounds) - 34.0, 80.0, (_windowStyle == CPHUDBackgroundWindowMask) ? 20.0 : 24.0)];
<a name="l00261"></a>00261     
<a name="l00262"></a>00262     [button setTitle:title];
<a name="l00263"></a>00263     [button setTarget:self];
<a name="l00264"></a>00264     [button setTag:_buttonCount];
<a name="l00265"></a>00265     [button setAction:@selector(_notifyDelegate:)];
<a name="l00266"></a>00266     
<a name="l00267"></a>00267     [button setTheme:(_windowStyle === CPHUDBackgroundWindowMask) ? [<a class="code" href="class_c_p_theme.html">CPTheme</a> <a class="code" href="class_c_p_theme.html#a1fa892cba378f23063a7be7c1704ae38">themeNamed</a>:&quot;Aristo-HUD&quot;] : [<a class="code" href="class_c_p_theme.html">CPTheme</a> <a class="code" href="class_c_p_theme.html#a19028d2f26f8d89be574ebdbdcfa5f16">defaultTheme</a>]];
<a name="l00268"></a>00268     [button setAutoresizingMask:CPViewMinXMargin | CPViewMinYMargin];
<a name="l00269"></a>00269 
<a name="l00270"></a>00270     [[_alertPanel contentView] addSubview:button];
<a name="l00271"></a>00271     
<a name="l00272"></a>00272     <span class="keywordflow">if</span> (_buttonCount == 0)
<a name="l00273"></a>00273         [_alertPanel setDefaultButton:button];
<a name="l00274"></a>00274 
<a name="l00275"></a>00275     _buttonCount++;
<a name="l00276"></a>00276     [_buttons addObject:button];
<a name="l00277"></a>00277 }
<a name="l00278"></a>00278 
<a name="l00284"></a><a class="code" href="class_c_p_alert.html#a91c69b7cd99a7eecdfce90a3e772d764">00284</a> - (void)runModal
<a name="l00285"></a>00285 {
<a name="l00286"></a>00286     var theTitle;
<a name="l00287"></a>00287     
<a name="l00288"></a>00288     <span class="keywordflow">switch</span> (_alertStyle)
<a name="l00289"></a>00289     {
<a name="l00290"></a>00290         <span class="keywordflow">case</span> <a class="code" href="_c_p_alert_8j.html#aa27ae7f57cd7b70555f25d7e811c0ae4">CPWarningAlertStyle</a>:       [_alertImageView setImage:CPAlertWarningImage];
<a name="l00291"></a>00291                                         theTitle = <span class="stringliteral">@&quot;Warning&quot;</span>;
<a name="l00292"></a>00292                                         <span class="keywordflow">break</span>;
<a name="l00293"></a>00293         <span class="keywordflow">case</span> <a class="code" href="_c_p_alert_8j.html#a18a146df27f411508976cd4bc4cac534">CPInformationalAlertStyle</a>: [_alertImageView setImage:CPAlertInformationImage];
<a name="l00294"></a>00294                                         theTitle = <span class="stringliteral">@&quot;Information&quot;</span>;
<a name="l00295"></a>00295                                         <span class="keywordflow">break</span>;
<a name="l00296"></a>00296         <span class="keywordflow">case</span> <a class="code" href="_c_p_alert_8j.html#aab1faaf140db7366cdf0fe6ea008c975">CPCriticalAlertStyle</a>:      [_alertImageView setImage:CPAlertErrorImage];
<a name="l00297"></a>00297                                         theTitle = <span class="stringliteral">@&quot;Error&quot;</span>;
<a name="l00298"></a>00298                                         <span class="keywordflow">break</span>;
<a name="l00299"></a>00299     }
<a name="l00300"></a>00300     
<a name="l00301"></a>00301     [_alertPanel setTitle:_windowTitle ? _windowTitle : theTitle];
<a name="l00302"></a>00302     
<a name="l00303"></a>00303     [CPApp runModalForWindow:_alertPanel];
<a name="l00304"></a>00304 }
<a name="l00305"></a>00305 
<a name="l00306"></a>00306 <span class="comment">/* @ignore */</span>
<a name="l00307"></a>00307 - (void)_notifyDelegate:(<span class="keywordtype">id</span>)button
<a name="l00308"></a>00308 {
<a name="l00309"></a>00309     [CPApp abortModal];
<a name="l00310"></a>00310     [_alertPanel close];
<a name="l00311"></a>00311 
<a name="l00312"></a>00312     <span class="keywordflow">if</span> (_delegate &amp;&amp; [_delegate respondsToSelector:<span class="keyword">@selector</span>(alertDidEnd:returnCode:)])
<a name="l00313"></a>00313         [_delegate alertDidEnd:self returnCode:[button tag]];
<a name="l00314"></a>00314 }
<a name="l00315"></a>00315 
<a name="l00316"></a>00316 <span class="keyword">@end</span>
</pre></div></div>
<hr size="1"/><address style="text-align: right;"><small>Generated on Tue Apr 6 10:32:54 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/_c_p_alert_8j_source.html by HTTrack Website Copier/3.x [XR&CO'2006], Mon, 20 Sep 2010 02:19:28 GMT -->
</html>