1. Stewart Mackenzie
  2. cappuccino-docs

Source

cappuccino-docs / cappuccino docs / cappuccino.org / learn / documentation / _c_p_responder_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_responder_8j_source.html by HTTrack Website Copier/3.x [XR&CO'2006], Mon, 20 Sep 2010 02:19:31 GMT -->
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Cappuccino API: AppKit/CPResponder.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/CPResponder.j</h1><a href="_c_p_responder_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"> * CPResponder.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 Francisco Tolmasky.</span>
<a name="l00006"></a>00006 <span class="comment"> * Copyright 2008, 280 North, Inc.</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> * This library is free software; you can redistribute it and/or</span>
<a name="l00009"></a>00009 <span class="comment"> * modify it under the terms of the GNU Lesser General Public</span>
<a name="l00010"></a>00010 <span class="comment"> * License as published by the Free Software Foundation; either</span>
<a name="l00011"></a>00011 <span class="comment"> * version 2.1 of the License, or (at your option) any later version.</span>
<a name="l00012"></a>00012 <span class="comment"> *</span>
<a name="l00013"></a>00013 <span class="comment"> * This library is distributed in the hope that it will be useful,</span>
<a name="l00014"></a>00014 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00015"></a>00015 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>
<a name="l00016"></a>00016 <span class="comment"> * Lesser General Public License for more details.</span>
<a name="l00017"></a>00017 <span class="comment"> *</span>
<a name="l00018"></a>00018 <span class="comment"> * You should have received a copy of the GNU Lesser General Public</span>
<a name="l00019"></a>00019 <span class="comment"> * License along with this library; if not, write to the Free Software</span>
<a name="l00020"></a>00020 <span class="comment"> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA</span>
<a name="l00021"></a>00021 <span class="comment"> */</span>
<a name="l00022"></a>00022 
<a name="l00023"></a>00023 @<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="l00024"></a>00024 
<a name="l00025"></a>00025 
<a name="l00026"></a><a class="code" href="_c_p_responder_8j.html#a027a4694019c87da005edf5f7a9485ba">00026</a> <a class="code" href="_c_p_responder_8j.html#a027a4694019c87da005edf5f7a9485ba">CPDeleteKeyCode</a>     = 8;
<a name="l00027"></a><a class="code" href="_c_p_responder_8j.html#a850fba77f54879a5433ed17878f057cb">00027</a> <a class="code" href="_c_p_responder_8j.html#a850fba77f54879a5433ed17878f057cb">CPTabKeyCode</a>        = 9;
<a name="l00028"></a><a class="code" href="_c_p_responder_8j.html#a5809f8b1717b94d5316dd890220af494">00028</a> <a class="code" href="_c_p_responder_8j.html#a5809f8b1717b94d5316dd890220af494">CPReturnKeyCode</a>     = 13;
<a name="l00029"></a><a class="code" href="_c_p_responder_8j.html#af220d742910671ba69a0439aa7ff86b4">00029</a> <a class="code" href="_c_p_responder_8j.html#af220d742910671ba69a0439aa7ff86b4">CPEscapeKeyCode</a>     = 27;
<a name="l00030"></a><a class="code" href="_c_p_responder_8j.html#ad32167029d593949691166cf125b68fb">00030</a> <a class="code" href="_c_p_responder_8j.html#ad32167029d593949691166cf125b68fb">CPSpaceKeyCode</a>      = 32;
<a name="l00031"></a><a class="code" href="_c_p_responder_8j.html#a232513db6f2f48d292e917a0d5723d8e">00031</a> <a class="code" href="_c_p_responder_8j.html#a232513db6f2f48d292e917a0d5723d8e">CPPageUpKeyCode</a>     = 33;
<a name="l00032"></a><a class="code" href="_c_p_responder_8j.html#adbcf2c0e0eee9b268e99d6392db139ca">00032</a> <a class="code" href="_c_p_responder_8j.html#adbcf2c0e0eee9b268e99d6392db139ca">CPPageDownKeyCode</a>   = 34;
<a name="l00033"></a><a class="code" href="_c_p_responder_8j.html#a8f7d2d22c78c2effbfe2c3c177f18974">00033</a> <a class="code" href="_c_p_responder_8j.html#a8f7d2d22c78c2effbfe2c3c177f18974">CPLeftArrowKeyCode</a>  = 37;
<a name="l00034"></a><a class="code" href="_c_p_responder_8j.html#abd470334f66ee07e14b6b58ab043d445">00034</a> <a class="code" href="_c_p_responder_8j.html#abd470334f66ee07e14b6b58ab043d445">CPUpArrowKeyCode</a>    = 38;
<a name="l00035"></a><a class="code" href="_c_p_responder_8j.html#ad59366fca71b17d7490528f73f7befc3">00035</a> <a class="code" href="_c_p_responder_8j.html#ad59366fca71b17d7490528f73f7befc3">CPRightArrowKeyCode</a> = 39;
<a name="l00036"></a><a class="code" href="_c_p_responder_8j.html#a9f107c55608eecb66f1f7723eee11310">00036</a> <a class="code" href="_c_p_responder_8j.html#a9f107c55608eecb66f1f7723eee11310">CPDownArrowKeyCode</a>  = 40;
<a name="l00037"></a>00037 
<a name="l00044"></a><a class="code" href="class_c_p_responder.html">00044</a> <span class="keyword">@implementation </span><a class="code" href="class_c_p_responder.html">CPResponder</a> : <a class="code" href="class_c_p_object.html" title="The root class from which most classes are subclassed.">CPObject</a>
<a name="l00045"></a>00045 {
<a name="l00046"></a>00046     <a class="code" href="class_c_p_menu.html">CPMenu</a>      _menu;
<a name="l00047"></a>00047     <a class="code" href="class_c_p_responder.html">CPResponder</a> _nextResponder;
<a name="l00048"></a>00048 }
<a name="l00049"></a>00049 
<a name="l00050"></a>00050 <span class="comment">// Changing the first responder</span>
<a name="l00054"></a><a class="code" href="class_c_p_responder.html#a5aedc154ed18f6cf4857ef9e565ba78b">00054</a> <span class="comment"></span>- (BOOL)acceptsFirstResponder
<a name="l00055"></a>00055 {
<a name="l00056"></a>00056     <span class="keywordflow">return</span> NO;
<a name="l00057"></a>00057 }
<a name="l00058"></a>00058 
<a name="l00064"></a><a class="code" href="class_c_p_responder.html#a3361db12f56d72886836f82a782df99f">00064</a> - (BOOL)becomeFirstResponder
<a name="l00065"></a>00065 {
<a name="l00066"></a>00066     <span class="keywordflow">return</span> YES;
<a name="l00067"></a>00067 }
<a name="l00068"></a>00068 
<a name="l00073"></a><a class="code" href="class_c_p_responder.html#a84da71863fed40ca71af474996d6f5bd">00073</a> - (BOOL)resignFirstResponder
<a name="l00074"></a>00074 {
<a name="l00075"></a>00075     <span class="keywordflow">return</span> YES;
<a name="l00076"></a>00076 }
<a name="l00077"></a>00077 
<a name="l00078"></a>00078 <span class="comment">// Setting the next responder</span>
<a name="l00083"></a><a class="code" href="class_c_p_responder.html#a39e121624766cd4414b4108c05751220">00083</a> <span class="comment"></span>- (void)setNextResponder:(<a class="code" href="class_c_p_responder.html">CPResponder</a>)aResponder
<a name="l00084"></a>00084 {
<a name="l00085"></a>00085     _nextResponder = aResponder;
<a name="l00086"></a>00086 }
<a name="l00087"></a>00087 
<a name="l00091"></a><a class="code" href="class_c_p_responder.html#a8afb9c99971aea338a3c323c23c4ee2c">00091</a> - (<a class="code" href="class_c_p_responder.html">CPResponder</a>)nextResponder
<a name="l00092"></a>00092 {
<a name="l00093"></a>00093     <span class="keywordflow">return</span> _nextResponder;
<a name="l00094"></a>00094 }
<a name="l00095"></a>00095 
<a name="l00100"></a><a class="code" href="class_c_p_responder.html#ad479285e84ce3f42c1c5325e31b3de75">00100</a> - (void)interpretKeyEvents:(<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>)events
<a name="l00101"></a>00101 {
<a name="l00102"></a>00102     var index = 0,
<a name="l00103"></a>00103         count = [events <a class="code" href="class_c_p_array.html#ae8abed7c67002d9a883005aa40e4fb55">count</a>];
<a name="l00104"></a>00104 
<a name="l00105"></a>00105     <span class="keywordflow">for</span> (; index &lt; count; ++index)
<a name="l00106"></a>00106     {
<a name="l00107"></a>00107         var <span class="keyword">event</span> = events[index];
<a name="l00108"></a>00108 
<a name="l00109"></a>00109         <span class="keywordflow">switch</span>([event keyCode])
<a name="l00110"></a>00110         {
<a name="l00111"></a>00111             <span class="keywordflow">case</span> <a class="code" href="_c_p_responder_8j.html#a232513db6f2f48d292e917a0d5723d8e">CPPageUpKeyCode</a>:       [<span class="keyword">self</span> <a class="code" href="class_c_p_responder.html#aa7486f25921d4f7d452dde0cf144733f">doCommandBySelector</a>:@selector(<a class="code" href="class_c_p_responder.html#aa7486f25921d4f7d452dde0cf144733f">pageUp</a>:)];
<a name="l00112"></a>00112                                         <span class="keywordflow">break</span>;
<a name="l00113"></a>00113             <span class="keywordflow">case</span> <a class="code" href="_c_p_responder_8j.html#adbcf2c0e0eee9b268e99d6392db139ca">CPPageDownKeyCode</a>:     [<span class="keyword">self</span> <a class="code" href="class_c_p_responder.html#aa7486f25921d4f7d452dde0cf144733f">doCommandBySelector</a>:@selector(<a class="code" href="class_c_p_responder.html#aa7486f25921d4f7d452dde0cf144733f">pageDown</a>:)];
<a name="l00114"></a>00114                                         <span class="keywordflow">break</span>;
<a name="l00115"></a>00115             <span class="keywordflow">case</span> <a class="code" href="_c_p_responder_8j.html#a8f7d2d22c78c2effbfe2c3c177f18974">CPLeftArrowKeyCode</a>:    [<span class="keyword">self</span> <a class="code" href="class_c_p_responder.html#aa7486f25921d4f7d452dde0cf144733f">doCommandBySelector</a>:@selector(<a class="code" href="class_c_p_responder.html#aa7486f25921d4f7d452dde0cf144733f">moveLeft</a>:)];
<a name="l00116"></a>00116                                         <span class="keywordflow">break</span>;
<a name="l00117"></a>00117             <span class="keywordflow">case</span> <a class="code" href="_c_p_responder_8j.html#ad59366fca71b17d7490528f73f7befc3">CPRightArrowKeyCode</a>:   [<span class="keyword">self</span> <a class="code" href="class_c_p_responder.html#aa7486f25921d4f7d452dde0cf144733f">doCommandBySelector</a>:@selector(<a class="code" href="class_c_p_responder.html#aa7486f25921d4f7d452dde0cf144733f">moveRight</a>:)];
<a name="l00118"></a>00118                                         <span class="keywordflow">break</span>;
<a name="l00119"></a>00119             <span class="keywordflow">case</span> <a class="code" href="_c_p_responder_8j.html#abd470334f66ee07e14b6b58ab043d445">CPUpArrowKeyCode</a>:      [<span class="keyword">self</span> <a class="code" href="class_c_p_responder.html#aa7486f25921d4f7d452dde0cf144733f">doCommandBySelector</a>:@selector(<a class="code" href="class_c_p_responder.html#aa7486f25921d4f7d452dde0cf144733f">moveUp</a>:)];
<a name="l00120"></a>00120                                         <span class="keywordflow">break</span>;
<a name="l00121"></a>00121             <span class="keywordflow">case</span> <a class="code" href="_c_p_responder_8j.html#a9f107c55608eecb66f1f7723eee11310">CPDownArrowKeyCode</a>:    [<span class="keyword">self</span> <a class="code" href="class_c_p_responder.html#aa7486f25921d4f7d452dde0cf144733f">doCommandBySelector</a>:@selector(<a class="code" href="class_c_p_responder.html#aa7486f25921d4f7d452dde0cf144733f">moveDown</a>:)];
<a name="l00122"></a>00122                                         <span class="keywordflow">break</span>;
<a name="l00123"></a>00123             <span class="keywordflow">case</span> <a class="code" href="_c_p_responder_8j.html#a027a4694019c87da005edf5f7a9485ba">CPDeleteKeyCode</a>:       [<span class="keyword">self</span> <a class="code" href="class_c_p_responder.html#aa7486f25921d4f7d452dde0cf144733f">doCommandBySelector</a>:@selector(<a class="code" href="class_c_p_responder.html#aa7486f25921d4f7d452dde0cf144733f">deleteBackward</a>:)];
<a name="l00124"></a>00124                                         <span class="keywordflow">break</span>;
<a name="l00125"></a>00125             <span class="keywordflow">case</span> <a class="code" href="_c_p_responder_8j.html#a5809f8b1717b94d5316dd890220af494">CPReturnKeyCode</a>:
<a name="l00126"></a>00126             <span class="keywordflow">case</span> 3:                     [<span class="keyword">self</span> <a class="code" href="class_c_p_responder.html#aa7486f25921d4f7d452dde0cf144733f">doCommandBySelector</a>:@selector(<a class="code" href="class_c_p_responder.html#aa7486f25921d4f7d452dde0cf144733f">insertLineBreak</a>:)];
<a name="l00127"></a>00127                                         <span class="keywordflow">break</span>;
<a name="l00128"></a>00128             
<a name="l00129"></a>00129             <span class="keywordflow">case</span> <a class="code" href="_c_p_responder_8j.html#af220d742910671ba69a0439aa7ff86b4">CPEscapeKeyCode</a>:       [<span class="keyword">self</span> <a class="code" href="class_c_p_responder.html#aa7486f25921d4f7d452dde0cf144733f">doCommandBySelector</a>:@selector(<a class="code" href="class_c_p_responder.html#aa7486f25921d4f7d452dde0cf144733f">cancel</a>:)];
<a name="l00130"></a>00130                                         <span class="keywordflow">break</span>;
<a name="l00131"></a>00131 
<a name="l00132"></a>00132             <span class="keywordflow">case</span> <a class="code" href="_c_p_responder_8j.html#a850fba77f54879a5433ed17878f057cb">CPTabKeyCode</a>:          var shift = [event modifierFlags] &amp; <a class="code" href="_c_p_event_8j.html#a2343191b34b38dc1952bb44d83fa30d6">CPShiftKeyMask</a>;
<a name="l00133"></a>00133 
<a name="l00134"></a>00134                                         <span class="keywordflow">if</span> (!shift)
<a name="l00135"></a>00135                                             [<span class="keyword">self</span> <a class="code" href="class_c_p_responder.html#aa7486f25921d4f7d452dde0cf144733f">doCommandBySelector</a>:@selector(<a class="code" href="class_c_p_responder.html#aa7486f25921d4f7d452dde0cf144733f">insertTab</a>:)];
<a name="l00136"></a>00136                                         <span class="keywordflow">else</span>
<a name="l00137"></a>00137                                             [<span class="keyword">self</span> <a class="code" href="class_c_p_responder.html#aa7486f25921d4f7d452dde0cf144733f">doCommandBySelector</a>:@selector(<a class="code" href="class_c_p_responder.html#aa7486f25921d4f7d452dde0cf144733f">insertBackTab</a>:)];
<a name="l00138"></a>00138 
<a name="l00139"></a>00139                                         <span class="keywordflow">break</span>;
<a name="l00140"></a>00140 
<a name="l00141"></a>00141             <span class="keywordflow">default</span>:                    [<span class="keyword">self</span> <a class="code" href="class_c_p_responder.html#afa22e8c4ef17d5e70f38f28c65681655">insertText</a>:[event characters]];
<a name="l00142"></a>00142         }
<a name="l00143"></a>00143     }
<a name="l00144"></a>00144 }
<a name="l00145"></a>00145 
<a name="l00150"></a><a class="code" href="class_c_p_responder.html#adb06a5523fe07434c06a04336c567080">00150</a> - (void)mouseDown:(<a class="code" href="class_c_p_event.html">CPEvent</a>)anEvent
<a name="l00151"></a>00151 {
<a name="l00152"></a>00152     [_nextResponder performSelector:_cmd withObject:anEvent];
<a name="l00153"></a>00153 }
<a name="l00154"></a>00154 
<a name="l00160"></a><a class="code" href="class_c_p_responder.html#a516100e7025af4236e982e84e48f9466">00160</a> - (void)mouseDragged:(<a class="code" href="class_c_p_event.html">CPEvent</a>)anEvent
<a name="l00161"></a>00161 {
<a name="l00162"></a>00162     [_nextResponder performSelector:_cmd withObject:anEvent];
<a name="l00163"></a>00163 }
<a name="l00164"></a>00164 
<a name="l00169"></a><a class="code" href="class_c_p_responder.html#a4b873b1891f2d1e21e98f5bdd9ce2327">00169</a> - (void)mouseUp:(<a class="code" href="class_c_p_event.html">CPEvent</a>)anEvent
<a name="l00170"></a>00170 {
<a name="l00171"></a>00171     [_nextResponder performSelector:_cmd withObject:anEvent];
<a name="l00172"></a>00172 }
<a name="l00173"></a>00173 
<a name="l00178"></a><a class="code" href="class_c_p_responder.html#a5271d8beedd5d2d51757b69335222a8e">00178</a> - (void)mouseMoved:(<a class="code" href="class_c_p_event.html">CPEvent</a>)anEvent
<a name="l00179"></a>00179 {
<a name="l00180"></a>00180     [_nextResponder performSelector:_cmd withObject:anEvent];
<a name="l00181"></a>00181 }
<a name="l00182"></a>00182 
<a name="l00183"></a><a class="code" href="class_c_p_responder.html#ab7942157c9b478598d699ce22c071fe6">00183</a> - (void)mouseEntered:(<a class="code" href="class_c_p_event.html">CPEvent</a>)anEvent
<a name="l00184"></a>00184 {
<a name="l00185"></a>00185     [_nextResponder performSelector:_cmd withObject:anEvent];
<a name="l00186"></a>00186 }
<a name="l00187"></a>00187 
<a name="l00192"></a><a class="code" href="class_c_p_responder.html#a05e369740c3f45546557b0b54795deec">00192</a> - (void)mouseExited:(<a class="code" href="class_c_p_event.html">CPEvent</a>)anEvent
<a name="l00193"></a>00193 {
<a name="l00194"></a>00194     [_nextResponder performSelector:_cmd withObject:anEvent];
<a name="l00195"></a>00195 }
<a name="l00196"></a>00196 
<a name="l00201"></a><a class="code" href="class_c_p_responder.html#a0a6e754165cddf5e936f61724dcd4e5a">00201</a> - (void)scrollWheel:(<a class="code" href="class_c_p_event.html">CPEvent</a>)anEvent
<a name="l00202"></a>00202 {
<a name="l00203"></a>00203     [_nextResponder performSelector:_cmd withObject:anEvent];
<a name="l00204"></a>00204 }
<a name="l00205"></a>00205 
<a name="l00210"></a><a class="code" href="class_c_p_responder.html#ab79a1f20ad2061e44fcf08ced0e2d391">00210</a> - (void)keyDown:(<a class="code" href="class_c_p_event.html">CPEvent</a>)anEvent
<a name="l00211"></a>00211 {
<a name="l00212"></a>00212     [_nextResponder performSelector:_cmd withObject:anEvent];
<a name="l00213"></a>00213 }
<a name="l00214"></a>00214 
<a name="l00219"></a><a class="code" href="class_c_p_responder.html#a6dfd1be3af74ea2b732205d06982ebfe">00219</a> - (void)keyUp:(<a class="code" href="class_c_p_event.html">CPEvent</a>)anEvent
<a name="l00220"></a>00220 {
<a name="l00221"></a>00221     [_nextResponder performSelector:_cmd withObject:anEvent];
<a name="l00222"></a>00222 }
<a name="l00223"></a>00223 
<a name="l00224"></a>00224 <span class="comment">/*</span>
<a name="l00225"></a>00225 <span class="comment">    FIXME This description is bad.</span>
<a name="l00226"></a>00226 <span class="comment">    Based on \c anEvent, the receiver should simulate the event.</span>
<a name="l00227"></a>00227 <span class="comment">    @param anEvent the event to simulate</span>
<a name="l00228"></a>00228 <span class="comment">    @return \c YES if the event receiver simulated the  event</span>
<a name="l00229"></a>00229 <span class="comment">*/</span>
<a name="l00230"></a><a class="code" href="class_c_p_responder.html#a58b9894fe838130c77e06636a82efdce">00230</a> - (BOOL)performKeyEquivalent:(<a class="code" href="class_c_p_event.html">CPEvent</a>)anEvent
<a name="l00231"></a>00231 {
<a name="l00232"></a>00232     <span class="keywordflow">return</span> NO;
<a name="l00233"></a>00233 }
<a name="l00234"></a>00234 
<a name="l00235"></a>00235 <span class="comment">// Action Methods</span>
<a name="l00240"></a><a class="code" href="class_c_p_responder.html#a7daa35d952f2f6eea2f3a1d19659d5f0">00240</a> <span class="comment"></span>- (void)insertLineBreak:(<span class="keywordtype">id</span>)aSender
<a name="l00241"></a>00241 {
<a name="l00242"></a>00242     [<span class="keyword">self</span> <a class="code" href="class_c_p_responder.html#a2aa3f1fa505868325ea71b46a09e1b22">insertNewline</a>:aSender];
<a name="l00243"></a>00243 }
<a name="l00244"></a>00244 
<a name="l00249"></a><a class="code" href="class_c_p_responder.html#a2aa3f1fa505868325ea71b46a09e1b22">00249</a> - (void)insertNewline:(<span class="keywordtype">id</span>)aSender
<a name="l00250"></a>00250 {
<a name="l00251"></a>00251     [[<span class="keyword">self</span> <a class="code" href="class_c_p_responder.html#a8afb9c99971aea338a3c323c23c4ee2c">nextResponder</a>] <a class="code" href="class_c_p_responder.html#a2aa3f1fa505868325ea71b46a09e1b22">insertNewline</a>:aSender];
<a name="l00252"></a>00252 }
<a name="l00253"></a>00253 
<a name="l00254"></a><a class="code" href="class_c_p_responder.html#a10625d423a99d0630257e6ef00e933e3">00254</a> - (void)cancel:(<span class="keywordtype">id</span>)sender
<a name="l00255"></a>00255 {
<a name="l00256"></a>00256 }
<a name="l00257"></a>00257 
<a name="l00258"></a><a class="code" href="class_c_p_responder.html#a678b5c62f9657b064432b0787ccfc977">00258</a> - (void)insertTab:(<span class="keywordtype">id</span>)sender
<a name="l00259"></a>00259 {
<a name="l00260"></a>00260 }
<a name="l00261"></a>00261 
<a name="l00262"></a><a class="code" href="class_c_p_responder.html#a7a0754550fb02252977fea68e30d2ef5">00262</a> - (void)insertBackTab:(<span class="keywordtype">id</span>)sender
<a name="l00263"></a>00263 {
<a name="l00264"></a>00264 }
<a name="l00265"></a>00265 
<a name="l00270"></a><a class="code" href="class_c_p_responder.html#afa22e8c4ef17d5e70f38f28c65681655">00270</a> - (void)insertText:(<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)aString
<a name="l00271"></a>00271 {
<a name="l00272"></a>00272 }
<a name="l00273"></a>00273 
<a name="l00274"></a>00274 <span class="comment">// Dispatch methods</span>
<a name="l00280"></a><a class="code" href="class_c_p_responder.html#aa7486f25921d4f7d452dde0cf144733f">00280</a> <span class="comment"></span>- (void)doCommandBySelector:(<span class="keywordtype">SEL</span>)aSelector
<a name="l00281"></a>00281 {
<a name="l00282"></a>00282     <span class="keywordflow">if</span> ([<span class="keyword">self</span> respondsToSelector:aSelector])
<a name="l00283"></a>00283         [<span class="keyword">self</span> performSelector:aSelector];
<a name="l00284"></a>00284     <span class="keywordflow">else</span>
<a name="l00285"></a>00285         [_nextResponder doCommandBySelector:aSelector];
<a name="l00286"></a>00286 }
<a name="l00287"></a>00287 
<a name="l00295"></a><a class="code" href="class_c_p_responder.html#a5924b93490d16d065ff00c23b9db156e">00295</a> - (BOOL)tryToPerform:(<span class="keywordtype">SEL</span>)aSelector with:(<span class="keywordtype">id</span>)anObject
<a name="l00296"></a>00296 {
<a name="l00297"></a>00297     <span class="keywordflow">if</span>([<span class="keyword">self</span> respondsToSelector:aSelector])
<a name="l00298"></a>00298     {
<a name="l00299"></a>00299         [<span class="keyword">self</span> performSelector:aSelector withObject:anObject];
<a name="l00300"></a>00300         
<a name="l00301"></a>00301         <span class="keywordflow">return</span> YES;
<a name="l00302"></a>00302     }
<a name="l00303"></a>00303 
<a name="l00304"></a>00304     <span class="keywordflow">return</span> [_nextResponder tryToPerform:aSelector with:anObject];
<a name="l00305"></a>00305 }
<a name="l00306"></a>00306 
<a name="l00307"></a>00307 <span class="comment">// Managing a Responder&apos;s menu</span>
<a name="l00308"></a>00308 
<a name="l00309"></a><a class="code" href="class_c_p_responder.html#ad5e2efcaaf475c412b862d6e6f5a1530">00309</a> - (void)setMenu:(<a class="code" href="class_c_p_menu.html">CPMenu</a>)aMenu
<a name="l00310"></a>00310 {
<a name="l00311"></a>00311     _menu = aMenu;
<a name="l00312"></a>00312 }
<a name="l00313"></a>00313 
<a name="l00314"></a><a class="code" href="class_c_p_responder.html#a50017b84c82bccc0cd7e3db10be63bc6">00314</a> - (<a class="code" href="class_c_p_menu.html">CPMenu</a>)<a class="code" href="_c_p_segmented_control_8j.html#a013c594489b43812712541b68420b137">menu</a>
<a name="l00315"></a>00315 {
<a name="l00316"></a>00316     <span class="keywordflow">return</span> _menu;
<a name="l00317"></a>00317 }
<a name="l00318"></a>00318 
<a name="l00319"></a>00319 <span class="comment">// Getting the Undo Manager</span>
<a name="l00323"></a><a class="code" href="class_c_p_responder.html#a6e9237e011ed568d4d2d3d1463b5a97d">00323</a> <span class="comment"></span>- (<a class="code" href="class_c_p_undo_manager.html" title="A general mechanism for user action &amp;quot;undo&amp;quot;.">CPUndoManager</a>)undoManager
<a name="l00324"></a>00324 {
<a name="l00325"></a>00325     <span class="keywordflow">return</span> [_nextResponder performSelector:_cmd];
<a name="l00326"></a>00326 }
<a name="l00327"></a>00327 
<a name="l00328"></a>00328 <span class="comment">// Terminating the responder chain</span>
<a name="l00333"></a><a class="code" href="class_c_p_responder.html#a31b05ae4d3628660127e6892055359ba">00333</a> <span class="comment"></span>- (void)noResponderFor:(<span class="keywordtype">SEL</span>)anEventSelector
<a name="l00334"></a>00334 {
<a name="l00335"></a>00335 }
<a name="l00336"></a>00336 
<a name="l00337"></a>00337 <span class="keyword">@end</span>
<a name="l00338"></a>00338 
<a name="l00339"></a><a class="code" href="_c_p_responder_8j.html#a80037c3641a856b6ec4eecc4d470095a">00339</a> var <a class="code" href="_c_p_responder_8j.html#a80037c3641a856b6ec4eecc4d470095a">CPResponderNextResponderKey</a> = <span class="stringliteral">@&quot;CPResponderNextResponderKey&quot;</span>;
<a name="l00340"></a>00340 
<a name="l00341"></a>00341 <span class="keyword">@implementation </span><a class="code" href="class_c_p_responder.html">CPResponder</a> (CPCoding)
<a name="l00342"></a>00342 
<a name="l00348"></a><a class="code" href="class_c_p_responder.html#a4d5b889de127647bd815edeb6ae1fc18">00348</a> - (id)initWithCoder:(<a class="code" href="class_c_p_coder.html" title="Defines methods for use when archiving &amp;amp; restoring (enc/decoding).">CPCoder</a>)aCoder
<a name="l00349"></a>00349 {
<a name="l00350"></a>00350     <span class="keyword">self</span> = [<span class="keyword">super</span> init];
<a name="l00351"></a>00351     
<a name="l00352"></a>00352     <span class="keywordflow">if</span> (<span class="keyword">self</span>)
<a name="l00353"></a>00353         _nextResponder = [aCoder decodeObjectForKey:CPResponderNextResponderKey];
<a name="l00354"></a>00354     
<a name="l00355"></a>00355     <span class="keywordflow">return</span> <span class="keyword">self</span>;
<a name="l00356"></a>00356 }
<a name="l00357"></a>00357 
<a name="l00362"></a><a class="code" href="class_c_p_responder.html#a55e8a3ab998f26ab89b0aa8bc6320854">00362</a> - (void)encodeWithCoder:(<a class="code" href="class_c_p_coder.html" title="Defines methods for use when archiving &amp;amp; restoring (enc/decoding).">CPCoder</a>)aCoder
<a name="l00363"></a>00363 {
<a name="l00364"></a>00364     <span class="comment">// This will come out nil on the other side with decodeObjectForKey:</span>
<a name="l00365"></a>00365     <span class="keywordflow">if</span> (_nextResponder !== nil)
<a name="l00366"></a>00366         [aCoder encodeConditionalObject:_nextResponder forKey:CPResponderNextResponderKey];
<a name="l00367"></a>00367 }
<a name="l00368"></a>00368 
<a name="l00369"></a>00369 <span class="keyword">@end</span>
</pre></div></div>
<hr size="1"/><address style="text-align: right;"><small>Generated on Tue Apr 6 10:32:55 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_responder_8j_source.html by HTTrack Website Copier/3.x [XR&CO'2006], Mon, 20 Sep 2010 02:19:31 GMT -->
</html>