Source

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

Full commit
  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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
<!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_menu_item_8j_source.html by HTTrack Website Copier/3.x [XR&CO'2006], Mon, 20 Sep 2010 02:19:30 GMT -->
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Cappuccino API: AppKit/CPMenuItem/CPMenuItem.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/CPMenuItem/CPMenuItem.j</h1><a href="_c_p_menu_item_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"> * CPMenuItem.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_coder.html" title="Defines methods for use when archiving &amp;amp; restoring (enc/decoding).">CPCoder</a>.j&gt;
<a name="l00024"></a>00024 @<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="l00025"></a>00025 @<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="l00026"></a>00026 
<a name="l00027"></a>00027 @<span class="keyword">import</span> <span class="stringliteral">&quot;CPImage.j&quot;</span>
<a name="l00028"></a>00028 @<span class="keyword">import</span> <span class="stringliteral">&quot;CPMenu.j&quot;</span>
<a name="l00029"></a>00029 @<span class="keyword">import</span> <span class="stringliteral">&quot;CPView.j&quot;</span>
<a name="l00030"></a>00030 @<span class="keyword">import</span> <span class="stringliteral">&quot;_CPMenuItemView.j&quot;</span>
<a name="l00031"></a>00031 
<a name="l00040"></a><a class="code" href="class_c_p_menu_item.html">00040</a> <span class="keyword">@implementation </span><a class="code" href="class_c_p_menu_item.html">CPMenuItem</a> : <a class="code" href="class_c_p_object.html" title="The root class from which most classes are subclassed.">CPObject</a>
<a name="l00041"></a>00041 {
<a name="l00042"></a>00042     BOOL            _isSeparator;
<a name="l00043"></a>00043 
<a name="l00044"></a>00044     <a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>        _title;
<a name="l00045"></a>00045     <span class="comment">//CPAttributedString  _attributedTitle;</span>
<a name="l00046"></a>00046     
<a name="l00047"></a>00047     <a class="code" href="class_c_p_font.html">CPFont</a>          _font;
<a name="l00048"></a>00048                   
<a name="l00049"></a>00049     <span class="keywordtype">id</span>              _target;
<a name="l00050"></a>00050     <span class="keywordtype">SEL</span>             _action;
<a name="l00051"></a>00051                     
<a name="l00052"></a>00052     BOOL            _isEnabled;
<a name="l00053"></a>00053     BOOL            _isHidden;
<a name="l00054"></a>00054                     
<a name="l00055"></a>00055     <span class="keywordtype">int</span>             _tag;
<a name="l00056"></a>00056     <span class="keywordtype">int</span>             _state;
<a name="l00057"></a>00057                     
<a name="l00058"></a>00058     <a class="code" href="class_c_p_image.html">CPImage</a>         _image;
<a name="l00059"></a>00059     <a class="code" href="class_c_p_image.html">CPImage</a>         _alternateImage;
<a name="l00060"></a>00060     <a class="code" href="class_c_p_image.html">CPImage</a>         _onStateImage;
<a name="l00061"></a>00061     <a class="code" href="class_c_p_image.html">CPImage</a>         _offStateImage;
<a name="l00062"></a>00062     <a class="code" href="class_c_p_image.html">CPImage</a>         _mixedStateImage;
<a name="l00063"></a>00063                     
<a name="l00064"></a>00064     <a class="code" href="class_c_p_menu.html">CPMenu</a>          _submenu;
<a name="l00065"></a>00065     <a class="code" href="class_c_p_menu.html">CPMenu</a>          _menu;
<a name="l00066"></a>00066                     
<a name="l00067"></a>00067     <a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>        _keyEquivalent;
<a name="l00068"></a>00068     <span class="keywordtype">unsigned</span>        _keyEquivalentModifierMask;
<a name="l00069"></a>00069                     
<a name="l00070"></a>00070     <span class="keywordtype">int</span>             _mnemonicLocation;
<a name="l00071"></a>00071                     
<a name="l00072"></a>00072     BOOL            _isAlternate;
<a name="l00073"></a>00073     <span class="keywordtype">int</span>             _indentationLevel;
<a name="l00074"></a>00074                     
<a name="l00075"></a>00075     <a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>        _toolTip;
<a name="l00076"></a>00076     <span class="keywordtype">id</span>              _representedObject;
<a name="l00077"></a>00077     <a class="code" href="class_c_p_view.html">CPView</a>          _view;
<a name="l00078"></a>00078     
<a name="l00079"></a>00079     _CPMenuItemView _menuItemView;
<a name="l00080"></a>00080 }
<a name="l00081"></a>00081 
<a name="l00082"></a><a class="code" href="class_c_p_menu_item.html#a52ebcad96d7757af79bc60d433705e66">00082</a> - (id)init
<a name="l00083"></a>00083 {
<a name="l00084"></a>00084     <span class="keywordflow">return</span> [<span class="keyword">self</span> <a class="code" href="class_c_p_menu_item.html#a758d300e466e19c73646ffdff4e11750">initWithTitle</a>:@&quot;&quot; <a class="code" href="class_c_p_menu_item.html#a758d300e466e19c73646ffdff4e11750">action</a>:nil <a class="code" href="class_c_p_menu_item.html#a758d300e466e19c73646ffdff4e11750">keyEquivalent</a>:nil];
<a name="l00085"></a>00085 }
<a name="l00086"></a>00086 
<a name="l00094"></a><a class="code" href="class_c_p_menu_item.html#a758d300e466e19c73646ffdff4e11750">00094</a> - (id)initWithTitle:(<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)aTitle action:(<span class="keywordtype">SEL</span>)anAction keyEquivalent:(<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)aKeyEquivalent
<a name="l00095"></a>00095 {
<a name="l00096"></a>00096     <span class="keyword">self</span> = [<span class="keyword">super</span> init];
<a name="l00097"></a>00097     
<a name="l00098"></a>00098     <span class="keywordflow">if</span> (<span class="keyword">self</span>)
<a name="l00099"></a>00099     {
<a name="l00100"></a>00100         _isSeparator = NO;
<a name="l00101"></a>00101 
<a name="l00102"></a>00102         _title = aTitle;
<a name="l00103"></a>00103         _action = anAction;
<a name="l00104"></a>00104         
<a name="l00105"></a>00105         _isEnabled = YES;
<a name="l00106"></a>00106         
<a name="l00107"></a>00107         _tag = 0;
<a name="l00108"></a>00108         _state = <a class="code" href="_c_p_control_8j.html#a20b0a4f18db100ff9f1f0092b0964f11">CPOffState</a>;
<a name="l00109"></a>00109         
<a name="l00110"></a>00110         _keyEquivalent = aKeyEquivalent || <span class="stringliteral">@&quot;&quot;</span>;
<a name="l00111"></a>00111         _keyEquivalentModifierMask = CPPlatformActionKeyMask;
<a name="l00112"></a>00112 
<a name="l00113"></a>00113         _indentationLevel = 0;
<a name="l00114"></a>00114 
<a name="l00115"></a>00115         _mnemonicLocation = <a class="code" href="_c_p_obj_j_runtime_8j.html#a84e3be579b365cc2c1559e1a1f469238">CPNotFound</a>;
<a name="l00116"></a>00116     }
<a name="l00117"></a>00117     
<a name="l00118"></a>00118     <span class="keywordflow">return</span> <span class="keyword">self</span>;
<a name="l00119"></a>00119 }
<a name="l00120"></a>00120 
<a name="l00121"></a>00121 <span class="comment">// Enabling a Menu Item</span>
<a name="l00126"></a><a class="code" href="class_c_p_menu_item.html#a740c21c22c1345be4c63dbed177502a8">00126</a> <span class="comment"></span>- (void)setEnabled:(BOOL)isEnabled
<a name="l00127"></a>00127 {
<a name="l00128"></a>00128     <span class="keywordflow">if</span> ([_menu autoenablesItems])
<a name="l00129"></a>00129         <span class="keywordflow">return</span>;
<a name="l00130"></a>00130 
<a name="l00131"></a>00131     _isEnabled = isEnabled;
<a name="l00132"></a>00132 
<a name="l00133"></a>00133     [_menuItemView setDirty];
<a name="l00134"></a>00134 
<a name="l00135"></a>00135     [_menu itemChanged:self];
<a name="l00136"></a>00136 }
<a name="l00137"></a>00137 
<a name="l00141"></a><a class="code" href="class_c_p_menu_item.html#a47c3dadad9767b5e2519222ae2fbcb09">00141</a> - (BOOL)isEnabled
<a name="l00142"></a>00142 {
<a name="l00143"></a>00143     <span class="keywordflow">return</span> _isEnabled;
<a name="l00144"></a>00144 }
<a name="l00145"></a>00145 
<a name="l00146"></a>00146 <span class="comment">// Managing Hidden Status</span>
<a name="l00151"></a><a class="code" href="class_c_p_menu_item.html#a9222e59fd283236b5cc5f421de4a69c7">00151</a> <span class="comment"></span>- (void)setHidden:(BOOL)isHidden
<a name="l00152"></a>00152 {
<a name="l00153"></a>00153     <span class="keywordflow">if</span> (_isHidden == isHidden)
<a name="l00154"></a>00154         <span class="keywordflow">return</span>;
<a name="l00155"></a>00155     
<a name="l00156"></a>00156     _isHidden = isHidden;
<a name="l00157"></a>00157 
<a name="l00158"></a>00158     [_menu itemChanged:self];
<a name="l00159"></a>00159 }
<a name="l00160"></a>00160 
<a name="l00164"></a><a class="code" href="class_c_p_menu_item.html#a9a6e2ec3808fce4e99c17983fb36a877">00164</a> - (BOOL)isHidden
<a name="l00165"></a>00165 {
<a name="l00166"></a>00166     <span class="keywordflow">return</span> _isHidden;
<a name="l00167"></a>00167 }
<a name="l00168"></a>00168 
<a name="l00172"></a><a class="code" href="class_c_p_menu_item.html#afa692b72c9aca957e34e5e1a1fb7fe0d">00172</a> - (BOOL)isHiddenOrHasHiddenAncestor
<a name="l00173"></a>00173 {
<a name="l00174"></a>00174     <span class="keywordflow">if</span> (_isHidden)
<a name="l00175"></a>00175         <span class="keywordflow">return</span> YES;
<a name="l00176"></a>00176     
<a name="l00177"></a>00177     var supermenu = [_menu supermenu];
<a name="l00178"></a>00178     
<a name="l00179"></a>00179     <span class="keywordflow">if</span> ([[supermenu itemAtIndex:[supermenu indexOfItemWithSubmenu:_menu]] isHiddenOrHasHiddenAncestor])
<a name="l00180"></a>00180         <span class="keywordflow">return</span> YES;
<a name="l00181"></a>00181 
<a name="l00182"></a>00182     <span class="keywordflow">return</span> NO;
<a name="l00183"></a>00183 }
<a name="l00184"></a>00184 
<a name="l00185"></a>00185 <span class="comment">// Managing Target and Action</span>
<a name="l00190"></a><a class="code" href="class_c_p_menu_item.html#a426daddb3e4c5ed027fbbc5ce3d5453f">00190</a> <span class="comment"></span>- (void)setTarget:(<span class="keywordtype">id</span>)aTarget
<a name="l00191"></a>00191 {
<a name="l00192"></a>00192     _target = aTarget;
<a name="l00193"></a>00193 }
<a name="l00194"></a>00194 
<a name="l00198"></a><a class="code" href="class_c_p_menu_item.html#aff86942dd260bef93b76e006d29689b6">00198</a> - (id)target
<a name="l00199"></a>00199 {
<a name="l00200"></a>00200     <span class="keywordflow">return</span> _target;
<a name="l00201"></a>00201 }
<a name="l00202"></a>00202 
<a name="l00207"></a><a class="code" href="class_c_p_menu_item.html#a13442a7ae3e9672789d9c8aa42bf6e98">00207</a> - (void)setAction:(<span class="keywordtype">SEL</span>)anAction
<a name="l00208"></a>00208 {
<a name="l00209"></a>00209     _action = anAction;
<a name="l00210"></a>00210 }
<a name="l00211"></a>00211 
<a name="l00215"></a><a class="code" href="class_c_p_menu_item.html#afb3d12a27bc6481115e7ac446233e696">00215</a> - (SEL)action
<a name="l00216"></a>00216 {
<a name="l00217"></a>00217     <span class="keywordflow">return</span> _action;
<a name="l00218"></a>00218 }
<a name="l00219"></a>00219 
<a name="l00220"></a>00220 <span class="comment">// Managing the Title</span>
<a name="l00225"></a><a class="code" href="class_c_p_menu_item.html#abba2155e6932f707d46014c9714ca5f8">00225</a> <span class="comment"></span>- (void)setTitle:(<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)aTitle
<a name="l00226"></a>00226 {
<a name="l00227"></a>00227     _mnemonicLocation = <a class="code" href="_c_p_obj_j_runtime_8j.html#a84e3be579b365cc2c1559e1a1f469238">CPNotFound</a>;
<a name="l00228"></a>00228 
<a name="l00229"></a>00229     <span class="keywordflow">if</span> (_title == aTitle)
<a name="l00230"></a>00230         <span class="keywordflow">return</span>;
<a name="l00231"></a>00231     
<a name="l00232"></a>00232     _title = aTitle;
<a name="l00233"></a>00233     
<a name="l00234"></a>00234     [_menuItemView setDirty];
<a name="l00235"></a>00235     
<a name="l00236"></a>00236     [_menu itemChanged:self];
<a name="l00237"></a>00237 }
<a name="l00238"></a>00238 
<a name="l00242"></a><a class="code" href="class_c_p_menu_item.html#a72bd9c12033795adc8ba03a1a05aeb1a">00242</a> - (<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)title
<a name="l00243"></a>00243 {
<a name="l00244"></a>00244     <span class="keywordflow">return</span> _title;
<a name="l00245"></a>00245 }
<a name="l00246"></a>00246 
<a name="l00250"></a><a class="code" href="class_c_p_menu_item.html#a79a755c5c37c0842825c4ec520bd5f0f">00250</a> - (void)setTextColor:(<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)aColor
<a name="l00251"></a>00251 {
<a name="l00252"></a>00252     <span class="comment">//FIXME IMPLEMENT</span>
<a name="l00253"></a>00253 }
<a name="l00254"></a>00254 
<a name="l00259"></a><a class="code" href="class_c_p_menu_item.html#a3b2651598ec2c7853bd052beafa2231d">00259</a> - (void)setFont:(<a class="code" href="class_c_p_font.html">CPFont</a>)aFont
<a name="l00260"></a>00260 {
<a name="l00261"></a>00261     <span class="keywordflow">if</span> (_font == aFont)
<a name="l00262"></a>00262         <span class="keywordflow">return</span>;
<a name="l00263"></a>00263         
<a name="l00264"></a>00264     _font = aFont;
<a name="l00265"></a>00265 
<a name="l00266"></a>00266     [_menu itemChanged:self];
<a name="l00267"></a>00267     
<a name="l00268"></a>00268     [_menuItemView setDirty];
<a name="l00269"></a>00269 }
<a name="l00270"></a>00270 
<a name="l00274"></a><a class="code" href="class_c_p_menu_item.html#a1b28883431c664820d4d3ef21033515a">00274</a> - (<a class="code" href="class_c_p_font.html">CPFont</a>)font
<a name="l00275"></a>00275 {
<a name="l00276"></a>00276     <span class="keywordflow">return</span> _font;
<a name="l00277"></a>00277 }
<a name="l00278"></a>00278 
<a name="l00279"></a>00279 <span class="comment">/*</span>
<a name="l00280"></a>00280 <span class="comment">- (void)setAttributedTitle:(CPAttributedString)aTitle</span>
<a name="l00281"></a>00281 <span class="comment">{</span>
<a name="l00282"></a>00282 <span class="comment">}</span>
<a name="l00283"></a>00283 <span class="comment"></span>
<a name="l00284"></a>00284 <span class="comment">- (CPAttributedString)attributedTitle</span>
<a name="l00285"></a>00285 <span class="comment">{</span>
<a name="l00286"></a>00286 <span class="comment">}</span>
<a name="l00287"></a>00287 <span class="comment">*/</span>
<a name="l00288"></a>00288 
<a name="l00289"></a>00289 <span class="comment">// Managing the Tag</span>
<a name="l00294"></a><a class="code" href="class_c_p_menu_item.html#a283de3b854e73325e68c61d32c612142">00294</a> <span class="comment"></span>- (void)setTag:(<span class="keywordtype">int</span>)aTag
<a name="l00295"></a>00295 {
<a name="l00296"></a>00296     _tag = aTag;
<a name="l00297"></a>00297 }
<a name="l00298"></a>00298 
<a name="l00302"></a><a class="code" href="class_c_p_menu_item.html#ac61ea6e7519614338d61b4b9add2f057">00302</a> - (int)<a class="code" href="_c_p_segmented_control_8j.html#aab34f2fc02b4a86bea93c68e1ec09d75">tag</a>
<a name="l00303"></a>00303 {
<a name="l00304"></a>00304     <span class="keywordflow">return</span> _tag;
<a name="l00305"></a>00305 }
<a name="l00306"></a>00306 
<a name="l00315"></a><a class="code" href="class_c_p_menu_item.html#a16d075e27ef6f98ffb3bd7c883de4e80">00315</a> - (void)setState:(<span class="keywordtype">int</span>)aState
<a name="l00316"></a>00316 {
<a name="l00317"></a>00317     <span class="keywordflow">if</span> (_state == aState)
<a name="l00318"></a>00318         <span class="keywordflow">return</span>;
<a name="l00319"></a>00319     
<a name="l00320"></a>00320     _state = aState;
<a name="l00321"></a>00321     
<a name="l00322"></a>00322     [_menu itemChanged:self];
<a name="l00323"></a>00323 
<a name="l00324"></a>00324     [_menuItemView setDirty];
<a name="l00325"></a>00325 }
<a name="l00326"></a>00326 
<a name="l00335"></a><a class="code" href="class_c_p_menu_item.html#a2c6be1c4bdd7ca04b3e8edb0a2ebe414">00335</a> - (int)state
<a name="l00336"></a>00336 {
<a name="l00337"></a>00337     <span class="keywordflow">return</span> _state;
<a name="l00338"></a>00338 }
<a name="l00339"></a>00339 
<a name="l00340"></a>00340 <span class="comment">// Managing the Image</span>
<a name="l00345"></a><a class="code" href="class_c_p_menu_item.html#a2b22731519f1e860b45f61de3dc0cc9b">00345</a> <span class="comment"></span>- (void)setImage:(<a class="code" href="class_c_p_image.html">CPImage</a>)anImage
<a name="l00346"></a>00346 {
<a name="l00347"></a>00347     <span class="keywordflow">if</span> (_image == anImage)
<a name="l00348"></a>00348         <span class="keywordflow">return</span>;
<a name="l00349"></a>00349     
<a name="l00350"></a>00350     _image = anImage;
<a name="l00351"></a>00351 
<a name="l00352"></a>00352     [_menuItemView setDirty];
<a name="l00353"></a>00353     
<a name="l00354"></a>00354     [_menu itemChanged:self];
<a name="l00355"></a>00355 }
<a name="l00356"></a>00356 
<a name="l00360"></a><a class="code" href="class_c_p_menu_item.html#a535818d21d45870a5f8f1eae5f5b87f8">00360</a> - (<a class="code" href="class_c_p_image.html">CPImage</a>)image
<a name="l00361"></a>00361 {
<a name="l00362"></a>00362     <span class="keywordflow">return</span> _image;
<a name="l00363"></a>00363 }
<a name="l00364"></a>00364 
<a name="l00369"></a><a class="code" href="class_c_p_menu_item.html#af2bf43500252a3311ee71106d99f45c1">00369</a> - (void)setAlternateImage:(<a class="code" href="class_c_p_image.html">CPImage</a>)anImage
<a name="l00370"></a>00370 {
<a name="l00371"></a>00371     _alternateImage = anImage;
<a name="l00372"></a>00372 }
<a name="l00373"></a>00373 
<a name="l00377"></a><a class="code" href="class_c_p_menu_item.html#aa9fa5ac9335665e501cad4babf77692f">00377</a> - (<a class="code" href="class_c_p_image.html">CPImage</a>)alternateImage
<a name="l00378"></a>00378 {
<a name="l00379"></a>00379     <span class="keywordflow">return</span> _alternateImage;
<a name="l00380"></a>00380 }
<a name="l00381"></a>00381 
<a name="l00387"></a><a class="code" href="class_c_p_menu_item.html#a2ef855cd35a985051cb5327169e6665a">00387</a> - (void)setOnStateImage:(<a class="code" href="class_c_p_image.html">CPImage</a>)anImage
<a name="l00388"></a>00388 {
<a name="l00389"></a>00389     <span class="keywordflow">if</span> (_onStateImage == anImage)
<a name="l00390"></a>00390         <span class="keywordflow">return</span>;
<a name="l00391"></a>00391     
<a name="l00392"></a>00392     _onStateImage = anImage;
<a name="l00393"></a>00393     [_menu itemChanged:self];
<a name="l00394"></a>00394 }
<a name="l00395"></a>00395 
<a name="l00399"></a><a class="code" href="class_c_p_menu_item.html#a50d08e8605e384e17758131f5addc69d">00399</a> - (<a class="code" href="class_c_p_image.html">CPImage</a>)onStateImage
<a name="l00400"></a>00400 {
<a name="l00401"></a>00401     <span class="keywordflow">return</span> _onStateImage;
<a name="l00402"></a>00402 }
<a name="l00403"></a>00403 
<a name="l00408"></a><a class="code" href="class_c_p_menu_item.html#a993a5f82328535520afd9083985173a0">00408</a> - (void)setOffStateImage:(<a class="code" href="class_c_p_image.html">CPImage</a>)anImage
<a name="l00409"></a>00409 {
<a name="l00410"></a>00410     <span class="keywordflow">if</span> (_offStateImage == anImage)
<a name="l00411"></a>00411         <span class="keywordflow">return</span>;
<a name="l00412"></a>00412     
<a name="l00413"></a>00413     _offStateImage = anImage;
<a name="l00414"></a>00414     [_menu itemChanged:self];
<a name="l00415"></a>00415 }
<a name="l00416"></a>00416 
<a name="l00420"></a><a class="code" href="class_c_p_menu_item.html#aa05c9e4eba04c5eb85a77dc9e7d703df">00420</a> - (<a class="code" href="class_c_p_image.html">CPImage</a>)offStateImage
<a name="l00421"></a>00421 {
<a name="l00422"></a>00422     <span class="keywordflow">return</span> _offStateImage;
<a name="l00423"></a>00423 }
<a name="l00424"></a>00424 
<a name="l00429"></a><a class="code" href="class_c_p_menu_item.html#ac4853e44372589b6c08dd857455be847">00429</a> - (void)setMixedStateImage:(<a class="code" href="class_c_p_image.html">CPImage</a>)anImage
<a name="l00430"></a>00430 {
<a name="l00431"></a>00431     <span class="keywordflow">if</span> (_mixedStateImage == anImage)
<a name="l00432"></a>00432         <span class="keywordflow">return</span>;
<a name="l00433"></a>00433     
<a name="l00434"></a>00434     _mixedStateImage = anImage;
<a name="l00435"></a>00435     [_menu itemChanged:self];
<a name="l00436"></a>00436 }
<a name="l00437"></a>00437 
<a name="l00442"></a><a class="code" href="class_c_p_menu_item.html#a0ec96659d0095bfd76ad19de154e1d19">00442</a> - (<a class="code" href="class_c_p_image.html">CPImage</a>)mixedStateImage
<a name="l00443"></a>00443 {
<a name="l00444"></a>00444     <span class="keywordflow">return</span> _mixedStateImage;
<a name="l00445"></a>00445 }
<a name="l00446"></a>00446 
<a name="l00447"></a>00447 <span class="comment">// Managing Subemenus</span>
<a name="l00452"></a><a class="code" href="class_c_p_menu_item.html#a901a5ff7bd6107acdf78f407f3519d60">00452</a> <span class="comment"></span>- (void)setSubmenu:(<a class="code" href="class_c_p_menu.html">CPMenu</a>)aMenu
<a name="l00453"></a>00453 {
<a name="l00454"></a>00454     <span class="keywordflow">if</span> (_submenu === aMenu)
<a name="l00455"></a>00455         <span class="keywordflow">return</span>;
<a name="l00456"></a>00456 
<a name="l00457"></a>00457     var supermenu = [_submenu supermenu];
<a name="l00458"></a>00458 
<a name="l00459"></a>00459     <span class="keywordflow">if</span> (supermenu)
<a name="l00460"></a>00460         [<a class="code" href="class_c_p_exception.html" title="Used to implement exception handling (creating &amp;amp; raising).">CPException</a> <a class="code" href="class_c_p_exception.html#ac8f34bd11868822e26a7b952810128b8">raise</a>:CPInvalidArgumentException
<a name="l00461"></a>00461                    <a class="code" href="class_c_p_exception.html#ac8f34bd11868822e26a7b952810128b8">reason</a>: @&quot;Can&apos;t add submenu \&quot;&quot; + [aMenu <a class="code" href="class_c_p_menu.html#a91151fb7764e8ddca293fb133e7485b5">title</a>] + &quot;\&quot; to item \&quot;&quot; + [<span class="keyword">self</span> <a class="code" href="class_c_p_menu_item.html#a72bd9c12033795adc8ba03a1a05aeb1a">title</a>] + &quot;\&quot;, because it is already submenu of \&quot;&quot; + [[aMenu <a class="code" href="class_c_p_menu.html#ace37f15dab617924db4e7738e957fe39">supermenu</a>] <a class="code" href="class_c_p_menu.html#a91151fb7764e8ddca293fb133e7485b5">title</a>] + &quot;\&quot;&quot;];
<a name="l00462"></a>00462 
<a name="l00463"></a>00463     _submenu = aMenu;
<a name="l00464"></a>00464 
<a name="l00465"></a>00465     <span class="keywordflow">if</span> (_submenu)
<a name="l00466"></a>00466     {
<a name="l00467"></a>00467         [_submenu setSupermenu:_menu];
<a name="l00468"></a>00468 
<a name="l00469"></a>00469         [<span class="keyword">self</span> <a class="code" href="class_c_p_menu_item.html#a426daddb3e4c5ed027fbbc5ce3d5453f">setTarget</a>:_menu];
<a name="l00470"></a>00470         [<span class="keyword">self</span> <a class="code" href="class_c_p_menu_item.html#a13442a7ae3e9672789d9c8aa42bf6e98">setAction</a>:@selector(<a class="code" href="class_c_p_menu_item.html#a13442a7ae3e9672789d9c8aa42bf6e98">submenuAction</a>:)];
<a name="l00471"></a>00471     }
<a name="l00472"></a>00472     <span class="keywordflow">else</span>
<a name="l00473"></a>00473     {
<a name="l00474"></a>00474         [<span class="keyword">self</span> <a class="code" href="class_c_p_menu_item.html#a426daddb3e4c5ed027fbbc5ce3d5453f">setTarget</a>:nil];
<a name="l00475"></a>00475         [<span class="keyword">self</span> <a class="code" href="class_c_p_menu_item.html#a13442a7ae3e9672789d9c8aa42bf6e98">setAction</a>:NULL];
<a name="l00476"></a>00476     }
<a name="l00477"></a>00477 
<a name="l00478"></a>00478     [_menuItemView setDirty];
<a name="l00479"></a>00479 
<a name="l00480"></a>00480     [_menu itemChanged:self];
<a name="l00481"></a>00481 }
<a name="l00482"></a>00482 
<a name="l00486"></a><a class="code" href="class_c_p_menu_item.html#a9fe9c21dce1dc78649c1d7a3eaf88847">00486</a> - (<a class="code" href="class_c_p_menu.html">CPMenu</a>)submenu
<a name="l00487"></a>00487 {
<a name="l00488"></a>00488     <span class="keywordflow">return</span> _submenu;
<a name="l00489"></a>00489 }
<a name="l00490"></a>00490 
<a name="l00494"></a><a class="code" href="class_c_p_menu_item.html#aa5b977846dc8f6303baaa2ac68b95062">00494</a> - (BOOL)hasSubmenu
<a name="l00495"></a>00495 {
<a name="l00496"></a>00496     <span class="keywordflow">return</span> _submenu ? YES : NO;
<a name="l00497"></a>00497 }
<a name="l00498"></a>00498 
<a name="l00499"></a>00499 <span class="comment">// Getting a Separator Item</span>
<a name="l00500"></a>00500 
<a name="l00504"></a><a class="code" href="class_c_p_menu_item.html#a0a069dafa60ba772e526907eaaf5f8bc">00504</a> + (<a class="code" href="class_c_p_menu_item.html">CPMenuItem</a>)separatorItem
<a name="l00505"></a>00505 {
<a name="l00506"></a>00506     var separatorItem = [[<span class="keyword">self</span> alloc] initWithTitle:@&quot;&quot; action:nil keyEquivalent:nil];
<a name="l00507"></a>00507 
<a name="l00508"></a>00508     separatorItem._isSeparator = YES;
<a name="l00509"></a>00509 
<a name="l00510"></a>00510     <span class="keywordflow">return</span> separatorItem;
<a name="l00511"></a>00511 }
<a name="l00512"></a>00512 
<a name="l00516"></a><a class="code" href="class_c_p_menu_item.html#ac8bd5203bf8593b84f736ab42abede19">00516</a> - (BOOL)isSeparatorItem
<a name="l00517"></a>00517 {
<a name="l00518"></a>00518     <span class="keywordflow">return</span> _isSeparator;
<a name="l00519"></a>00519 }
<a name="l00520"></a>00520 
<a name="l00521"></a>00521 <span class="comment">// Managing the Owning Menu</span>
<a name="l00526"></a><a class="code" href="class_c_p_menu_item.html#afd88c16779b80c187d192ed84587133a">00526</a> <span class="comment"></span>- (void)setMenu:(<a class="code" href="class_c_p_menu.html">CPMenu</a>)aMenu
<a name="l00527"></a>00527 {
<a name="l00528"></a>00528     _menu = aMenu;
<a name="l00529"></a>00529 }
<a name="l00530"></a>00530 
<a name="l00534"></a><a class="code" href="class_c_p_menu_item.html#a31bd22e1d8a9218460976f982123ef78">00534</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="l00535"></a>00535 {
<a name="l00536"></a>00536     <span class="keywordflow">return</span> _menu;
<a name="l00537"></a>00537 }
<a name="l00538"></a>00538 
<a name="l00539"></a>00539 <span class="comment">//</span>
<a name="l00540"></a>00540 
<a name="l00545"></a><a class="code" href="class_c_p_menu_item.html#a81c3ed30d7ab977353d00b36efbe4deb">00545</a> - (void)setKeyEquivalent:(<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)aString
<a name="l00546"></a>00546 {
<a name="l00547"></a>00547     _keyEquivalent = aString || <span class="stringliteral">@&quot;&quot;</span>;
<a name="l00548"></a>00548 }
<a name="l00549"></a>00549 
<a name="l00553"></a><a class="code" href="class_c_p_menu_item.html#a90739f562040b7256746b22c414f7c6a">00553</a> - (<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)keyEquivalent
<a name="l00554"></a>00554 {
<a name="l00555"></a>00555     <span class="keywordflow">return</span> _keyEquivalent;
<a name="l00556"></a>00556 }
<a name="l00557"></a>00557 
<a name="l00568"></a><a class="code" href="class_c_p_menu_item.html#a550e4eccc39701cf6e0358df8f02b681">00568</a> - (void)setKeyEquivalentModifierMask:(<span class="keywordtype">unsigned</span>)aMask
<a name="l00569"></a>00569 {
<a name="l00570"></a>00570     _keyEquivalentModifierMask = aMask;
<a name="l00571"></a>00571 }
<a name="l00572"></a>00572 
<a name="l00583"></a><a class="code" href="class_c_p_menu_item.html#ade1595b79d1e5f3523cbb853b1a3106b">00583</a> - (unsigned)keyEquivalentModifierMask
<a name="l00584"></a>00584 {
<a name="l00585"></a>00585     <span class="keywordflow">return</span> _keyEquivalentModifierMask;
<a name="l00586"></a>00586 }
<a name="l00587"></a>00587 
<a name="l00588"></a><a class="code" href="class_c_p_menu_item.html#a74c1f6f13f04603578878690a0c5e012">00588</a> - (<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)keyEquivalentStringRepresentation
<a name="l00589"></a>00589 {
<a name="l00590"></a>00590     <span class="keywordflow">if</span> (![_keyEquivalent length])
<a name="l00591"></a>00591         <span class="keywordflow">return</span> <span class="stringliteral">@&quot;&quot;</span>;
<a name="l00592"></a>00592 
<a name="l00593"></a>00593     var <span class="keywordtype">string</span> = _keyEquivalent.toUpperCase(),
<a name="l00594"></a>00594         needsShift = _keyEquivalentModifierMask &amp; <a class="code" href="_c_p_event_8j.html#a2343191b34b38dc1952bb44d83fa30d6">CPShiftKeyMask</a> || <span class="keywordtype">string</span> === _keyEquivalent;
<a name="l00595"></a>00595 
<a name="l00596"></a>00596     <span class="keywordflow">if</span> (<a class="code" href="_c_p_compatibility_8j.html#ae1fbcf225a17315d7dca192a87f1a6f5">CPBrowserIsOperatingSystem</a>(<a class="code" href="_c_p_compatibility_8j.html#aff6eb358aa28aa56c8451ea9683a9d18">CPMacOperatingSystem</a>))
<a name="l00597"></a>00597     {
<a name="l00598"></a>00598         <span class="keywordflow">if</span> (_keyEquivalentModifierMask &amp; <a class="code" href="_c_p_event_8j.html#a675a3ab6cfc14dd4ad6702d7c682c7fe">CPCommandKeyMask</a>)
<a name="l00599"></a>00599             <span class="keywordtype">string</span> = <span class="stringliteral">&quot;&quot;</span> + string;
<a name="l00600"></a>00600 
<a name="l00601"></a>00601         <span class="keywordflow">if</span> (needsShift)
<a name="l00602"></a>00602             <span class="keywordtype">string</span> = <span class="stringliteral">&quot;&quot;</span> + string;
<a name="l00603"></a>00603 
<a name="l00604"></a>00604         <span class="keywordflow">if</span> (_keyEquivalentModifierMask &amp; <a class="code" href="_c_p_event_8j.html#abb24a409c7daa575dd1fa20b7fcf8d51">CPAlternateKeyMask</a>)
<a name="l00605"></a>00605             <span class="keywordtype">string</span> = <span class="stringliteral">&quot;&quot;</span> + string;
<a name="l00606"></a>00606 
<a name="l00607"></a>00607         <span class="keywordflow">if</span> (_keyEquivalentModifierMask &amp; <a class="code" href="_c_p_event_8j.html#a144f394b3de6afb9b329491dba0e8d14">CPControlKeyMask</a>)
<a name="l00608"></a>00608             <span class="keywordtype">string</span> = <span class="stringliteral">&quot;^&quot;</span> + string;
<a name="l00609"></a>00609     }
<a name="l00610"></a>00610     <span class="keywordflow">else</span>
<a name="l00611"></a>00611     {
<a name="l00612"></a>00612         <span class="keywordflow">if</span> (needsShift)
<a name="l00613"></a>00613             <span class="keywordtype">string</span> = <span class="stringliteral">&quot;Shift-&quot;</span> + string;
<a name="l00614"></a>00614 
<a name="l00615"></a>00615         <span class="keywordflow">if</span> (_keyEquivalentModifierMask &amp; <a class="code" href="_c_p_event_8j.html#abb24a409c7daa575dd1fa20b7fcf8d51">CPAlternateKeyMask</a>)
<a name="l00616"></a>00616             <span class="keywordtype">string</span> = <span class="stringliteral">&quot;Alt-&quot;</span> + string;
<a name="l00617"></a>00617 
<a name="l00618"></a>00618         <span class="keywordflow">if</span> (_keyEquivalentModifierMask &amp; <a class="code" href="_c_p_event_8j.html#a144f394b3de6afb9b329491dba0e8d14">CPControlKeyMask</a> || _keyEquivalentModifierMask &amp; <a class="code" href="_c_p_event_8j.html#a675a3ab6cfc14dd4ad6702d7c682c7fe">CPCommandKeyMask</a>)
<a name="l00619"></a>00619             <span class="keywordtype">string</span> = <span class="stringliteral">&quot;Ctrl-&quot;</span> + string;
<a name="l00620"></a>00620     }
<a name="l00621"></a>00621 
<a name="l00622"></a>00622     <span class="keywordflow">return</span> string;
<a name="l00623"></a>00623 }
<a name="l00624"></a>00624 
<a name="l00625"></a>00625 <span class="comment">// Managing Mnemonics</span>
<a name="l00631"></a><a class="code" href="class_c_p_menu_item.html#af193330548d5bc4a6d118fe50e963f9b">00631</a> <span class="comment"></span>- (void)setMnemonicLocation:(<span class="keywordtype">unsigned</span>)aLocation
<a name="l00632"></a>00632 {
<a name="l00633"></a>00633     _mnemonicLocation = aLocation;
<a name="l00634"></a>00634 }
<a name="l00635"></a>00635 
<a name="l00639"></a><a class="code" href="class_c_p_menu_item.html#a5981c047f026dcd49072f122ad33a92f">00639</a> - (unsigned)mnemonicLocation
<a name="l00640"></a>00640 {
<a name="l00641"></a>00641     <span class="keywordflow">return</span> _mnemonicLocation;
<a name="l00642"></a>00642 }
<a name="l00643"></a>00643 
<a name="l00648"></a><a class="code" href="class_c_p_menu_item.html#ab4e7641ace49ceb3be491b19084d6266">00648</a> - (void)setTitleWithMnemonicLocation:(<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)aTitle
<a name="l00649"></a>00649 {
<a name="l00650"></a>00650     var location = [aTitle <a class="code" href="class_c_p_string.html#a2f8b1e6c0c44ee0e3a944c8fc03fdde4">rangeOfString</a>:@&quot;&amp;&quot;].location;
<a name="l00651"></a>00651     
<a name="l00652"></a>00652     <span class="keywordflow">if</span> (location == <a class="code" href="_c_p_obj_j_runtime_8j.html#a84e3be579b365cc2c1559e1a1f469238">CPNotFound</a>)
<a name="l00653"></a>00653         [<span class="keyword">self</span> <a class="code" href="class_c_p_menu_item.html#abba2155e6932f707d46014c9714ca5f8">setTitle</a>:aTitle];
<a name="l00654"></a>00654     <span class="keywordflow">else</span>
<a name="l00655"></a>00655     {
<a name="l00656"></a>00656         [<span class="keyword">self</span> <a class="code" href="class_c_p_menu_item.html#abba2155e6932f707d46014c9714ca5f8">setTitle</a>:[aTitle <a class="code" href="class_c_p_string.html#ab74d7a1f416b2299384df2f65d307b27">substringToIndex</a>:location] + [aTitle <a class="code" href="class_c_p_string.html#a8fb915fde11a018fc9ebaa10af9444e5">substringFromIndex</a>:location + 1]];
<a name="l00657"></a>00657         [<span class="keyword">self</span> <a class="code" href="class_c_p_menu_item.html#af193330548d5bc4a6d118fe50e963f9b">setMnemonicLocation</a>:location];
<a name="l00658"></a>00658     }    
<a name="l00659"></a>00659 }
<a name="l00660"></a>00660 
<a name="l00664"></a><a class="code" href="class_c_p_menu_item.html#af8df72205133c951fb4471947fa650e0">00664</a> - (<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)mnemonic
<a name="l00665"></a>00665 {
<a name="l00666"></a>00666     <span class="keywordflow">return</span> _mnemonicLocation == <a class="code" href="_c_p_obj_j_runtime_8j.html#a84e3be579b365cc2c1559e1a1f469238">CPNotFound</a> ? <span class="stringliteral">@&quot;&quot;</span> : [_title characterAtIndex:_mnemonicLocation];
<a name="l00667"></a>00667 }
<a name="l00668"></a>00668 
<a name="l00669"></a>00669 <span class="comment">// Managing Alternates</span>
<a name="l00670"></a>00670 
<a name="l00675"></a><a class="code" href="class_c_p_menu_item.html#ae0e4259372b5940fe42cb7b54b53fdf6">00675</a> - (void)setAlternate:(BOOL)isAlternate
<a name="l00676"></a>00676 {
<a name="l00677"></a>00677     _isAlternate = isAlternate;
<a name="l00678"></a>00678 }
<a name="l00679"></a>00679 
<a name="l00683"></a><a class="code" href="class_c_p_menu_item.html#ad7d05c056dfcd7642f0866a4f31598e8">00683</a> - (BOOL)isAlternate
<a name="l00684"></a>00684 {
<a name="l00685"></a>00685     <span class="keywordflow">return</span> _isAlternate;
<a name="l00686"></a>00686 }
<a name="l00687"></a>00687 
<a name="l00688"></a>00688 <span class="comment">// Managing Indentation Levels</span>
<a name="l00689"></a>00689 
<a name="l00695"></a><a class="code" href="class_c_p_menu_item.html#abfd48b29b54f593b6fd9acd6eb6be497">00695</a> - (void)setIndentationLevel:(<span class="keywordtype">unsigned</span>)aLevel
<a name="l00696"></a>00696 {
<a name="l00697"></a>00697     <span class="keywordflow">if</span> (aLevel &lt; 0)
<a name="l00698"></a>00698         [<a class="code" href="class_c_p_exception.html" title="Used to implement exception handling (creating &amp;amp; raising).">CPException</a> <a class="code" href="class_c_p_exception.html#ac8f34bd11868822e26a7b952810128b8">raise</a>:CPInvalidArgumentException <a class="code" href="class_c_p_exception.html#ac8f34bd11868822e26a7b952810128b8">reason</a>:&quot;setIndentationLevel: argument must be greater than or equal to 0.&quot;];
<a name="l00699"></a>00699         
<a name="l00700"></a>00700     _indentationLevel = <a class="code" href="_c_p_obj_j_runtime_8j.html#a4fca277171215842609dc38a6f0c19fb">MIN</a>(15, aLevel);
<a name="l00701"></a>00701 }
<a name="l00702"></a>00702 
<a name="l00706"></a><a class="code" href="class_c_p_menu_item.html#a1fe690cef7fff2967a769cbb9f83e718">00706</a> - (unsigned)indentationLevel
<a name="l00707"></a>00707 {
<a name="l00708"></a>00708     <span class="keywordflow">return</span> _indentationLevel;
<a name="l00709"></a>00709 }
<a name="l00710"></a>00710 
<a name="l00711"></a>00711 <span class="comment">// Managing Tool Tips</span>
<a name="l00716"></a><a class="code" href="class_c_p_menu_item.html#af700070e3ea076f4237fed7a77280f39">00716</a> <span class="comment"></span>- (void)setToolTip:(<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)aToolTip
<a name="l00717"></a>00717 {
<a name="l00718"></a>00718     _toolTip = aToolTip;
<a name="l00719"></a>00719 }
<a name="l00720"></a>00720 
<a name="l00724"></a><a class="code" href="class_c_p_menu_item.html#a52d6493fe015c788e0c81da5b7ed8db8">00724</a> - (<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)toolTip
<a name="l00725"></a>00725 {
<a name="l00726"></a>00726     <span class="keywordflow">return</span> _toolTip;
<a name="l00727"></a>00727 }
<a name="l00728"></a>00728 
<a name="l00729"></a>00729 <span class="comment">// Representing an Object</span>
<a name="l00730"></a>00730 
<a name="l00735"></a><a class="code" href="class_c_p_menu_item.html#a1f387dafd3af8796a07b8fd524891f77">00735</a> - (void)setRepresentedObject:(<span class="keywordtype">id</span>)anObject
<a name="l00736"></a>00736 {
<a name="l00737"></a>00737     _representedObject = anObject;
<a name="l00738"></a>00738 }
<a name="l00739"></a>00739 
<a name="l00743"></a><a class="code" href="class_c_p_menu_item.html#a270c5cc18f761faa8a22210cdec08269">00743</a> - (id)representedObject
<a name="l00744"></a>00744 {
<a name="l00745"></a>00745     <span class="keywordflow">return</span> _representedObject;
<a name="l00746"></a>00746 }
<a name="l00747"></a>00747 
<a name="l00748"></a>00748 <span class="comment">// Managing the View</span>
<a name="l00749"></a>00749 
<a name="l00754"></a><a class="code" href="class_c_p_menu_item.html#a207d9da23180af6121624fa3e26e8ad7">00754</a> - (void)setView:(<a class="code" href="class_c_p_view.html">CPView</a>)aView
<a name="l00755"></a>00755 {
<a name="l00756"></a>00756     <span class="keywordflow">if</span> (_view === aView)
<a name="l00757"></a>00757         <span class="keywordflow">return</span>;
<a name="l00758"></a>00758     
<a name="l00759"></a>00759     _view = aView;
<a name="l00760"></a>00760     
<a name="l00761"></a>00761     [_menuItemView setDirty];
<a name="l00762"></a>00762     
<a name="l00763"></a>00763     [_menu itemChanged:self];
<a name="l00764"></a>00764 }
<a name="l00765"></a>00765 
<a name="l00769"></a><a class="code" href="class_c_p_menu_item.html#a83682140fc6f903e27be69a2f9d51e67">00769</a> - (<a class="code" href="class_c_p_view.html">CPView</a>)view
<a name="l00770"></a>00770 {
<a name="l00771"></a>00771     <span class="keywordflow">return</span> _view;
<a name="l00772"></a>00772 }
<a name="l00773"></a>00773 
<a name="l00774"></a>00774 <span class="comment">// Getting Highlighted Status</span>
<a name="l00775"></a>00775 
<a name="l00779"></a><a class="code" href="class_c_p_menu_item.html#a4977558619642cfef16370f4b0c21186">00779</a> - (BOOL)isHighlighted
<a name="l00780"></a>00780 {
<a name="l00781"></a>00781     <span class="keywordflow">return</span> [[<span class="keyword">self</span> <a class="code" href="class_c_p_menu_item.html#a31bd22e1d8a9218460976f982123ef78">menu</a>] <a class="code" href="class_c_p_menu.html#a4678d712872da85b990640a50678add8">highlightedItem</a>] == <span class="keyword">self</span>;
<a name="l00782"></a>00782 }
<a name="l00783"></a>00783 
<a name="l00784"></a>00784 <span class="comment">//</span>
<a name="l00785"></a>00785 
<a name="l00786"></a>00786 <span class="comment">/*</span>
<a name="l00787"></a>00787 <span class="comment">    @ignore</span>
<a name="l00788"></a>00788 <span class="comment">*/</span>
<a name="l00789"></a>00789 - (id)_menuItemView
<a name="l00790"></a>00790 {
<a name="l00791"></a>00791     <span class="keywordflow">if</span> (!_menuItemView)
<a name="l00792"></a>00792         _menuItemView = [[_CPMenuItemView alloc] initWithFrame:CGRectMakeZero() forMenuItem:self];
<a name="l00793"></a>00793     
<a name="l00794"></a>00794     <span class="keywordflow">return</span> _menuItemView;
<a name="l00795"></a>00795 }
<a name="l00796"></a>00796 
<a name="l00797"></a>00797 - (BOOL)_isSelectable
<a name="l00798"></a>00798 {
<a name="l00799"></a>00799     <span class="keywordflow">return</span> ![<span class="keyword">self</span> submenu] || [<span class="keyword">self</span> action] !== <span class="keyword">@selector</span>(submenuAction:) || [<span class="keyword">self</span> target] !== [<span class="keyword">self</span> <a class="code" href="_c_p_segmented_control_8j.html#a013c594489b43812712541b68420b137">menu</a>];
<a name="l00800"></a>00800 }
<a name="l00801"></a>00801 
<a name="l00802"></a>00802 - (BOOL)_isMenuBarButton
<a name="l00803"></a>00803 {
<a name="l00804"></a>00804     <span class="keywordflow">return</span> ![<span class="keyword">self</span> submenu] &amp;&amp; [<span class="keyword">self</span> menu] === [CPApp mainMenu];
<a name="l00805"></a>00805 }
<a name="l00806"></a>00806 
<a name="l00807"></a>00807 <span class="keyword">@end</span>
<a name="l00808"></a>00808 
<a name="l00809"></a><a class="code" href="_c_p_menu_item_8j.html#a17c1ca9cdba6c2654ea32ab3e704d93c">00809</a> var <a class="code" href="_c_p_menu_item_8j.html#a17c1ca9cdba6c2654ea32ab3e704d93c">CPMenuItemIsSeparatorKey</a>                = <span class="stringliteral">@&quot;CPMenuItemIsSeparatorKey&quot;</span>,
<a name="l00810"></a>00810 
<a name="l00811"></a><a class="code" href="_c_p_menu_item_8j.html#a78b6c4fab5e369d11edaa7b4e3b4df30">00811</a>     <a class="code" href="_c_p_menu_item_8j.html#a78b6c4fab5e369d11edaa7b4e3b4df30">CPMenuItemTitleKey</a>                      = <span class="stringliteral">@&quot;CPMenuItemTitleKey&quot;</span>,
<a name="l00812"></a><a class="code" href="_c_p_menu_item_8j.html#a666f59dc753f01ee71c9696d35205d20">00812</a>     <a class="code" href="_c_p_menu_item_8j.html#a666f59dc753f01ee71c9696d35205d20">CPMenuItemTargetKey</a>                     = <span class="stringliteral">@&quot;CPMenuItemTargetKey&quot;</span>,
<a name="l00813"></a><a class="code" href="_c_p_menu_item_8j.html#abf83f8aeacbc0a45b297caefa6403701">00813</a>     <a class="code" href="_c_p_menu_item_8j.html#abf83f8aeacbc0a45b297caefa6403701">CPMenuItemActionKey</a>                     = <span class="stringliteral">@&quot;CPMenuItemActionKey&quot;</span>,
<a name="l00814"></a>00814 
<a name="l00815"></a><a class="code" href="_c_p_menu_item_8j.html#af27f94fcfa41d2ff278eb778e02b058c">00815</a>     <a class="code" href="_c_p_menu_item_8j.html#af27f94fcfa41d2ff278eb778e02b058c">CPMenuItemIsEnabledKey</a>                  = <span class="stringliteral">@&quot;CPMenuItemIsEnabledKey&quot;</span>,
<a name="l00816"></a><a class="code" href="_c_p_menu_item_8j.html#a21abbc24f91ffc6a7287d00483c30c59">00816</a>     <a class="code" href="_c_p_menu_item_8j.html#a21abbc24f91ffc6a7287d00483c30c59">CPMenuItemIsHiddenKey</a>                   = <span class="stringliteral">@&quot;CPMenuItemIsHiddenKey&quot;</span>,
<a name="l00817"></a>00817 
<a name="l00818"></a><a class="code" href="_c_p_menu_item_8j.html#ad26f815bd2340e78bac01b7513df4fb4">00818</a>     <a class="code" href="_c_p_menu_item_8j.html#ad26f815bd2340e78bac01b7513df4fb4">CPMenuItemTagKey</a>                        = <span class="stringliteral">@&quot;CPMenuItemTagKey&quot;</span>,
<a name="l00819"></a><a class="code" href="_c_p_menu_item_8j.html#a067582511ac76eb8f75aea1cac4834cc">00819</a>     <a class="code" href="_c_p_menu_item_8j.html#a067582511ac76eb8f75aea1cac4834cc">CPMenuItemStateKey</a>                      = <span class="stringliteral">@&quot;CPMenuItemStateKey&quot;</span>,
<a name="l00820"></a>00820 
<a name="l00821"></a><a class="code" href="_c_p_menu_item_8j.html#af46e626f3d457b4c3663230ef7da3798">00821</a>     <a class="code" href="_c_p_menu_item_8j.html#af46e626f3d457b4c3663230ef7da3798">CPMenuItemImageKey</a>                      = <span class="stringliteral">@&quot;CPMenuItemImageKey&quot;</span>,
<a name="l00822"></a><a class="code" href="_c_p_menu_item_8j.html#a001426e00601b3db550ba3a95ce939b0">00822</a>     <a class="code" href="_c_p_menu_item_8j.html#a001426e00601b3db550ba3a95ce939b0">CPMenuItemAlternateImageKey</a>             = <span class="stringliteral">@&quot;CPMenuItemAlternateImageKey&quot;</span>,
<a name="l00823"></a>00823 
<a name="l00824"></a><a class="code" href="_c_p_menu_item_8j.html#a34741f94ad36d58a5ff99c100ee20671">00824</a>     <a class="code" href="_c_p_menu_item_8j.html#a34741f94ad36d58a5ff99c100ee20671">CPMenuItemSubmenuKey</a>                    = <span class="stringliteral">@&quot;CPMenuItemSubmenuKey&quot;</span>,
<a name="l00825"></a><a class="code" href="_c_p_menu_item_8j.html#a0be0c8c407a6e437a6f4086399f68e84">00825</a>     <a class="code" href="_c_p_menu_item_8j.html#a0be0c8c407a6e437a6f4086399f68e84">CPMenuItemMenuKey</a>                       = <span class="stringliteral">@&quot;CPMenuItemMenuKey&quot;</span>,
<a name="l00826"></a>00826 
<a name="l00827"></a><a class="code" href="_c_p_menu_item_8j.html#ad098cc835fb599b8cdcc0fe3fd841076">00827</a>     <a class="code" href="_c_p_menu_item_8j.html#ad098cc835fb599b8cdcc0fe3fd841076">CPMenuItemKeyEquivalentKey</a>              = <span class="stringliteral">@&quot;CPMenuItemKeyEquivalentKey&quot;</span>,
<a name="l00828"></a><a class="code" href="_c_p_menu_item_8j.html#a666ac77e8fe9fe6e8fecb1513e374393">00828</a>     <a class="code" href="_c_p_menu_item_8j.html#a666ac77e8fe9fe6e8fecb1513e374393">CPMenuItemKeyEquivalentModifierMaskKey</a>  = <span class="stringliteral">@&quot;CPMenuItemKeyEquivalentModifierMaskKey&quot;</span>,
<a name="l00829"></a>00829 
<a name="l00830"></a><a class="code" href="_c_p_menu_item_8j.html#a6f0e409063dbbbb7b8e67d080446a39e">00830</a>     <a class="code" href="_c_p_menu_item_8j.html#a6f0e409063dbbbb7b8e67d080446a39e">CPMenuItemIndentationLevelKey</a>           = <span class="stringliteral">@&quot;CPMenuItemIndentationLevelKey&quot;</span>,
<a name="l00831"></a>00831 
<a name="l00832"></a><a class="code" href="_c_p_menu_item_8j.html#ac1faef808f68d789afcd3b8abf98c910">00832</a>     <a class="code" href="_c_p_menu_item_8j.html#ac1faef808f68d789afcd3b8abf98c910">CPMenuItemRepresentedObjectKey</a>          = <span class="stringliteral">@&quot;CPMenuItemRepresentedObjectKey&quot;</span>,
<a name="l00833"></a><a class="code" href="_c_p_menu_item_8j.html#a2bff3dc64176e04ec28455f88fac81e1">00833</a>     <a class="code" href="_c_p_menu_item_8j.html#a2bff3dc64176e04ec28455f88fac81e1">CPMenuItemViewKey</a>                       = <span class="stringliteral">@&quot;CPMenuItemViewKey&quot;</span>;
<a name="l00834"></a>00834 
<a name="l00835"></a><a class="code" href="_c_p_menu_item_8j.html#abbb6dcaf09e533d817dde3b4d00eca85">00835</a> <span class="preprocessor">#define DEFAULT_VALUE(aKey, aDefaultValue) [aCoder containsValueForKey:(aKey)] ? [aCoder decodeObjectForKey:(aKey)] : (aDefaultValue)</span>
<a name="l00836"></a><a class="code" href="_c_p_menu_item_8j.html#aefd1119972de613f4821581e6745c248">00836</a> <span class="preprocessor"></span><span class="preprocessor">#define ENCODE_IFNOT(aKey, aValue, aDefaultValue) if ((aValue) !== (aDefaultValue)) [aCoder encodeObject:(aValue) forKey:(aKey)];</span>
<a name="l00837"></a>00837 <span class="preprocessor"></span>
<a name="l00838"></a>00838 <span class="keyword">@implementation </span><a class="code" href="class_c_p_menu_item.html">CPMenuItem</a> (CPCoding)
<a name="l00844"></a><a class="code" href="class_c_p_menu_item.html#ad4aafeb286d77214b4f5935f50da0dd2">00844</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="l00845"></a>00845 {
<a name="l00846"></a>00846     <span class="keyword">self</span> = [<span class="keyword">super</span> init];
<a name="l00847"></a>00847     
<a name="l00848"></a>00848     <span class="keywordflow">if</span> (<span class="keyword">self</span>)
<a name="l00849"></a>00849     {
<a name="l00850"></a>00850         _isSeparator = [aCoder containsValueForKey:CPMenuItemIsSeparatorKey] &amp;&amp; [aCoder decodeBoolForKey:CPMenuItemIsSeparatorKey];
<a name="l00851"></a>00851 
<a name="l00852"></a>00852         _title = [aCoder decodeObjectForKey:CPMenuItemTitleKey];
<a name="l00853"></a>00853         
<a name="l00854"></a>00854 <span class="comment">//        _font;</span>
<a name="l00855"></a>00855                   
<a name="l00856"></a>00856         _target = [aCoder decodeObjectForKey:CPMenuItemTargetKey];
<a name="l00857"></a>00857         _action = [aCoder decodeObjectForKey:CPMenuItemActionKey];
<a name="l00858"></a>00858 
<a name="l00859"></a>00859         _isEnabled = <a class="code" href="_c_p_menu_item_8j.html#abbb6dcaf09e533d817dde3b4d00eca85">DEFAULT_VALUE</a>(<a class="code" href="_c_p_menu_item_8j.html#af27f94fcfa41d2ff278eb778e02b058c">CPMenuItemIsEnabledKey</a>, YES);
<a name="l00860"></a>00860         _isHidden = <a class="code" href="_c_p_menu_item_8j.html#abbb6dcaf09e533d817dde3b4d00eca85">DEFAULT_VALUE</a>(<a class="code" href="_c_p_menu_item_8j.html#a21abbc24f91ffc6a7287d00483c30c59">CPMenuItemIsHiddenKey</a>, NO);
<a name="l00861"></a>00861         _tag = <a class="code" href="_c_p_menu_item_8j.html#abbb6dcaf09e533d817dde3b4d00eca85">DEFAULT_VALUE</a>(<a class="code" href="_c_p_menu_item_8j.html#ad26f815bd2340e78bac01b7513df4fb4">CPMenuItemTagKey</a>, 0);
<a name="l00862"></a>00862         _state = <a class="code" href="_c_p_menu_item_8j.html#abbb6dcaf09e533d817dde3b4d00eca85">DEFAULT_VALUE</a>(<a class="code" href="_c_p_menu_item_8j.html#a067582511ac76eb8f75aea1cac4834cc">CPMenuItemStateKey</a>, <a class="code" href="_c_p_control_8j.html#a20b0a4f18db100ff9f1f0092b0964f11">CPOffState</a>);
<a name="l00863"></a>00863 <span class="comment">//    int             _state;</span>
<a name="l00864"></a>00864 
<a name="l00865"></a>00865         _image = <a class="code" href="_c_p_menu_item_8j.html#abbb6dcaf09e533d817dde3b4d00eca85">DEFAULT_VALUE</a>(<a class="code" href="_c_p_menu_item_8j.html#af46e626f3d457b4c3663230ef7da3798">CPMenuItemImageKey</a>, nil);
<a name="l00866"></a>00866         _alternateImage = <a class="code" href="_c_p_menu_item_8j.html#abbb6dcaf09e533d817dde3b4d00eca85">DEFAULT_VALUE</a>(<a class="code" href="_c_p_menu_item_8j.html#a001426e00601b3db550ba3a95ce939b0">CPMenuItemAlternateImageKey</a>, nil);
<a name="l00867"></a>00867 <span class="comment">//    CPImage         _onStateImage;</span>
<a name="l00868"></a>00868 <span class="comment">//    CPImage         _offStateImage;</span>
<a name="l00869"></a>00869 <span class="comment">//    CPImage         _mixedStateImage;</span>
<a name="l00870"></a>00870 
<a name="l00871"></a>00871         <span class="comment">// This order matters because setSubmenu: needs _menu to be around.</span>
<a name="l00872"></a>00872         _menu = <a class="code" href="_c_p_menu_item_8j.html#abbb6dcaf09e533d817dde3b4d00eca85">DEFAULT_VALUE</a>(<a class="code" href="_c_p_menu_item_8j.html#a0be0c8c407a6e437a6f4086399f68e84">CPMenuItemMenuKey</a>, nil);
<a name="l00873"></a>00873         [<span class="keyword">self</span> <a class="code" href="class_c_p_menu_item.html#a901a5ff7bd6107acdf78f407f3519d60">setSubmenu</a>:DEFAULT_VALUE(CPMenuItemSubmenuKey, nil)];
<a name="l00874"></a>00874 
<a name="l00875"></a>00875         _keyEquivalent = [aCoder decodeObjectForKey:CPMenuItemKeyEquivalentKey] || <span class="stringliteral">@&quot;&quot;</span>;
<a name="l00876"></a>00876         _keyEquivalentModifierMask = [aCoder decodeObjectForKey:CPMenuItemKeyEquivalentModifierMaskKey] || 0;
<a name="l00877"></a>00877 
<a name="l00878"></a>00878 <span class="comment">//    int             _mnemonicLocation;</span>
<a name="l00879"></a>00879 
<a name="l00880"></a>00880 <span class="comment">//    BOOL            _isAlternate;</span>
<a name="l00881"></a>00881 
<a name="l00882"></a>00882         <span class="comment">// Default is 0.</span>
<a name="l00883"></a>00883         [<span class="keyword">self</span> <a class="code" href="class_c_p_menu_item.html#abfd48b29b54f593b6fd9acd6eb6be497">setIndentationLevel</a>:[aCoder decodeIntForKey:CPMenuItemIndentationLevelKey] || 0];
<a name="l00884"></a>00884 
<a name="l00885"></a>00885 <span class="comment">//    CPString        _toolTip;</span>
<a name="l00886"></a>00886 
<a name="l00887"></a>00887         _representedObject = <a class="code" href="_c_p_menu_item_8j.html#abbb6dcaf09e533d817dde3b4d00eca85">DEFAULT_VALUE</a>(<a class="code" href="_c_p_menu_item_8j.html#ac1faef808f68d789afcd3b8abf98c910">CPMenuItemRepresentedObjectKey</a>, nil);
<a name="l00888"></a>00888         _view = <a class="code" href="_c_p_menu_item_8j.html#abbb6dcaf09e533d817dde3b4d00eca85">DEFAULT_VALUE</a>(<a class="code" href="_c_p_menu_item_8j.html#a2bff3dc64176e04ec28455f88fac81e1">CPMenuItemViewKey</a>, nil);
<a name="l00889"></a>00889     }
<a name="l00890"></a>00890     
<a name="l00891"></a>00891     <span class="keywordflow">return</span> <span class="keyword">self</span>;
<a name="l00892"></a>00892 }
<a name="l00893"></a>00893 
<a name="l00898"></a><a class="code" href="class_c_p_menu_item.html#a867f7f34b6808af0e0f8f3638696926f">00898</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="l00899"></a>00899 {
<a name="l00900"></a>00900     <span class="keywordflow">if</span> (_isSeparator)
<a name="l00901"></a>00901         [aCoder encodeBool:_isSeparator forKey:CPMenuItemIsSeparatorKey];
<a name="l00902"></a>00902 
<a name="l00903"></a>00903     [aCoder encodeObject:_title forKey:CPMenuItemTitleKey];
<a name="l00904"></a>00904         
<a name="l00905"></a>00905     [aCoder encodeObject:_target forKey:CPMenuItemTargetKey];
<a name="l00906"></a>00906     [aCoder encodeObject:_action forKey:CPMenuItemActionKey];
<a name="l00907"></a>00907 
<a name="l00908"></a>00908     <a class="code" href="_c_p_menu_item_8j.html#aefd1119972de613f4821581e6745c248">ENCODE_IFNOT</a>(<a class="code" href="_c_p_menu_item_8j.html#af27f94fcfa41d2ff278eb778e02b058c">CPMenuItemIsEnabledKey</a>, _isEnabled, YES); 
<a name="l00909"></a>00909     <a class="code" href="_c_p_menu_item_8j.html#aefd1119972de613f4821581e6745c248">ENCODE_IFNOT</a>(<a class="code" href="_c_p_menu_item_8j.html#a21abbc24f91ffc6a7287d00483c30c59">CPMenuItemIsHiddenKey</a>, _isHidden, NO);
<a name="l00910"></a>00910 
<a name="l00911"></a>00911     <a class="code" href="_c_p_menu_item_8j.html#aefd1119972de613f4821581e6745c248">ENCODE_IFNOT</a>(<a class="code" href="_c_p_menu_item_8j.html#ad26f815bd2340e78bac01b7513df4fb4">CPMenuItemTagKey</a>, _tag, 0);
<a name="l00912"></a>00912     <a class="code" href="_c_p_menu_item_8j.html#aefd1119972de613f4821581e6745c248">ENCODE_IFNOT</a>(<a class="code" href="_c_p_menu_item_8j.html#a067582511ac76eb8f75aea1cac4834cc">CPMenuItemStateKey</a>, _state, <a class="code" href="_c_p_control_8j.html#a20b0a4f18db100ff9f1f0092b0964f11">CPOffState</a>);
<a name="l00913"></a>00913 
<a name="l00914"></a>00914     <a class="code" href="_c_p_menu_item_8j.html#aefd1119972de613f4821581e6745c248">ENCODE_IFNOT</a>(<a class="code" href="_c_p_menu_item_8j.html#af46e626f3d457b4c3663230ef7da3798">CPMenuItemImageKey</a>, _image, nil);
<a name="l00915"></a>00915     <a class="code" href="_c_p_menu_item_8j.html#aefd1119972de613f4821581e6745c248">ENCODE_IFNOT</a>(<a class="code" href="_c_p_menu_item_8j.html#a001426e00601b3db550ba3a95ce939b0">CPMenuItemAlternateImageKey</a>, _alternateImage, nil);
<a name="l00916"></a>00916     
<a name="l00917"></a>00917     <a class="code" href="_c_p_menu_item_8j.html#aefd1119972de613f4821581e6745c248">ENCODE_IFNOT</a>(<a class="code" href="_c_p_menu_item_8j.html#a34741f94ad36d58a5ff99c100ee20671">CPMenuItemSubmenuKey</a>, _submenu, nil);
<a name="l00918"></a>00918     <a class="code" href="_c_p_menu_item_8j.html#aefd1119972de613f4821581e6745c248">ENCODE_IFNOT</a>(<a class="code" href="_c_p_menu_item_8j.html#a0be0c8c407a6e437a6f4086399f68e84">CPMenuItemMenuKey</a>, _menu, nil);
<a name="l00919"></a>00919 
<a name="l00920"></a>00920     <span class="keywordflow">if</span> (_keyEquivalent &amp;&amp; _keyEquivalent.<a class="code" href="class_c_p_string.html#a995ca4d2f7167db0da2fad02a444ec73">length</a>)
<a name="l00921"></a>00921         [aCoder encodeObject:_keyEquivalent forKey:CPMenuItemKeyEquivalentKey];
<a name="l00922"></a>00922 
<a name="l00923"></a>00923     <span class="keywordflow">if</span> (_keyEquivalentModifierMask)
<a name="l00924"></a>00924         [aCoder encodeObject:_keyEquivalentModifierMask forKey:CPMenuItemKeyEquivalentModifierMaskKey];
<a name="l00925"></a>00925 
<a name="l00926"></a>00926     <span class="keywordflow">if</span> (_indentationLevel &gt; 0)
<a name="l00927"></a>00927         [aCoder encodeInt:_indentationLevel forKey:CPMenuItemIndentationLevelKey];
<a name="l00928"></a>00928 
<a name="l00929"></a>00929     <a class="code" href="_c_p_menu_item_8j.html#aefd1119972de613f4821581e6745c248">ENCODE_IFNOT</a>(<a class="code" href="_c_p_menu_item_8j.html#ac1faef808f68d789afcd3b8abf98c910">CPMenuItemRepresentedObjectKey</a>, _representedObject, nil);
<a name="l00930"></a>00930     <a class="code" href="_c_p_menu_item_8j.html#aefd1119972de613f4821581e6745c248">ENCODE_IFNOT</a>(<a class="code" href="_c_p_menu_item_8j.html#a2bff3dc64176e04ec28455f88fac81e1">CPMenuItemViewKey</a>, _view, nil);
<a name="l00931"></a>00931 }
<a name="l00932"></a>00932 
<a name="l00933"></a>00933 <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_menu_item_8j_source.html by HTTrack Website Copier/3.x [XR&CO'2006], Mon, 20 Sep 2010 02:19:30 GMT -->
</html>