Source

cappuccino-docs / cappuccino docs / cappuccino.org / learn / documentation / _c_p_segmented_control_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
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
<!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_segmented_control_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/CPSegmentedControl.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/CPSegmentedControl.j</h1><a href="_c_p_segmented_control_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"> * CPSegmentedControl.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_array.html" title="A mutable array backed by a JavaScript Array.A mutable array class backed by a JavaScript...">CPArray</a>.j&gt;
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 @<span class="keyword">import</span> <span class="stringliteral">&quot;CPControl.j&quot;</span>
<a name="l00026"></a>00026 
<a name="l00027"></a>00027 <span class="preprocessor">#include &quot;<a class="code" href="_c_g_geometry_8h.html">CoreGraphics/CGGeometry.h</a>&quot;</span>
<a name="l00028"></a>00028 
<a name="l00029"></a><a class="code" href="_c_p_segmented_control_8j.html#a23ffc231fb17626a0e9bc6d251e4d2c8">00029</a> <a class="code" href="_c_p_segmented_control_8j.html#a23ffc231fb17626a0e9bc6d251e4d2c8">CPSegmentSwitchTrackingSelectOne</a> = 0;
<a name="l00030"></a><a class="code" href="_c_p_segmented_control_8j.html#af784a543c960a8ffc4c6e4cc7edade16">00030</a> <a class="code" href="_c_p_segmented_control_8j.html#af784a543c960a8ffc4c6e4cc7edade16">CPSegmentSwitchTrackingSelectAny</a> = 1;
<a name="l00031"></a><a class="code" href="_c_p_segmented_control_8j.html#a2ec1bc17beb8c74301e1909e6ed96a76">00031</a> <a class="code" href="_c_p_segmented_control_8j.html#a2ec1bc17beb8c74301e1909e6ed96a76">CPSegmentSwitchTrackingMomentary</a> = 2;
<a name="l00032"></a>00032 
<a name="l00039"></a><a class="code" href="class_c_p_segmented_control.html">00039</a> <span class="keyword">@implementation </span><a class="code" href="class_c_p_segmented_control.html">CPSegmentedControl</a> : <a class="code" href="class_c_p_control.html">CPControl</a>
<a name="l00040"></a>00040 {
<a name="l00041"></a>00041     <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>                 _segments;
<a name="l00042"></a>00042     <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>                 _themeStates;
<a name="l00043"></a>00043 
<a name="l00044"></a>00044     <span class="keywordtype">int</span>                     _selectedSegment;
<a name="l00045"></a>00045     <span class="keywordtype">int</span>                     _segmentStyle;
<a name="l00046"></a>00046     CPSegmentSwitchTracking _trackingMode;
<a name="l00047"></a>00047 
<a name="l00048"></a>00048     <span class="keywordtype">unsigned</span>                _trackingSegment;
<a name="l00049"></a>00049     BOOL                    _trackingHighlighted;
<a name="l00050"></a>00050 }
<a name="l00051"></a>00051 
<a name="l00052"></a><a class="code" href="class_c_p_segmented_control.html#a27c2cc20917ad93802000e36f7b4bd6c">00052</a> + (<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)themeClass
<a name="l00053"></a>00053 {
<a name="l00054"></a>00054     <span class="keywordflow">return</span> <span class="stringliteral">&quot;segmented-control&quot;</span>;
<a name="l00055"></a>00055 }
<a name="l00056"></a>00056 
<a name="l00057"></a><a class="code" href="class_c_p_segmented_control.html#afdfd4fc8d260b7cc75c3e496a8e9c234">00057</a> + (id)themeAttributes
<a name="l00058"></a>00058 {
<a name="l00059"></a>00059     <span class="keywordflow">return</span> [<a class="code" href="class_c_p_dictionary.html" title="A mutable key-value pair collection.">CPDictionary</a> <a class="code" href="class_c_p_dictionary.html#ac4d7617692c892eaed4d00de281c4c83">dictionaryWithObjects</a>:[CPCenterTextAlignment, CPCenterVerticalTextAlignment, CPImageLeft, CPScaleNone, _CGInsetMakeZero(), _CGInsetMakeZero(), [<a class="code" href="class_c_p_null.html" title="An object representation of nil.">CPNull</a> null], [<a class="code" href="class_c_p_null.html" title="An object representation of nil.">CPNull</a> null], [<a class="code" href="class_c_p_null.html" title="An object representation of nil.">CPNull</a> null], [<a class="code" href="class_c_p_null.html" title="An object representation of nil.">CPNull</a> null], 1.0, 24.0]
<a name="l00060"></a>00060                                        <a class="code" href="class_c_p_dictionary.html#ac4d7617692c892eaed4d00de281c4c83">forKeys</a>:[@&quot;alignment&quot;, @&quot;vertical-alignment&quot;, @&quot;image-position&quot;, @&quot;image-scaling&quot;, @&quot;bezel-inset&quot;, @&quot;content-inset&quot;, @&quot;left-segment-bezel-color&quot;, @&quot;right-segment-bezel-color&quot;, @&quot;center-segment-bezel-color&quot;, @&quot;divider-bezel-color&quot;, @&quot;divider-thickness&quot;, @&quot;default-height&quot;]];
<a name="l00061"></a>00061 }
<a name="l00062"></a>00062 
<a name="l00063"></a><a class="code" href="class_c_p_segmented_control.html#a406c5f143a569ff4b6c9a6cbbfb72b52">00063</a> - (id)initWithFrame:(CGRect)aRect
<a name="l00064"></a>00064 {
<a name="l00065"></a>00065     _segments = [];
<a name="l00066"></a>00066     _themeStates = [];
<a name="l00067"></a>00067     
<a name="l00068"></a>00068     <span class="keyword">self</span> = [<span class="keyword">super</span> initWithFrame:aRect];
<a name="l00069"></a>00069     
<a name="l00070"></a>00070     <span class="keywordflow">if</span> (<span class="keyword">self</span>)
<a name="l00071"></a>00071     {
<a name="l00072"></a>00072         _selectedSegment = -1;
<a name="l00073"></a>00073         
<a name="l00074"></a>00074         _trackingMode = <a class="code" href="_c_p_segmented_control_8j.html#a23ffc231fb17626a0e9bc6d251e4d2c8">CPSegmentSwitchTrackingSelectOne</a>;
<a name="l00075"></a>00075     }
<a name="l00076"></a>00076     
<a name="l00077"></a>00077     <span class="keywordflow">return</span> <span class="keyword">self</span>;
<a name="l00078"></a>00078 }
<a name="l00079"></a>00079 
<a name="l00083"></a><a class="code" href="class_c_p_segmented_control.html#ab9e669e5c7147273990ad249bdee5055">00083</a> - (int)selectedTag
<a name="l00084"></a>00084 {
<a name="l00085"></a>00085     <span class="keywordflow">return</span> _segments[_selectedSegment].tag;
<a name="l00086"></a>00086 }
<a name="l00087"></a>00087 
<a name="l00088"></a>00088 <span class="comment">// Specifying the number of segments</span>
<a name="l00093"></a><a class="code" href="class_c_p_segmented_control.html#a140d1dcc2efecca214fe826373f76eed">00093</a> <span class="comment"></span>- (void)setSegmentCount:(<span class="keywordtype">unsigned</span>)aCount
<a name="l00094"></a>00094 {
<a name="l00095"></a>00095     <span class="keywordflow">if</span> (_segments.length == aCount)
<a name="l00096"></a>00096         <span class="keywordflow">return</span>;
<a name="l00097"></a>00097         
<a name="l00098"></a>00098     var <a class="code" href="_c_p_screen_8j.html#a4540395d130d8a367becfe06b659b9f1">height</a> = <a class="code" href="_c_g_geometry_8j.html#a09d2072d60c7f39b04a41705d640fa98">CGRectGetHeight</a>([<span class="keyword">self</span> bounds]);
<a name="l00099"></a>00099     
<a name="l00100"></a>00100     <span class="keywordflow">if</span> (_segments.length &lt; aCount)
<a name="l00101"></a>00101     {        
<a name="l00102"></a>00102         <span class="keywordflow">for</span> (var index = _segments.length; index &lt; aCount; ++index)
<a name="l00103"></a>00103         {
<a name="l00104"></a>00104             _segments[index] = [[_CPSegmentItem alloc] init];
<a name="l00105"></a>00105             _themeStates[index] = <a class="code" href="_c_p_theme_8j.html#ab0279bc774339d787f47dbc6f88b1fe5">CPThemeStateNormal</a>;
<a name="l00106"></a>00106         }
<a name="l00107"></a>00107     }
<a name="l00108"></a>00108     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (aCount &lt; _segments.length)
<a name="l00109"></a>00109     {
<a name="l00110"></a>00110         _segments.length = aCount;
<a name="l00111"></a>00111         _themeStates.length = aCount;
<a name="l00112"></a>00112     }
<a name="l00113"></a>00113 
<a name="l00114"></a>00114     <span class="keywordflow">if</span> (_selectedSegment &gt;= _segments.length)
<a name="l00115"></a>00115         _selectedSegment = -1;
<a name="l00116"></a>00116 
<a name="l00117"></a>00117     [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#a3bac51f2b56ac303d95b4f46c96b6d38">tileWithChangedSegment</a>:0];
<a name="l00118"></a>00118 }
<a name="l00119"></a>00119 
<a name="l00123"></a><a class="code" href="class_c_p_segmented_control.html#ad242ea13beeb99725fe7de4915d53d5e">00123</a> - (unsigned)segmentCount
<a name="l00124"></a>00124 {
<a name="l00125"></a>00125     <span class="keywordflow">return</span> _segments.length;
<a name="l00126"></a>00126 }
<a name="l00127"></a>00127 
<a name="l00128"></a>00128 <span class="comment">// Specifying Selected Segment</span>
<a name="l00134"></a><a class="code" href="class_c_p_segmented_control.html#ac90d78aae2772c92f8310f19a0fa024c">00134</a> <span class="comment"></span>- (void)setSelectedSegment:(<span class="keywordtype">unsigned</span>)aSegment
<a name="l00135"></a>00135 {
<a name="l00136"></a>00136     <span class="comment">// setSelected:forSegment throws the exception for us (if necessary)</span>
<a name="l00137"></a>00137     [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#a785f4c1d6bca8a859a264e581d1917ab">setSelected</a>:YES <a class="code" href="class_c_p_segmented_control.html#a785f4c1d6bca8a859a264e581d1917ab">forSegment</a>:aSegment];
<a name="l00138"></a>00138 }
<a name="l00139"></a>00139 
<a name="l00143"></a><a class="code" href="class_c_p_segmented_control.html#a069222aec309af130975960ef71043b7">00143</a> - (unsigned)selectedSegment
<a name="l00144"></a>00144 {
<a name="l00145"></a>00145     <span class="keywordflow">return</span> _selectedSegment;
<a name="l00146"></a>00146 }
<a name="l00147"></a>00147 
<a name="l00151"></a><a class="code" href="class_c_p_segmented_control.html#a1d364e81d7333ea9306ed53b03fe9b41">00151</a> - (BOOL)selectSegmentWithTag:(<span class="keywordtype">int</span>)aTag
<a name="l00152"></a>00152 {
<a name="l00153"></a>00153     var index = 0;
<a name="l00154"></a>00154     
<a name="l00155"></a>00155     <span class="keywordflow">for</span> (; index &lt; _segments.length; ++index)
<a name="l00156"></a>00156         <span class="keywordflow">if</span> (_segments[index].<a class="code" href="_c_p_segmented_control_8j.html#aab34f2fc02b4a86bea93c68e1ec09d75">tag</a> == aTag)
<a name="l00157"></a>00157         {
<a name="l00158"></a>00158             [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#ac90d78aae2772c92f8310f19a0fa024c">setSelectedSegment</a>:index];
<a name="l00159"></a>00159             
<a name="l00160"></a>00160             <span class="keywordflow">return</span> YES;
<a name="l00161"></a>00161         }
<a name="l00162"></a>00162     
<a name="l00163"></a>00163     <span class="keywordflow">return</span> NO;
<a name="l00164"></a>00164 }
<a name="l00165"></a>00165 
<a name="l00166"></a>00166 <span class="comment">// Specifying Tracking Mode</span>
<a name="l00167"></a>00167 
<a name="l00168"></a><a class="code" href="class_c_p_segmented_control.html#a4ba0105cebd586c6783fddd7bb0d2f77">00168</a> - (BOOL)isTracking
<a name="l00169"></a>00169 {
<a name="l00170"></a>00170 
<a name="l00171"></a>00171 }
<a name="l00172"></a>00172 
<a name="l00173"></a><a class="code" href="class_c_p_segmented_control.html#acc55c7cdda0dc95c3fd03dd41984e4de">00173</a> - (void)setTrackingMode:(CPSegmentSwitchTracking)aTrackingMode
<a name="l00174"></a>00174 {
<a name="l00175"></a>00175     <span class="keywordflow">if</span> (_trackingMode == aTrackingMode)
<a name="l00176"></a>00176         <span class="keywordflow">return</span>;
<a name="l00177"></a>00177         
<a name="l00178"></a>00178     _trackingMode = aTrackingMode;
<a name="l00179"></a>00179     
<a name="l00180"></a>00180     <span class="keywordflow">if</span> (_trackingMode == <a class="code" href="_c_p_segmented_control_8j.html#a23ffc231fb17626a0e9bc6d251e4d2c8">CPSegmentSwitchTrackingSelectOne</a>)
<a name="l00181"></a>00181     {
<a name="l00182"></a>00182         var index = 0,
<a name="l00183"></a>00183             <a class="code" href="_c_p_segmented_control_8j.html#a92bcc5950aec22fe5f1a17286cb299e5">selected</a> = NO;
<a name="l00184"></a>00184         
<a name="l00185"></a>00185         <span class="keywordflow">for</span> (; index &lt; _segments.length; ++index)
<a name="l00186"></a>00186             <span class="keywordflow">if</span> (_segments[index].<a class="code" href="_c_p_segmented_control_8j.html#a92bcc5950aec22fe5f1a17286cb299e5">selected</a>)
<a name="l00187"></a>00187                 <span class="keywordflow">if</span> (selected)
<a name="l00188"></a>00188                     [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#a785f4c1d6bca8a859a264e581d1917ab">setSelected</a>:NO <a class="code" href="class_c_p_segmented_control.html#a785f4c1d6bca8a859a264e581d1917ab">forSegment</a>:index];
<a name="l00189"></a>00189                 <span class="keywordflow">else</span>
<a name="l00190"></a>00190                     selected = YES;
<a name="l00191"></a>00191     }
<a name="l00192"></a>00192     
<a name="l00193"></a>00193     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (_trackingMode == <a class="code" href="_c_p_segmented_control_8j.html#a2ec1bc17beb8c74301e1909e6ed96a76">CPSegmentSwitchTrackingMomentary</a>)
<a name="l00194"></a>00194     {
<a name="l00195"></a>00195         var index = 0;
<a name="l00196"></a>00196         
<a name="l00197"></a>00197         <span class="keywordflow">for</span> (; index &lt; _segments.length; ++index)
<a name="l00198"></a>00198             <span class="keywordflow">if</span> (_segments[index].<a class="code" href="_c_p_segmented_control_8j.html#a92bcc5950aec22fe5f1a17286cb299e5">selected</a>)
<a name="l00199"></a>00199                 [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#a785f4c1d6bca8a859a264e581d1917ab">setSelected</a>:NO <a class="code" href="class_c_p_segmented_control.html#a785f4c1d6bca8a859a264e581d1917ab">forSegment</a>:index];
<a name="l00200"></a>00200     }
<a name="l00201"></a>00201 }
<a name="l00202"></a>00202 
<a name="l00206"></a><a class="code" href="class_c_p_segmented_control.html#a0a0e235f20cbfd3198cf42788cf9f575">00206</a> - (CPSegmentSwitchTracking)trackingMode
<a name="l00207"></a>00207 {
<a name="l00208"></a>00208     <span class="keywordflow">return</span> _trackingMode;
<a name="l00209"></a>00209 }
<a name="l00210"></a>00210 
<a name="l00211"></a>00211 <span class="comment">// Working with Individual Segments</span>
<a name="l00218"></a><a class="code" href="class_c_p_segmented_control.html#a76ac88c0054f7bd69b8b2763f2b85b6e">00218</a> <span class="comment"></span>- (void)setWidth:(<span class="keywordtype">float</span>)aWidth forSegment:(<span class="keywordtype">unsigned</span>)aSegment
<a name="l00219"></a>00219 {
<a name="l00220"></a>00220     _segments[aSegment].width = aWidth;
<a name="l00221"></a>00221     
<a name="l00222"></a>00222     [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#a3bac51f2b56ac303d95b4f46c96b6d38">tileWithChangedSegment</a>:aSegment];
<a name="l00223"></a>00223 }
<a name="l00224"></a>00224 
<a name="l00230"></a><a class="code" href="class_c_p_segmented_control.html#afd91f72b83994665cabb0e6de985b6b6">00230</a> - (float)widthForSegment:(<span class="keywordtype">unsigned</span>)aSegment
<a name="l00231"></a>00231 {
<a name="l00232"></a>00232     <span class="keywordflow">return</span> _segments[aSegment].width;
<a name="l00233"></a>00233 }
<a name="l00234"></a>00234 
<a name="l00241"></a><a class="code" href="class_c_p_segmented_control.html#a7f5a31dd437d71b321033724a4179043">00241</a> - (void)setImage:(<a class="code" href="class_c_p_image.html">CPImage</a>)anImage forSegment:(<span class="keywordtype">unsigned</span>)aSegment
<a name="l00242"></a>00242 {
<a name="l00243"></a>00243     var segment = _segments[aSegment];
<a name="l00244"></a>00244     
<a name="l00245"></a>00245     segment.image = anImage;
<a name="l00246"></a>00246 
<a name="l00247"></a>00247     [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#a3bac51f2b56ac303d95b4f46c96b6d38">tileWithChangedSegment</a>:aSegment];
<a name="l00248"></a>00248 }
<a name="l00249"></a>00249 
<a name="l00255"></a><a class="code" href="class_c_p_segmented_control.html#a45baf7aaee8c44a890a69b6301f20a8c">00255</a> - (<a class="code" href="class_c_p_image.html">CPImage</a>)imageForSegment:(<span class="keywordtype">unsigned</span>)aSegment
<a name="l00256"></a>00256 {
<a name="l00257"></a>00257     <span class="keywordflow">return</span> _segments[aSegment].image;
<a name="l00258"></a>00258 }
<a name="l00259"></a>00259 
<a name="l00266"></a><a class="code" href="class_c_p_segmented_control.html#a8f5e796894a04ec0170667aeb4969d26">00266</a> - (void)setLabel:(<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)aLabel forSegment:(<span class="keywordtype">unsigned</span>)aSegment
<a name="l00267"></a>00267 {
<a name="l00268"></a>00268     var segment = _segments[aSegment];
<a name="l00269"></a>00269         
<a name="l00270"></a>00270     _segments[aSegment].label = aLabel;
<a name="l00271"></a>00271     
<a name="l00272"></a>00272     [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#a3bac51f2b56ac303d95b4f46c96b6d38">tileWithChangedSegment</a>:aSegment];
<a name="l00273"></a>00273 }
<a name="l00274"></a>00274 
<a name="l00280"></a><a class="code" href="class_c_p_segmented_control.html#a86aa140e35f4f49a2540b7686104bcd5">00280</a> - (<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)labelForSegment:(<span class="keywordtype">unsigned</span>)aSegment
<a name="l00281"></a>00281 {
<a name="l00282"></a>00282     <span class="keywordflow">return</span> _segments[aSegment].label;
<a name="l00283"></a>00283 }
<a name="l00284"></a>00284 
<a name="l00291"></a><a class="code" href="class_c_p_segmented_control.html#aa343e2e8ecdcd55cf82f2ffea470fd21">00291</a> - (void)setMenu:(<a class="code" href="class_c_p_menu.html">CPMenu</a>)aMenu forSegment:(<span class="keywordtype">unsigned</span>)aSegment
<a name="l00292"></a>00292 {
<a name="l00293"></a>00293     _segments[aSegment].menu = aMenu;
<a name="l00294"></a>00294 }
<a name="l00295"></a>00295 
<a name="l00301"></a><a class="code" href="class_c_p_segmented_control.html#a8dab4e223fb99a66a01f962fad4689c6">00301</a> - (<a class="code" href="class_c_p_menu.html">CPMenu</a>)menuForSegment:(<span class="keywordtype">unsigned</span>)aSegment
<a name="l00302"></a>00302 {
<a name="l00303"></a>00303     <span class="keywordflow">return</span> _segments[aSegment].menu;
<a name="l00304"></a>00304 }
<a name="l00305"></a>00305 
<a name="l00313"></a><a class="code" href="class_c_p_segmented_control.html#a785f4c1d6bca8a859a264e581d1917ab">00313</a> - (void)setSelected:(BOOL)isSelected forSegment:(<span class="keywordtype">unsigned</span>)aSegment
<a name="l00314"></a>00314 {
<a name="l00315"></a>00315     var segment = _segments[aSegment];
<a name="l00316"></a>00316     
<a name="l00317"></a>00317     <span class="comment">// If we&apos;re already in this state, bail.</span>
<a name="l00318"></a>00318     <span class="keywordflow">if</span> (segment.selected == isSelected)
<a name="l00319"></a>00319         <span class="keywordflow">return</span>;
<a name="l00320"></a>00320     
<a name="l00321"></a>00321     segment.selected = isSelected;
<a name="l00322"></a>00322 
<a name="l00323"></a>00323     _themeStates[aSegment] = isSelected ? <a class="code" href="_c_p_theme_8j.html#a059cc2a1cde640d33389dbf102dd9ed8">CPThemeStateSelected</a> : <a class="code" href="_c_p_theme_8j.html#ab0279bc774339d787f47dbc6f88b1fe5">CPThemeStateNormal</a>;
<a name="l00324"></a>00324 
<a name="l00325"></a>00325     <span class="comment">// We need to do some cleanup if we only allow one selection.</span>
<a name="l00326"></a>00326     <span class="keywordflow">if</span> (isSelected)
<a name="l00327"></a>00327     {
<a name="l00328"></a>00328         var oldSelectedSegment = _selectedSegment;
<a name="l00329"></a>00329         
<a name="l00330"></a>00330         _selectedSegment = aSegment;
<a name="l00331"></a>00331         
<a name="l00332"></a>00332         <span class="keywordflow">if</span> (_trackingMode == <a class="code" href="_c_p_segmented_control_8j.html#a23ffc231fb17626a0e9bc6d251e4d2c8">CPSegmentSwitchTrackingSelectOne</a> &amp;&amp; oldSelectedSegment != aSegment &amp;&amp; oldSelectedSegment != -1)
<a name="l00333"></a>00333         {
<a name="l00334"></a>00334             _segments[oldSelectedSegment].selected = NO;
<a name="l00335"></a>00335             _themeStates[oldSelectedSegment] = <a class="code" href="_c_p_theme_8j.html#ab0279bc774339d787f47dbc6f88b1fe5">CPThemeStateNormal</a>;
<a name="l00336"></a>00336 
<a name="l00337"></a>00337             [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#a2f6706f025c3ed29f41a3f23b54902b4">drawSegmentBezel</a>:oldSelectedSegment <a class="code" href="class_c_p_segmented_control.html#a2f6706f025c3ed29f41a3f23b54902b4">highlight</a>:NO];
<a name="l00338"></a>00338         }
<a name="l00339"></a>00339     }
<a name="l00340"></a>00340     
<a name="l00341"></a>00341     <span class="keywordflow">if</span> (_trackingMode != <a class="code" href="_c_p_segmented_control_8j.html#a2ec1bc17beb8c74301e1909e6ed96a76">CPSegmentSwitchTrackingMomentary</a>)
<a name="l00342"></a>00342         [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#a2f6706f025c3ed29f41a3f23b54902b4">drawSegmentBezel</a>:aSegment <a class="code" href="class_c_p_segmented_control.html#a2f6706f025c3ed29f41a3f23b54902b4">highlight</a>:NO];
<a name="l00343"></a>00343 
<a name="l00344"></a>00344     [<span class="keyword">self</span> setNeedsLayout];
<a name="l00345"></a>00345     [<span class="keyword">self</span> setNeedsDisplay:YES];
<a name="l00346"></a>00346 }
<a name="l00347"></a>00347 
<a name="l00353"></a><a class="code" href="class_c_p_segmented_control.html#a4022d6f091d0888fe16d01e884480c5a">00353</a> - (BOOL)isSelectedForSegment:(<span class="keywordtype">unsigned</span>)aSegment
<a name="l00354"></a>00354 {
<a name="l00355"></a>00355     <span class="keywordflow">return</span> _segments[aSegment].selected;
<a name="l00356"></a>00356 }
<a name="l00357"></a>00357 
<a name="l00364"></a><a class="code" href="class_c_p_segmented_control.html#aee4a1d708ddaa0a2ecb8e3585b6d98dd">00364</a> - (void)setEnabled:(BOOL)isEnabled forSegment:(<span class="keywordtype">unsigned</span>)aSegment
<a name="l00365"></a>00365 {
<a name="l00366"></a>00366     <span class="keywordflow">if</span> (isEnabled)
<a name="l00367"></a>00367         _themeStates[aSegment] &amp;= ~<a class="code" href="_c_p_theme_8j.html#a0380ae0a1c5452ceab37dcdf5beaa0e0">CPThemeStateDisabled</a>;
<a name="l00368"></a>00368     <span class="keywordflow">else</span>
<a name="l00369"></a>00369         _themeStates[aSegment] |= <a class="code" href="_c_p_theme_8j.html#a0380ae0a1c5452ceab37dcdf5beaa0e0">CPThemeStateDisabled</a>;
<a name="l00370"></a>00370 
<a name="l00371"></a>00371     [<span class="keyword">self</span> setNeedsLayout];
<a name="l00372"></a>00372     [<span class="keyword">self</span> setNeedsDisplay:YES];
<a name="l00373"></a>00373 }
<a name="l00374"></a>00374 
<a name="l00380"></a><a class="code" href="class_c_p_segmented_control.html#a6417d8421b54b5a85d808c361d2233a5">00380</a> - (BOOL)isEnabledForSegment:(<span class="keywordtype">unsigned</span>)aSegment
<a name="l00381"></a>00381 {
<a name="l00382"></a>00382     <span class="keywordflow">return</span> !(_themeStates[aSegment] &amp; <a class="code" href="_c_p_theme_8j.html#a0380ae0a1c5452ceab37dcdf5beaa0e0">CPThemeStateDisabled</a>)
<a name="l00383"></a>00383 }
<a name="l00384"></a>00384 
<a name="l00390"></a><a class="code" href="class_c_p_segmented_control.html#a934af79aeb50a6daaccea57197279eca">00390</a> - (<span class="keywordtype">void</span>)setTag:(int)aTag forSegment:(<span class="keywordtype">unsigned</span>)aSegment
<a name="l00391"></a>00391 {
<a name="l00392"></a>00392     _segments[aSegment].tag = aTag;
<a name="l00393"></a>00393 }
<a name="l00394"></a>00394 
<a name="l00399"></a><a class="code" href="class_c_p_segmented_control.html#a33dd9294b9ed5ccbbcdd9c87b0367121">00399</a> - (int)tagForSegment:(<span class="keywordtype">unsigned</span>)aSegment
<a name="l00400"></a>00400 {
<a name="l00401"></a>00401     <span class="keywordflow">return</span> _segments[aSegment].tag;
<a name="l00402"></a>00402 }
<a name="l00403"></a>00403 
<a name="l00404"></a>00404 <span class="comment">// Drawings</span>
<a name="l00410"></a><a class="code" href="class_c_p_segmented_control.html#a2f6706f025c3ed29f41a3f23b54902b4">00410</a> <span class="comment"></span>- (void)drawSegmentBezel:(<span class="keywordtype">int</span>)aSegment highlight:(BOOL)shouldHighlight
<a name="l00411"></a>00411 {
<a name="l00412"></a>00412     <span class="keywordflow">if</span> (shouldHighlight)
<a name="l00413"></a>00413         _themeStates[aSegment] |= <a class="code" href="_c_p_theme_8j.html#aa68f7cdbec02d10022cccba055493bec">CPThemeStateHighlighted</a>;
<a name="l00414"></a>00414     <span class="keywordflow">else</span>
<a name="l00415"></a>00415         _themeStates[aSegment] &amp;= ~<a class="code" href="_c_p_theme_8j.html#aa68f7cdbec02d10022cccba055493bec">CPThemeStateHighlighted</a>;
<a name="l00416"></a>00416 
<a name="l00417"></a>00417     [<span class="keyword">self</span> setNeedsLayout];
<a name="l00418"></a>00418     [<span class="keyword">self</span> setNeedsDisplay:YES];
<a name="l00419"></a>00419 }
<a name="l00420"></a>00420 
<a name="l00421"></a>00421 - (float)_leftOffsetForSegment:(<span class="keywordtype">unsigned</span>)segment
<a name="l00422"></a>00422 {
<a name="l00423"></a>00423     var bezelInset = [<span class="keyword">self</span> currentValueForThemeAttribute:@&quot;bezel-inset&quot;];
<a name="l00424"></a>00424 
<a name="l00425"></a>00425     <span class="keywordflow">if</span> (segment == 0)
<a name="l00426"></a>00426         <span class="keywordflow">return</span> bezelInset.left;
<a name="l00427"></a>00427 
<a name="l00428"></a>00428     var thickness = [<span class="keyword">self</span> currentValueForThemeAttribute:@&quot;divider-thickness&quot;];
<a name="l00429"></a>00429 
<a name="l00430"></a>00430     <span class="keywordflow">return</span> [<span class="keyword">self</span> _leftOffsetForSegment:segment - 1] + [<a class="code" href="_c_p_button_bar_8j.html#a57945218a0d2fdfc4a2d4fa646901ef1">self</a> widthForSegment:segment - 1] + thickness;
<a name="l00431"></a>00431 }
<a name="l00432"></a>00432 
<a name="l00433"></a>00433 - (unsigned)_indexOfLastSegment
<a name="l00434"></a>00434 {
<a name="l00435"></a>00435     var lastSegmentIndex = [_segments count] - 1;
<a name="l00436"></a>00436 
<a name="l00437"></a>00437     <span class="keywordflow">if</span> (lastSegmentIndex &lt; 0)
<a name="l00438"></a>00438         lastSegmentIndex = 0;
<a name="l00439"></a>00439 
<a name="l00440"></a>00440     <span class="keywordflow">return</span> lastSegmentIndex;
<a name="l00441"></a>00441 }
<a name="l00442"></a>00442 
<a name="l00443"></a><a class="code" href="class_c_p_segmented_control.html#a0e6cde43e91f511f5acb865ff76f1933">00443</a> - (CGRect)rectForEphemeralSubviewNamed:(<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)aName
<a name="l00444"></a>00444 {
<a name="l00445"></a>00445     var <a class="code" href="_c_p_screen_8j.html#a4540395d130d8a367becfe06b659b9f1">height</a> = [<span class="keyword">self</span> currentValueForThemeAttribute:@&quot;default-height&quot;],
<a name="l00446"></a>00446         contentInset = [<span class="keyword">self</span> currentValueForThemeAttribute:@&quot;content-inset&quot;],
<a name="l00447"></a>00447         bezelInset = [<span class="keyword">self</span> currentValueForThemeAttribute:@&quot;bezel-inset&quot;],
<a name="l00448"></a>00448         bounds = [<span class="keyword">self</span> bounds];
<a name="l00449"></a>00449 
<a name="l00450"></a>00450     <span class="keywordflow">if</span> (aName === <span class="stringliteral">&quot;left-segment-bezel&quot;</span>)
<a name="l00451"></a>00451     {
<a name="l00452"></a>00452         <span class="keywordflow">return</span> <a class="code" href="_c_g_geometry_8j.html#aca150c0049e24797c6271bad7bc90610">CGRectMake</a>(bezelInset.left, bezelInset.top, contentInset.left, <a class="code" href="_c_p_screen_8j.html#a4540395d130d8a367becfe06b659b9f1">height</a>);
<a name="l00453"></a>00453     }
<a name="l00454"></a>00454     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (aName === <span class="stringliteral">&quot;right-segment-bezel&quot;</span>)
<a name="l00455"></a>00455     {
<a name="l00456"></a>00456         <span class="keywordflow">return</span> <a class="code" href="group__appkit.html#ga14b3a32dc5a4198a67fd5cfd8c69bed5">CPRectMake</a>(<a class="code" href="_c_g_geometry_8j.html#aa310af239f2108c573299b35776996fa">CGRectGetWidth</a>([<span class="keyword">self</span> bounds]) - contentInset.right,
<a name="l00457"></a>00457                             bezelInset.top,
<a name="l00458"></a>00458                             contentInset.right,
<a name="l00459"></a>00459                             <a class="code" href="_c_p_screen_8j.html#a4540395d130d8a367becfe06b659b9f1">height</a>);
<a name="l00460"></a>00460     }
<a name="l00461"></a>00461     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (aName.indexOf(<span class="stringliteral">&quot;segment-bezel&quot;</span>) === 0)
<a name="l00462"></a>00462     {
<a name="l00463"></a>00463         var segment = parseInt(aName.substring(<span class="stringliteral">&quot;segment-bezel-&quot;</span>.length), 10),
<a name="l00464"></a>00464             <a class="code" href="_c_p_segmented_control_8j.html#a63fcc9e0dd97e8502cce685e88234e16">frame</a> = <a class="code" href="_c_g_geometry_8j.html#ae62f9f5339c89eeddc9eaad1386a1566">CGRectCreateCopy</a>(_segments[segment].<a class="code" href="_c_p_segmented_control_8j.html#a63fcc9e0dd97e8502cce685e88234e16">frame</a>);
<a name="l00465"></a>00465 
<a name="l00466"></a>00466         <span class="keywordflow">if</span> (segment === 0)
<a name="l00467"></a>00467         {
<a name="l00468"></a>00468             frame.origin.x += contentInset.left;
<a name="l00469"></a>00469             frame.size.width -= contentInset.left;
<a name="l00470"></a>00470         }
<a name="l00471"></a>00471 
<a name="l00472"></a>00472         <span class="keywordflow">if</span> (segment === _segments.length - 1)
<a name="l00473"></a>00473             frame.size.width = <a class="code" href="_c_g_geometry_8j.html#aa310af239f2108c573299b35776996fa">CGRectGetWidth</a>([<span class="keyword">self</span> bounds]) - contentInset.right - frame.origin.x;
<a name="l00474"></a>00474 
<a name="l00475"></a>00475         <span class="keywordflow">return</span> frame;
<a name="l00476"></a>00476     }
<a name="l00477"></a>00477     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (aName.indexOf(<span class="stringliteral">&quot;divider-bezel&quot;</span>) === 0)
<a name="l00478"></a>00478     {
<a name="l00479"></a>00479         var segment = parseInt(aName.substring(<span class="stringliteral">&quot;divider-bezel-&quot;</span>.length), 10),
<a name="l00480"></a>00480             <a class="code" href="_c_p_segmented_control_8j.html#a2474a5474cbff19523a51eb1de01cda4">width</a> = [<span class="keyword">self</span> widthForSegment:segment],
<a name="l00481"></a>00481             left = [<span class="keyword">self</span> _leftOffsetForSegment:segment],
<a name="l00482"></a>00482             thickness = [<span class="keyword">self</span> currentValueForThemeAttribute:<span class="stringliteral">@&quot;divider-thickness&quot;</span>];
<a name="l00483"></a>00483 
<a name="l00484"></a>00484         <span class="keywordflow">return</span> <a class="code" href="_c_g_geometry_8j.html#aca150c0049e24797c6271bad7bc90610">CGRectMake</a>(left + <a class="code" href="_c_p_segmented_control_8j.html#a2474a5474cbff19523a51eb1de01cda4">width</a>, bezelInset.top, thickness, <a class="code" href="_c_p_screen_8j.html#a4540395d130d8a367becfe06b659b9f1">height</a>);
<a name="l00485"></a>00485     }
<a name="l00486"></a>00486     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (aName.indexOf(<span class="stringliteral">&quot;segment-content&quot;</span>) === 0)
<a name="l00487"></a>00487     {
<a name="l00488"></a>00488         var segment = parseInt(aName.substring(<span class="stringliteral">&quot;segment-content-&quot;</span>.length), 10);
<a name="l00489"></a>00489 
<a name="l00490"></a>00490         <span class="keywordflow">return</span> [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#adb57ca986be1404f737faf8f3107c5c1">contentFrameForSegment</a>:segment];
<a name="l00491"></a>00491     }
<a name="l00492"></a>00492 
<a name="l00493"></a>00493     <span class="keywordflow">return</span> [<span class="keyword">super</span> rectForEphemeralSubviewNamed:aName];
<a name="l00494"></a>00494 }
<a name="l00495"></a>00495 
<a name="l00496"></a><a class="code" href="class_c_p_segmented_control.html#aeded3a44b95646c3251deb4b833a4703">00496</a> - (<a class="code" href="class_c_p_view.html">CPView</a>)createEphemeralSubviewNamed:(<a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>)aName
<a name="l00497"></a>00497 {
<a name="l00498"></a>00498     <span class="keywordflow">if</span> (aName.substring(0, <span class="stringliteral">&quot;segment-content&quot;</span>.length) == <span class="stringliteral">&quot;segment-content&quot;</span>)
<a name="l00499"></a>00499         <span class="keywordflow">return</span> [[_CPImageAndTextView alloc] initWithFrame:_CGRectMakeZero()];
<a name="l00500"></a>00500 
<a name="l00501"></a>00501     <span class="keywordflow">return</span> [[<a class="code" href="class_c_p_view.html">CPView</a> alloc] initWithFrame:_CGRectMakeZero()];
<a name="l00502"></a>00502 }
<a name="l00503"></a>00503 
<a name="l00504"></a><a class="code" href="class_c_p_segmented_control.html#aa4264ca73d2d664d4f7a5e77e71478d9">00504</a> - (void)layoutSubviews
<a name="l00505"></a>00505 {
<a name="l00506"></a>00506     <span class="keywordflow">if</span> (_segments.length &lt;= 0)
<a name="l00507"></a>00507         <span class="keywordflow">return</span>;
<a name="l00508"></a>00508 
<a name="l00509"></a>00509     var themeState = _themeStates[0];
<a name="l00510"></a>00510 
<a name="l00511"></a>00511     themeState |= _themeState &amp; <a class="code" href="_c_p_theme_8j.html#a0380ae0a1c5452ceab37dcdf5beaa0e0">CPThemeStateDisabled</a>;
<a name="l00512"></a>00512 
<a name="l00513"></a>00513     var leftCapColor = [<span class="keyword">self</span> valueForThemeAttribute:@&quot;left-segment-bezel-color&quot; 
<a name="l00514"></a>00514                                             inState:themeState];
<a name="l00515"></a>00515 
<a name="l00516"></a>00516     var leftBezelView = [<span class="keyword">self</span> layoutEphemeralSubviewNamed:@&quot;left-segment-bezel&quot;
<a name="l00517"></a>00517                                                positioned:CPWindowBelow
<a name="l00518"></a>00518                           relativeToEphemeralSubviewNamed:nil];
<a name="l00519"></a>00519 
<a name="l00520"></a>00520     [leftBezelView setBackgroundColor:leftCapColor];
<a name="l00521"></a>00521 
<a name="l00522"></a>00522     var themeState = _themeStates[_themeStates.length - 1];
<a name="l00523"></a>00523 
<a name="l00524"></a>00524     themeState |= _themeState &amp; <a class="code" href="_c_p_theme_8j.html#a0380ae0a1c5452ceab37dcdf5beaa0e0">CPThemeStateDisabled</a>;
<a name="l00525"></a>00525 
<a name="l00526"></a>00526     var rightCapColor = [<span class="keyword">self</span> valueForThemeAttribute:@&quot;right-segment-bezel-color&quot; 
<a name="l00527"></a>00527                                              inState:themeState];
<a name="l00528"></a>00528 
<a name="l00529"></a>00529     var rightBezelView = [<span class="keyword">self</span> layoutEphemeralSubviewNamed:@&quot;right-segment-bezel&quot;
<a name="l00530"></a>00530                                                positioned:CPWindowBelow
<a name="l00531"></a>00531                           relativeToEphemeralSubviewNamed:nil];
<a name="l00532"></a>00532 
<a name="l00533"></a>00533     [rightBezelView setBackgroundColor:rightCapColor];
<a name="l00534"></a>00534 
<a name="l00535"></a>00535     <span class="keywordflow">for</span> (var i=0, count = _themeStates.length; i&lt;count; i++)
<a name="l00536"></a>00536     {
<a name="l00537"></a>00537         var themeState = _themeStates[i];
<a name="l00538"></a>00538 
<a name="l00539"></a>00539         themeState |= _themeState &amp; <a class="code" href="_c_p_theme_8j.html#a0380ae0a1c5452ceab37dcdf5beaa0e0">CPThemeStateDisabled</a>;
<a name="l00540"></a>00540 
<a name="l00541"></a>00541         var bezelColor = [<span class="keyword">self</span> valueForThemeAttribute:@&quot;center-segment-bezel-color&quot; 
<a name="l00542"></a>00542                                               inState:themeState];
<a name="l00543"></a>00543 
<a name="l00544"></a>00544         var bezelView = [<span class="keyword">self</span> layoutEphemeralSubviewNamed:&quot;segment-bezel-&quot;+i 
<a name="l00545"></a>00545                                                positioned:CPWindowBelow 
<a name="l00546"></a>00546                           relativeToEphemeralSubviewNamed:nil];
<a name="l00547"></a>00547 
<a name="l00548"></a>00548         [bezelView setBackgroundColor:bezelColor];
<a name="l00549"></a>00549 
<a name="l00550"></a>00550 
<a name="l00551"></a>00551         <span class="comment">//layout image/title views</span>
<a name="l00552"></a>00552         var segment = _segments[i];
<a name="l00553"></a>00553 
<a name="l00554"></a>00554 
<a name="l00555"></a>00555         var contentView = [<span class="keyword">self</span> layoutEphemeralSubviewNamed:@&quot;segment-content-&quot;+i
<a name="l00556"></a>00556                                                  positioned:CPWindowAbove
<a name="l00557"></a>00557                             relativeToEphemeralSubviewNamed:@&quot;segment-bezel-&quot;+i];
<a name="l00558"></a>00558 
<a name="l00559"></a>00559         [contentView setText:segment.label];
<a name="l00560"></a>00560         [contentView setImage:segment.image];
<a name="l00561"></a>00561 
<a name="l00562"></a>00562         [contentView setFont:[<span class="keyword">self</span> valueForThemeAttribute:@&quot;font&quot; inState:themeState]];
<a name="l00563"></a>00563         [contentView setTextColor:[<span class="keyword">self</span> valueForThemeAttribute:@&quot;text-color&quot; inState:themeState]];
<a name="l00564"></a>00564         [contentView setAlignment:[<span class="keyword">self</span> valueForThemeAttribute:@&quot;alignment&quot; inState:themeState]];
<a name="l00565"></a>00565         [contentView setVerticalAlignment:[<span class="keyword">self</span> valueForThemeAttribute:@&quot;vertical-alignment&quot; inState:themeState]];
<a name="l00566"></a>00566         [contentView setLineBreakMode:[<span class="keyword">self</span> valueForThemeAttribute:@&quot;line-break-mode&quot; inState:themeState]];
<a name="l00567"></a>00567         [contentView setTextShadowColor:[<span class="keyword">self</span> valueForThemeAttribute:@&quot;text-shadow-color&quot; inState:themeState]];
<a name="l00568"></a>00568         [contentView setTextShadowOffset:[<span class="keyword">self</span> valueForThemeAttribute:@&quot;text-shadow-offset&quot; inState:themeState]];
<a name="l00569"></a>00569         [contentView setImageScaling:[<span class="keyword">self</span> valueForThemeAttribute:@&quot;image-scaling&quot; inState:themeState]];        
<a name="l00570"></a>00570         
<a name="l00571"></a>00571         <span class="keywordflow">if</span> (segment.image &amp;&amp; segment.label)
<a name="l00572"></a>00572             [contentView setImagePosition:[<span class="keyword">self</span> valueForThemeAttribute:@&quot;image-position&quot; inState:themeState]];
<a name="l00573"></a>00573         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (segment.image)
<a name="l00574"></a>00574             [contentView setImagePosition:CPImageOnly];
<a name="l00575"></a>00575 
<a name="l00576"></a>00576         <span class="keywordflow">if</span> (i == count - 1)
<a name="l00577"></a>00577             <span class="keywordflow">continue</span>;
<a name="l00578"></a>00578 
<a name="l00579"></a>00579         var borderState = _themeStates[i] | _themeStates[i+1];
<a name="l00580"></a>00580         
<a name="l00581"></a>00581         borderState = (borderState &amp; <a class="code" href="_c_p_theme_8j.html#a059cc2a1cde640d33389dbf102dd9ed8">CPThemeStateSelected</a> &amp; ~<a class="code" href="_c_p_theme_8j.html#aa68f7cdbec02d10022cccba055493bec">CPThemeStateHighlighted</a>) ? <a class="code" href="_c_p_theme_8j.html#a059cc2a1cde640d33389dbf102dd9ed8">CPThemeStateSelected</a> : <a class="code" href="_c_p_theme_8j.html#ab0279bc774339d787f47dbc6f88b1fe5">CPThemeStateNormal</a>;
<a name="l00582"></a>00582 
<a name="l00583"></a>00583         borderState |= _themeState &amp; CPThemeStateDisabled;
<a name="l00584"></a>00584 
<a name="l00585"></a>00585         var borderColor = [<span class="keyword">self</span> valueForThemeAttribute:@&quot;divider-bezel-color&quot;
<a name="l00586"></a>00586                                                inState:borderState];
<a name="l00587"></a>00587 
<a name="l00588"></a>00588         var borderView = [<span class="keyword">self</span> layoutEphemeralSubviewNamed:&quot;divider-bezel-&quot;+i 
<a name="l00589"></a>00589                                                 positioned:CPWindowBelow 
<a name="l00590"></a>00590                            relativeToEphemeralSubviewNamed:nil];
<a name="l00591"></a>00591 
<a name="l00592"></a>00592         [borderView setBackgroundColor:borderColor];
<a name="l00593"></a>00593     }
<a name="l00594"></a>00594 }
<a name="l00595"></a>00595 
<a name="l00596"></a>00596 
<a name="l00602"></a><a class="code" href="class_c_p_segmented_control.html#ae2cc517f1b04ae65b2761b63558aabb0">00602</a> - (void)drawSegment:(<span class="keywordtype">int</span>)aSegment highlight:(BOOL)shouldHighlight
<a name="l00603"></a>00603 {
<a name="l00604"></a>00604 }
<a name="l00605"></a>00605 
<a name="l00606"></a><a class="code" href="class_c_p_segmented_control.html#a3bac51f2b56ac303d95b4f46c96b6d38">00606</a> - (void)tileWithChangedSegment:(<span class="keywordtype">unsigned</span>)aSegment
<a name="l00607"></a>00607 {
<a name="l00608"></a>00608     <span class="keywordflow">if</span> (aSegment &gt;= _segments.length)
<a name="l00609"></a>00609         <span class="keywordflow">return</span>;
<a name="l00610"></a>00610 
<a name="l00611"></a>00611     var segment = _segments[aSegment],
<a name="l00612"></a>00612         segmentWidth = segment.width,
<a name="l00613"></a>00613         themeState = _themeStates[aSegment] | (_themeState &amp; <a class="code" href="_c_p_theme_8j.html#a0380ae0a1c5452ceab37dcdf5beaa0e0">CPThemeStateDisabled</a>),
<a name="l00614"></a>00614         contentInset = [<span class="keyword">self</span> valueForThemeAttribute:<span class="stringliteral">@&quot;content-inset&quot;</span> inState:themeState],
<a name="l00615"></a>00615         font = [<span class="keyword">self</span> valueForThemeAttribute:<span class="stringliteral">@&quot;font&quot;</span> inState:themeState];
<a name="l00616"></a>00616 
<a name="l00617"></a>00617     <span class="keywordflow">if</span> (!segmentWidth)
<a name="l00618"></a>00618     {
<a name="l00619"></a>00619         <span class="keywordflow">if</span> (segment.image &amp;&amp; segment.label)
<a name="l00620"></a>00620             segmentWidth = [segment.label sizeWithFont:font].width + [segment.image size].width + contentInset.left + contentInset.right;
<a name="l00621"></a>00621         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (segment.image)
<a name="l00622"></a>00622             segmentWidth = [segment.image size].width + contentInset.left + contentInset.right;
<a name="l00623"></a>00623         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (segment.label)
<a name="l00624"></a>00624             segmentWidth = [segment.label sizeWithFont:font].width + contentInset.left + contentInset.right;
<a name="l00625"></a>00625         <span class="keywordflow">else</span>
<a name="l00626"></a>00626             segmentWidth = 0.0;
<a name="l00627"></a>00627     }
<a name="l00628"></a>00628 
<a name="l00629"></a>00629     var delta = segmentWidth - <a class="code" href="_c_g_geometry_8j.html#aa310af239f2108c573299b35776996fa">CGRectGetWidth</a>(segment.frame);
<a name="l00630"></a>00630 
<a name="l00631"></a>00631     <span class="keywordflow">if</span> (!delta)
<a name="l00632"></a>00632         <span class="keywordflow">return</span>;
<a name="l00633"></a>00633 
<a name="l00634"></a>00634     <span class="comment">// Update Contorl Size</span>
<a name="l00635"></a>00635     var <a class="code" href="_c_p_segmented_control_8j.html#a63fcc9e0dd97e8502cce685e88234e16">frame</a> = [<span class="keyword">self</span> frame];
<a name="l00636"></a>00636     
<a name="l00637"></a>00637     [<span class="keyword">self</span> setFrameSize:CGSizeMake(CGRectGetWidth(frame) + delta, CGRectGetHeight(frame))];
<a name="l00638"></a>00638 
<a name="l00639"></a>00639     <span class="comment">// Update Segment Width</span>
<a name="l00640"></a>00640     segment.width = segmentWidth;
<a name="l00641"></a>00641     segment.frame = [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#a2d1f3c3e9c9d113a1b3472425423d2b6">frameForSegment</a>:aSegment];;
<a name="l00642"></a>00642 
<a name="l00643"></a>00643     <span class="comment">// Update Following Segments Widths</span>
<a name="l00644"></a>00644     var index = aSegment + 1;
<a name="l00645"></a>00645     
<a name="l00646"></a>00646     <span class="keywordflow">for</span> (; index &lt; _segments.length; ++index)
<a name="l00647"></a>00647     {
<a name="l00648"></a>00648         _segments[index].frame.origin.x += delta;
<a name="l00649"></a>00649         
<a name="l00650"></a>00650         [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#a2f6706f025c3ed29f41a3f23b54902b4">drawSegmentBezel</a>:index <a class="code" href="class_c_p_segmented_control.html#a2f6706f025c3ed29f41a3f23b54902b4">highlight</a>:NO];
<a name="l00651"></a>00651         [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#ae2cc517f1b04ae65b2761b63558aabb0">drawSegment</a>:index <a class="code" href="class_c_p_segmented_control.html#ae2cc517f1b04ae65b2761b63558aabb0">highlight</a>:NO];
<a name="l00652"></a>00652     }
<a name="l00653"></a>00653     
<a name="l00654"></a>00654     [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#a2f6706f025c3ed29f41a3f23b54902b4">drawSegmentBezel</a>:aSegment <a class="code" href="class_c_p_segmented_control.html#a2f6706f025c3ed29f41a3f23b54902b4">highlight</a>:NO];
<a name="l00655"></a>00655     [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#ae2cc517f1b04ae65b2761b63558aabb0">drawSegment</a>:aSegment <a class="code" href="class_c_p_segmented_control.html#ae2cc517f1b04ae65b2761b63558aabb0">highlight</a>:NO];
<a name="l00656"></a>00656 
<a name="l00657"></a>00657     [<span class="keyword">self</span> setNeedsLayout];
<a name="l00658"></a>00658     [<span class="keyword">self</span> setNeedsDisplay:YES];
<a name="l00659"></a>00659 }
<a name="l00660"></a>00660 
<a name="l00665"></a><a class="code" href="class_c_p_segmented_control.html#a2d1f3c3e9c9d113a1b3472425423d2b6">00665</a> - (CGRect)frameForSegment:(<span class="keywordtype">unsigned</span>)aSegment
<a name="l00666"></a>00666 {
<a name="l00667"></a>00667     <span class="keywordflow">return</span> [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#a1a8bcd9f13b2f2cf33e40bf70c1a0f8f">bezelFrameForSegment</a>:aSegment];
<a name="l00668"></a>00668 }
<a name="l00669"></a>00669 
<a name="l00670"></a><a class="code" href="class_c_p_segmented_control.html#a1a8bcd9f13b2f2cf33e40bf70c1a0f8f">00670</a> - (CGRect)bezelFrameForSegment:(<span class="keywordtype">unsigned</span>)aSegment
<a name="l00671"></a>00671 {
<a name="l00672"></a>00672     var <a class="code" href="_c_p_screen_8j.html#a4540395d130d8a367becfe06b659b9f1">height</a> = [<span class="keyword">self</span> currentValueForThemeAttribute:@&quot;default-height&quot;],
<a name="l00673"></a>00673         bezelInset = [<span class="keyword">self</span> currentValueForThemeAttribute:@&quot;bezel-inset&quot;],
<a name="l00674"></a>00674         <a class="code" href="_c_p_segmented_control_8j.html#a2474a5474cbff19523a51eb1de01cda4">width</a> = [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#afd91f72b83994665cabb0e6de985b6b6">widthForSegment</a>:aSegment],
<a name="l00675"></a>00675         left = [<span class="keyword">self</span> _leftOffsetForSegment:aSegment];
<a name="l00676"></a>00676 
<a name="l00677"></a>00677     <span class="keywordflow">return</span> <a class="code" href="_c_g_geometry_8j.html#aca150c0049e24797c6271bad7bc90610">CGRectMake</a>(left, bezelInset.top, <a class="code" href="_c_p_segmented_control_8j.html#a2474a5474cbff19523a51eb1de01cda4">width</a>, <a class="code" href="_c_p_screen_8j.html#a4540395d130d8a367becfe06b659b9f1">height</a>);
<a name="l00678"></a>00678 }
<a name="l00679"></a>00679 
<a name="l00680"></a><a class="code" href="class_c_p_segmented_control.html#adb57ca986be1404f737faf8f3107c5c1">00680</a> - (CGRect)contentFrameForSegment:(<span class="keywordtype">unsigned</span>)aSegment
<a name="l00681"></a>00681 {
<a name="l00682"></a>00682     var <a class="code" href="_c_p_screen_8j.html#a4540395d130d8a367becfe06b659b9f1">height</a> = [<span class="keyword">self</span> currentValueForThemeAttribute:@&quot;default-height&quot;],
<a name="l00683"></a>00683         contentInset = [<span class="keyword">self</span> currentValueForThemeAttribute:@&quot;content-inset&quot;],
<a name="l00684"></a>00684         <a class="code" href="_c_p_segmented_control_8j.html#a2474a5474cbff19523a51eb1de01cda4">width</a> = [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#afd91f72b83994665cabb0e6de985b6b6">widthForSegment</a>:aSegment],
<a name="l00685"></a>00685         left = [<span class="keyword">self</span> _leftOffsetForSegment:aSegment];
<a name="l00686"></a>00686 
<a name="l00687"></a>00687     <span class="keywordflow">return</span> <a class="code" href="_c_g_geometry_8j.html#aca150c0049e24797c6271bad7bc90610">CGRectMake</a>(left + contentInset.left, contentInset.top, <a class="code" href="_c_p_segmented_control_8j.html#a2474a5474cbff19523a51eb1de01cda4">width</a> - contentInset.left - contentInset.right, <a class="code" href="_c_p_screen_8j.html#a4540395d130d8a367becfe06b659b9f1">height</a> - contentInset.top - contentInset.bottom);
<a name="l00688"></a>00688 }
<a name="l00689"></a>00689 
<a name="l00695"></a><a class="code" href="class_c_p_segmented_control.html#aab926d30b03839882eebb65d714c18ec">00695</a> - (unsigned)testSegment:(CGPoint)aPoint
<a name="l00696"></a>00696 {
<a name="l00697"></a>00697     var location = [<span class="keyword">self</span> convertPoint:aPoint fromView:nil],
<a name="l00698"></a>00698         count = _segments.length;
<a name="l00699"></a>00699     
<a name="l00700"></a>00700     <span class="keywordflow">while</span> (count--)
<a name="l00701"></a>00701         <span class="keywordflow">if</span> (<a class="code" href="_c_g_geometry_8j.html#a1a96c087c2dc31ab61c3c88a3c6ec7c5">CGRectContainsPoint</a>(_segments[count].<a class="code" href="_c_p_segmented_control_8j.html#a63fcc9e0dd97e8502cce685e88234e16">frame</a>, aPoint))
<a name="l00702"></a>00702             <span class="keywordflow">return</span> count;
<a name="l00703"></a>00703 
<a name="l00704"></a>00704     <span class="keywordflow">if</span> (_segments.length)
<a name="l00705"></a>00705     {
<a name="l00706"></a>00706         var adjustedLastFrame = <a class="code" href="_c_g_geometry_8j.html#ae62f9f5339c89eeddc9eaad1386a1566">CGRectCreateCopy</a>(_segments[_segments.length - 1].frame);
<a name="l00707"></a>00707         adjustedLastFrame.size.width = <a class="code" href="_c_g_geometry_8j.html#aa310af239f2108c573299b35776996fa">CGRectGetWidth</a>([<span class="keyword">self</span> bounds]) - adjustedLastFrame.origin.x;
<a name="l00708"></a>00708 
<a name="l00709"></a>00709         <span class="keywordflow">if</span> (<a class="code" href="_c_g_geometry_8j.html#a1a96c087c2dc31ab61c3c88a3c6ec7c5">CGRectContainsPoint</a>(adjustedLastFrame, aPoint))
<a name="l00710"></a>00710             <span class="keywordflow">return</span> _segments.length - 1;
<a name="l00711"></a>00711     }
<a name="l00712"></a>00712 
<a name="l00713"></a>00713     <span class="keywordflow">return</span> -1;
<a name="l00714"></a>00714 }
<a name="l00715"></a>00715 
<a name="l00716"></a><a class="code" href="class_c_p_segmented_control.html#a423d4c5217a1bd50806e7b15a7b2e501">00716</a> - (void)mouseDown:(<a class="code" href="class_c_p_event.html">CPEvent</a>)anEvent
<a name="l00717"></a>00717 {
<a name="l00718"></a>00718     <span class="keywordflow">if</span> (![<span class="keyword">self</span> isEnabled])
<a name="l00719"></a>00719         <span class="keywordflow">return</span>;
<a name="l00720"></a>00720     
<a name="l00721"></a>00721     [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#a84a1db50a54ad517c67eedb7155992e3">trackSegment</a>:anEvent];
<a name="l00722"></a>00722 }
<a name="l00723"></a>00723 
<a name="l00724"></a>00724 <span class="comment">// FIXME: this should be fixed way up in cpbutton/cpcontrol.</span>
<a name="l00725"></a><a class="code" href="class_c_p_segmented_control.html#ac83f22714b17f28718ed29c6d96dbd12">00725</a> - (void)mouseUp:(<a class="code" href="class_c_p_event.html">CPEvent</a>)anEvent
<a name="l00726"></a>00726 {
<a name="l00727"></a>00727 }
<a name="l00728"></a>00728 
<a name="l00733"></a><a class="code" href="class_c_p_segmented_control.html#a84a1db50a54ad517c67eedb7155992e3">00733</a> - (void)trackSegment:(<a class="code" href="class_c_p_event.html">CPEvent</a>)anEvent
<a name="l00734"></a>00734 {     
<a name="l00735"></a>00735     var type = [anEvent <a class="code" href="class_c_p_event.html#abbbd5ff6550996fa3ef524ef27a1ef80">type</a>],
<a name="l00736"></a>00736         location = [<span class="keyword">self</span> convertPoint:[anEvent <a class="code" href="class_c_p_event.html#a5a57f4fa909de5d83e5402a8d8af4b94">locationInWindow</a>] fromView:nil];
<a name="l00737"></a>00737         
<a name="l00738"></a>00738     <span class="keywordflow">if</span> (type == <a class="code" href="_c_p_event_8j.html#a192f15362855840eb6cfb4177a6494ef">CPLeftMouseUp</a>)
<a name="l00739"></a>00739     {
<a name="l00740"></a>00740         <span class="keywordflow">if</span> (_trackingSegment == -1)
<a name="l00741"></a>00741             <span class="keywordflow">return</span>;
<a name="l00742"></a>00742 
<a name="l00743"></a>00743         <span class="keywordflow">if</span> (_trackingSegment === [<span class="keyword">self</span> testSegment:location])
<a name="l00744"></a>00744         {
<a name="l00745"></a>00745             <span class="keywordflow">if</span> (_trackingMode == <a class="code" href="_c_p_segmented_control_8j.html#af784a543c960a8ffc4c6e4cc7edade16">CPSegmentSwitchTrackingSelectAny</a>)
<a name="l00746"></a>00746             {
<a name="l00747"></a>00747                 [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#a785f4c1d6bca8a859a264e581d1917ab">setSelected</a>:![<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#a4022d6f091d0888fe16d01e884480c5a">isSelectedForSegment</a>:_trackingSegment] <a class="code" href="class_c_p_segmented_control.html#a785f4c1d6bca8a859a264e581d1917ab">forSegment</a>:_trackingSegment];
<a name="l00748"></a>00748                 
<a name="l00749"></a>00749                 <span class="comment">// With ANY, _selectedSegment means last pressed.</span>
<a name="l00750"></a>00750                 _selectedSegment = _trackingSegment;
<a name="l00751"></a>00751             }
<a name="l00752"></a>00752             <span class="keywordflow">else</span>
<a name="l00753"></a>00753                 [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#a785f4c1d6bca8a859a264e581d1917ab">setSelected</a>:YES <a class="code" href="class_c_p_segmented_control.html#a785f4c1d6bca8a859a264e581d1917ab">forSegment</a>:_trackingSegment];
<a name="l00754"></a>00754         
<a name="l00755"></a>00755             [<span class="keyword">self</span> sendAction:[<span class="keyword">self</span> action] to:[<span class="keyword">self</span> target]];
<a name="l00756"></a>00756             
<a name="l00757"></a>00757             <span class="keywordflow">if</span> (_trackingMode == <a class="code" href="_c_p_segmented_control_8j.html#a2ec1bc17beb8c74301e1909e6ed96a76">CPSegmentSwitchTrackingMomentary</a>)
<a name="l00758"></a>00758             {
<a name="l00759"></a>00759                 [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#a785f4c1d6bca8a859a264e581d1917ab">setSelected</a>:NO <a class="code" href="class_c_p_segmented_control.html#a785f4c1d6bca8a859a264e581d1917ab">forSegment</a>:_trackingSegment];
<a name="l00760"></a>00760                 
<a name="l00761"></a>00761                 _selectedSegment = -1;
<a name="l00762"></a>00762             }
<a name="l00763"></a>00763         }
<a name="l00764"></a>00764 
<a name="l00765"></a>00765         [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#a2f6706f025c3ed29f41a3f23b54902b4">drawSegmentBezel</a>:_trackingSegment <a class="code" href="class_c_p_segmented_control.html#a2f6706f025c3ed29f41a3f23b54902b4">highlight</a>:NO];
<a name="l00766"></a>00766         
<a name="l00767"></a>00767         _trackingSegment = -1;
<a name="l00768"></a>00768         
<a name="l00769"></a>00769         <span class="keywordflow">return</span>;
<a name="l00770"></a>00770     }
<a name="l00771"></a>00771     
<a name="l00772"></a>00772     <span class="keywordflow">if</span> (type == <a class="code" href="_c_p_event_8j.html#a1e3613de4780ff7b45bace27a1521899">CPLeftMouseDown</a>)
<a name="l00773"></a>00773     {
<a name="l00774"></a>00774         var trackingSegment = [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#aab926d30b03839882eebb65d714c18ec">testSegment</a>:location];
<a name="l00775"></a>00775         <span class="keywordflow">if</span> (trackingSegment &gt; -1 &amp;&amp; [<span class="keyword">self</span> isEnabledForSegment:trackingSegment])
<a name="l00776"></a>00776         {
<a name="l00777"></a>00777             _trackingHighlighted = YES;
<a name="l00778"></a>00778             _trackingSegment = trackingSegment;
<a name="l00779"></a>00779             [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#a2f6706f025c3ed29f41a3f23b54902b4">drawSegmentBezel</a>:_trackingSegment <a class="code" href="class_c_p_segmented_control.html#a2f6706f025c3ed29f41a3f23b54902b4">highlight</a>:YES];
<a name="l00780"></a>00780         }
<a name="l00781"></a>00781     }
<a name="l00782"></a>00782     
<a name="l00783"></a>00783     <span class="keywordflow">else</span> <span class="keywordflow">if</span> (type == <a class="code" href="_c_p_event_8j.html#a391b5492a8cbdfa1b84b349eb2120c4e">CPLeftMouseDragged</a>)
<a name="l00784"></a>00784     {
<a name="l00785"></a>00785         <span class="keywordflow">if</span> (_trackingSegment == -1)
<a name="l00786"></a>00786             <span class="keywordflow">return</span>;
<a name="l00787"></a>00787 
<a name="l00788"></a>00788         var highlighted = [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#aab926d30b03839882eebb65d714c18ec">testSegment</a>:location] === _trackingSegment;
<a name="l00789"></a>00789         <span class="keywordflow">if</span> (highlighted != _trackingHighlighted)
<a name="l00790"></a>00790         {
<a name="l00791"></a>00791             _trackingHighlighted = highlighted;
<a name="l00792"></a>00792 
<a name="l00793"></a>00793             [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#a2f6706f025c3ed29f41a3f23b54902b4">drawSegmentBezel</a>:_trackingSegment <a class="code" href="class_c_p_segmented_control.html#a2f6706f025c3ed29f41a3f23b54902b4">highlight</a>:_trackingHighlighted];
<a name="l00794"></a>00794         }
<a name="l00795"></a>00795     }
<a name="l00796"></a>00796     
<a name="l00797"></a>00797     [CPApp setTarget:self selector:@selector(trackSegment:) forNextEventMatchingMask:CPLeftMouseDraggedMask | CPLeftMouseUpMask untilDate:nil inMode:nil dequeue:YES];
<a name="l00798"></a>00798 }
<a name="l00799"></a>00799 
<a name="l00800"></a><a class="code" href="class_c_p_segmented_control.html#a6fc89a782985d28ca282244b812e3582">00800</a> - (void)setFont:(<a class="code" href="class_c_p_font.html">CPFont</a>)aFont
<a name="l00801"></a>00801 {
<a name="l00802"></a>00802     [<span class="keyword">super</span> setFont:aFont];
<a name="l00803"></a>00803     
<a name="l00804"></a>00804     [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#a3bac51f2b56ac303d95b4f46c96b6d38">tileWithChangedSegment</a>:0];
<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_segmented_control_8j.html#a7811fe7873cba20c86f50a73e4d447b0">00809</a> var <a class="code" href="_c_p_segmented_control_8j.html#a7811fe7873cba20c86f50a73e4d447b0">CPSegmentedControlSegmentsKey</a>       = <span class="stringliteral">&quot;CPSegmentedControlSegmentsKey&quot;</span>,
<a name="l00810"></a><a class="code" href="_c_p_segmented_control_8j.html#a36db6b6864d6a4aad95b7c3813adc8ab">00810</a>     <a class="code" href="_c_p_segmented_control_8j.html#a36db6b6864d6a4aad95b7c3813adc8ab">CPSegmentedControlSelectedKey</a>       = <span class="stringliteral">&quot;CPSegmentedControlSelectedKey&quot;</span>,
<a name="l00811"></a><a class="code" href="_c_p_segmented_control_8j.html#a59f9576ba244e4642549fa212b650e05">00811</a>     <a class="code" href="_c_p_segmented_control_8j.html#a59f9576ba244e4642549fa212b650e05">CPSegmentedControlSegmentStyleKey</a>   = <span class="stringliteral">&quot;CPSegmentedControlSegmentStyleKey&quot;</span>,
<a name="l00812"></a><a class="code" href="_c_p_segmented_control_8j.html#a3291dbf8085b18ba55b5131fef061501">00812</a>     <a class="code" href="_c_p_segmented_control_8j.html#a3291dbf8085b18ba55b5131fef061501">CPSegmentedControlTrackingModeKey</a>   = <span class="stringliteral">&quot;CPSegmentedControlTrackingModeKey&quot;</span>;
<a name="l00813"></a>00813 
<a name="l00814"></a>00814 <span class="keyword">@implementation </span><a class="code" href="class_c_p_segmented_control.html">CPSegmentedControl</a> (CPCoding)
<a name="l00815"></a>00815 
<a name="l00816"></a><a class="code" href="class_c_p_segmented_control.html#a2dda4f968bdf444a868a768a5d797e83">00816</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="l00817"></a>00817 {
<a name="l00818"></a>00818     <span class="keyword">self</span> = [<span class="keyword">super</span> initWithCoder:aCoder];
<a name="l00819"></a>00819     
<a name="l00820"></a>00820     <span class="keywordflow">if</span> (<span class="keyword">self</span>)
<a name="l00821"></a>00821     {
<a name="l00822"></a>00822         var <a class="code" href="_c_p_segmented_control_8j.html#a63fcc9e0dd97e8502cce685e88234e16">frame</a> = [<span class="keyword">self</span> frame],
<a name="l00823"></a>00823             originalWidth = frame.size.width;
<a name="l00824"></a>00824         
<a name="l00825"></a>00825         frame.size.width = 0;
<a name="l00826"></a>00826 
<a name="l00827"></a>00827         [<span class="keyword">self</span> setFrame:frame];
<a name="l00828"></a>00828 
<a name="l00829"></a>00829         _segments       = [aCoder decodeObjectForKey:CPSegmentedControlSegmentsKey];
<a name="l00830"></a>00830         _segmentStyle   = [aCoder decodeIntForKey:CPSegmentedControlSegmentStyleKey];
<a name="l00831"></a>00831         _themeStates  = [];
<a name="l00832"></a>00832 
<a name="l00833"></a>00833         <span class="keywordflow">if</span> ([aCoder containsValueForKey:<a class="code" href="_c_p_segmented_control_8j.html#a36db6b6864d6a4aad95b7c3813adc8ab">CPSegmentedControlSelectedKey</a>])
<a name="l00834"></a>00834             _selectedSegment = [aCoder decodeIntForKey:CPSegmentedControlSelectedKey];
<a name="l00835"></a>00835         <span class="keywordflow">else</span>    
<a name="l00836"></a>00836             _selectedSegment = -1;
<a name="l00837"></a>00837         
<a name="l00838"></a>00838         <span class="keywordflow">if</span> ([aCoder containsValueForKey:<a class="code" href="_c_p_segmented_control_8j.html#a3291dbf8085b18ba55b5131fef061501">CPSegmentedControlTrackingModeKey</a>])
<a name="l00839"></a>00839             _trackingMode = [aCoder decodeIntForKey:CPSegmentedControlTrackingModeKey];
<a name="l00840"></a>00840         <span class="keywordflow">else</span>
<a name="l00841"></a>00841             _trackingMode = <a class="code" href="_c_p_segmented_control_8j.html#a23ffc231fb17626a0e9bc6d251e4d2c8">CPSegmentSwitchTrackingSelectOne</a>;
<a name="l00842"></a>00842         
<a name="l00843"></a>00843         <span class="comment">// HACK</span>
<a name="l00844"></a>00844 
<a name="l00845"></a>00845         <span class="keywordflow">for</span> (var i = 0; i &lt; _segments.length; i++)
<a name="l00846"></a>00846         {
<a name="l00847"></a>00847             _themeStates[i] = _segments[i].selected ? <a class="code" href="_c_p_theme_8j.html#a059cc2a1cde640d33389dbf102dd9ed8">CPThemeStateSelected</a> : <a class="code" href="_c_p_theme_8j.html#ab0279bc774339d787f47dbc6f88b1fe5">CPThemeStateNormal</a>;
<a name="l00848"></a>00848             [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#a3bac51f2b56ac303d95b4f46c96b6d38">tileWithChangedSegment</a>:i];
<a name="l00849"></a>00849         }
<a name="l00850"></a>00850 
<a name="l00851"></a>00851         var difference = <a class="code" href="_c_p_obj_j_runtime_8j.html#a45f5f88d061da0c18bcb6b6a854fe898">MAX</a>(originalWidth - [<span class="keyword">self</span> frame].<a class="code" href="_c_p_screen_8j.html#ad241596b0d0f8cbdd1529d94ea71337b">size</a>.width, 0.0),
<a name="l00852"></a>00852             remainingWidth = FLOOR(difference / _segments.length);
<a name="l00853"></a>00853 
<a name="l00854"></a>00854         <span class="keywordflow">for</span> (var i=0; i &lt; _segments.length; i++)
<a name="l00855"></a>00855             [<span class="keyword">self</span> setWidth:_segments[i].<a class="code" href="_c_p_segmented_control_8j.html#a2474a5474cbff19523a51eb1de01cda4">width</a> + remainingWidth forSegment:i];
<a name="l00856"></a>00856 
<a name="l00857"></a>00857         [<span class="keyword">self</span> <a class="code" href="class_c_p_segmented_control.html#a3bac51f2b56ac303d95b4f46c96b6d38">tileWithChangedSegment</a>:0];
<a name="l00858"></a>00858     }
<a name="l00859"></a>00859     
<a name="l00860"></a>00860     <span class="keywordflow">return</span> <span class="keyword">self</span>;
<a name="l00861"></a>00861 }
<a name="l00862"></a>00862 
<a name="l00863"></a><a class="code" href="class_c_p_segmented_control.html#a1476df149c814bd87894b5ff49439c49">00863</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="l00864"></a>00864 {
<a name="l00865"></a>00865     [<span class="keyword">super</span> encodeWithCoder:aCoder];
<a name="l00866"></a>00866     
<a name="l00867"></a>00867     [aCoder encodeObject:_segments forKey:CPSegmentedControlSegmentsKey];
<a name="l00868"></a>00868     [aCoder encodeInt:_selectedSegment forKey:CPSegmentedControlSelectedKey];
<a name="l00869"></a>00869     [aCoder encodeInt:_segmentStyle forKey:CPSegmentedControlSegmentStyleKey];
<a name="l00870"></a>00870     [aCoder encodeInt:_trackingMode forKey:CPSegmentedControlTrackingModeKey];
<a name="l00871"></a>00871 }
<a name="l00872"></a>00872 
<a name="l00873"></a>00873 <span class="keyword">@end</span>
<a name="l00874"></a>00874 
<a name="l00875"></a>00875 
<a name="l00876"></a>00876 <span class="keyword">@implementation </span>_CPSegmentItem : <a class="code" href="class_c_p_object.html" title="The root class from which most classes are subclassed.">CPObject</a>
<a name="l00877"></a>00877 {
<a name="l00878"></a>00878     <a class="code" href="class_c_p_image.html">CPImage</a>     image;
<a name="l00879"></a><a class="code" href="_c_p_segmented_control_8j.html#a2949ae0332d03a93977dd5eda0aa6409">00879</a>     <a class="code" href="class_c_p_string.html" title="An immutable string (collection of characters).">CPString</a>    <a class="code" href="_c_p_segmented_control_8j.html#a2949ae0332d03a93977dd5eda0aa6409">label</a>;
<a name="l00880"></a><a class="code" href="_c_p_segmented_control_8j.html#a013c594489b43812712541b68420b137">00880</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="l00881"></a><a class="code" href="_c_p_segmented_control_8j.html#a92bcc5950aec22fe5f1a17286cb299e5">00881</a>     BOOL        <a class="code" href="_c_p_segmented_control_8j.html#a92bcc5950aec22fe5f1a17286cb299e5">selected</a>;
<a name="l00882"></a><a class="code" href="_c_p_segmented_control_8j.html#ac19b89f25c9dfa8d24866a5c108d6477">00882</a>     BOOL        <a class="code" href="_c_p_segmented_control_8j.html#ac19b89f25c9dfa8d24866a5c108d6477">enabled</a>;
<a name="l00883"></a><a class="code" href="_c_p_segmented_control_8j.html#aab34f2fc02b4a86bea93c68e1ec09d75">00883</a>     <span class="keywordtype">int</span>         <a class="code" href="_c_p_segmented_control_8j.html#aab34f2fc02b4a86bea93c68e1ec09d75">tag</a>;
<a name="l00884"></a><a class="code" href="_c_p_segmented_control_8j.html#a2474a5474cbff19523a51eb1de01cda4">00884</a>     <span class="keywordtype">int</span>         <a class="code" href="_c_p_segmented_control_8j.html#a2474a5474cbff19523a51eb1de01cda4">width</a>;
<a name="l00885"></a>00885 
<a name="l00886"></a><a class="code" href="_c_p_segmented_control_8j.html#a63fcc9e0dd97e8502cce685e88234e16">00886</a>     CGRect      <a class="code" href="_c_p_segmented_control_8j.html#a63fcc9e0dd97e8502cce685e88234e16">frame</a>;
<a name="l00887"></a>00887 }
<a name="l00888"></a>00888 
<a name="l00889"></a>00889 - (id)init
<a name="l00890"></a>00890 {
<a name="l00891"></a>00891     <span class="keywordflow">if</span> (<span class="keyword">self</span> = [super init])
<a name="l00892"></a>00892     {
<a name="l00893"></a>00893         image        = nil;
<a name="l00894"></a>00894         <a class="code" href="_c_p_segmented_control_8j.html#a2949ae0332d03a93977dd5eda0aa6409">label</a>        = <span class="stringliteral">@&quot;&quot;</span>;
<a name="l00895"></a>00895         <a class="code" href="_c_p_segmented_control_8j.html#a013c594489b43812712541b68420b137">menu</a>         = nil;
<a name="l00896"></a>00896         <a class="code" href="_c_p_segmented_control_8j.html#a92bcc5950aec22fe5f1a17286cb299e5">selected</a>     = NO;
<a name="l00897"></a>00897         <a class="code" href="_c_p_segmented_control_8j.html#ac19b89f25c9dfa8d24866a5c108d6477">enabled</a>      = NO;
<a name="l00898"></a>00898         <a class="code" href="_c_p_segmented_control_8j.html#aab34f2fc02b4a86bea93c68e1ec09d75">tag</a>          = 0;
<a name="l00899"></a>00899         <a class="code" href="_c_p_segmented_control_8j.html#a2474a5474cbff19523a51eb1de01cda4">width</a>        = 0;
<a name="l00900"></a>00900 
<a name="l00901"></a>00901         <a class="code" href="_c_p_segmented_control_8j.html#a63fcc9e0dd97e8502cce685e88234e16">frame</a>        = <a class="code" href="_c_g_geometry_8j.html#aaab3ca5ef295a8517c18bfce6e95c1f6">CGRectMakeZero</a>();
<a name="l00902"></a>00902     }
<a name="l00903"></a>00903     <span class="keywordflow">return</span> <span class="keyword">self</span>;
<a name="l00904"></a>00904 }
<a name="l00905"></a>00905 
<a name="l00906"></a>00906 <span class="keyword">@end</span>
<a name="l00907"></a>00907 
<a name="l00908"></a><a class="code" href="_c_p_segmented_control_8j.html#aa618ae485bf8dc1e003da88432a7d00b">00908</a> var <a class="code" href="_c_p_segmented_control_8j.html#aa618ae485bf8dc1e003da88432a7d00b">CPSegmentItemImageKey</a>       = <span class="stringliteral">&quot;CPSegmentItemImageKey&quot;</span>,
<a name="l00909"></a><a class="code" href="_c_p_segmented_control_8j.html#acd806f3e8e44c9b75276fe531c28a10c">00909</a>     <a class="code" href="_c_p_segmented_control_8j.html#acd806f3e8e44c9b75276fe531c28a10c">CPSegmentItemLabelKey</a>       = <span class="stringliteral">&quot;CPSegmentItemLabelKey&quot;</span>,
<a name="l00910"></a><a class="code" href="_c_p_segmented_control_8j.html#ab058e1cc61f6c83b41087d4819267e69">00910</a>     <a class="code" href="_c_p_segmented_control_8j.html#ab058e1cc61f6c83b41087d4819267e69">CPSegmentItemMenuKey</a>        = <span class="stringliteral">&quot;CPSegmentItemMenuKey&quot;</span>,
<a name="l00911"></a><a class="code" href="_c_p_segmented_control_8j.html#ab47fa14ace345260808b2c674fb3c314">00911</a>     <a class="code" href="_c_p_segmented_control_8j.html#ab47fa14ace345260808b2c674fb3c314">CPSegmentItemSelectedKey</a>    = <span class="stringliteral">&quot;CPSegmentItemSelectedKey&quot;</span>,
<a name="l00912"></a><a class="code" href="_c_p_segmented_control_8j.html#aa11b82400227e8b0a217d9399f8fb542">00912</a>     <a class="code" href="_c_p_segmented_control_8j.html#aa11b82400227e8b0a217d9399f8fb542">CPSegmentItemEnabledKey</a>     = <span class="stringliteral">&quot;CPSegmentItemEnabledKey&quot;</span>,
<a name="l00913"></a><a class="code" href="_c_p_segmented_control_8j.html#a2df14892ca14a9fa073b2af68c27500d">00913</a>     <a class="code" href="_c_p_segmented_control_8j.html#a2df14892ca14a9fa073b2af68c27500d">CPSegmentItemTagKey</a>         = <span class="stringliteral">&quot;CPSegmentItemTagKey&quot;</span>,
<a name="l00914"></a><a class="code" href="_c_p_segmented_control_8j.html#a25f975cff7a385877860a6f985cac36f">00914</a>     <a class="code" href="_c_p_segmented_control_8j.html#a25f975cff7a385877860a6f985cac36f">CPSegmentItemWidthKey</a>       = <span class="stringliteral">&quot;CPSegmentItemWidthKey&quot;</span>;
<a name="l00915"></a>00915 
<a name="l00916"></a>00916 <span class="keyword">@implementation </span>_CPSegmentItem (CPCoding)
<a name="l00917"></a>00917 
<a name="l00918"></a>00918 - (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="l00919"></a>00919 {
<a name="l00920"></a>00920     <span class="keyword">self</span> = [<span class="keyword">super</span> init];
<a name="l00921"></a>00921     
<a name="l00922"></a>00922     <span class="keywordflow">if</span> (<span class="keyword">self</span>)
<a name="l00923"></a>00923     {
<a name="l00924"></a>00924         image        = [aCoder decodeObjectForKey:CPSegmentItemImageKey];
<a name="l00925"></a>00925         <a class="code" href="_c_p_segmented_control_8j.html#a2949ae0332d03a93977dd5eda0aa6409">label</a>        = [aCoder decodeObjectForKey:CPSegmentItemLabelKey];
<a name="l00926"></a>00926         <a class="code" href="_c_p_segmented_control_8j.html#a013c594489b43812712541b68420b137">menu</a>         = [aCoder decodeObjectForKey:CPSegmentItemMenuKey];
<a name="l00927"></a>00927         <a class="code" href="_c_p_segmented_control_8j.html#a92bcc5950aec22fe5f1a17286cb299e5">selected</a>     = [aCoder decodeBoolForKey:CPSegmentItemSelectedKey];
<a name="l00928"></a>00928         <a class="code" href="_c_p_segmented_control_8j.html#ac19b89f25c9dfa8d24866a5c108d6477">enabled</a>      = [aCoder decodeBoolForKey:CPSegmentItemEnabledKey];
<a name="l00929"></a>00929         <a class="code" href="_c_p_segmented_control_8j.html#aab34f2fc02b4a86bea93c68e1ec09d75">tag</a>          = [aCoder decodeIntForKey:CPSegmentItemTagKey];
<a name="l00930"></a>00930         <a class="code" href="_c_p_segmented_control_8j.html#a2474a5474cbff19523a51eb1de01cda4">width</a>        = [aCoder decodeFloatForKey:CPSegmentItemWidthKey];
<a name="l00931"></a>00931 
<a name="l00932"></a>00932         <a class="code" href="_c_p_segmented_control_8j.html#a63fcc9e0dd97e8502cce685e88234e16">frame</a>        = <a class="code" href="_c_g_geometry_8j.html#aaab3ca5ef295a8517c18bfce6e95c1f6">CGRectMakeZero</a>();
<a name="l00933"></a>00933     }
<a name="l00934"></a>00934     
<a name="l00935"></a>00935     <span class="keywordflow">return</span> <span class="keyword">self</span>;
<a name="l00936"></a>00936 }
<a name="l00937"></a>00937 
<a name="l00938"></a>00938 - (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="l00939"></a>00939 {
<a name="l00940"></a>00940     [aCoder encodeObject:image  forKey:CPSegmentItemImageKey];
<a name="l00941"></a>00941     [aCoder encodeObject:label  forKey:CPSegmentItemLabelKey];
<a name="l00942"></a>00942     [aCoder encodeObject:menu   forKey:CPSegmentItemMenuKey];
<a name="l00943"></a>00943     [aCoder encodeBool:selected forKey:CPSegmentItemSelectedKey];
<a name="l00944"></a>00944     [aCoder encodeBool:enabled  forKey:CPSegmentItemEnabledKey];
<a name="l00945"></a>00945     [aCoder encodeInt:tag       forKey:CPSegmentItemTagKey];
<a name="l00946"></a>00946     [aCoder encodeFloat:width   forKey:CPSegmentItemWidthKey];
<a name="l00947"></a>00947 }
<a name="l00948"></a>00948 
<a name="l00949"></a>00949 <span class="keyword">@end</span>
<a name="l00950"></a>00950 
</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_segmented_control_8j_source.html by HTTrack Website Copier/3.x [XR&CO'2006], Mon, 20 Sep 2010 02:19:31 GMT -->
</html>