00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 @import <Foundation/CPObject.j>
00024
00025 @import <AppKit/CPView.j>
00026
00027
00028
00029
00030
00031
00032
00033 CPSelectedTab = 0;
00034
00035
00036
00037
00038
00039 CPBackgroundTab = 1;
00040
00041
00042
00043
00044
00045 CPPressedTab = 2;
00046
00054 @implementation CPTabViewItem : CPObject
00055 {
00056 id _identifier;
00057 CPString _label;
00058
00059 CPView _view;
00060 CPView _auxiliaryView;
00061 }
00062
00067 - (id)initWithIdentifier:(id)anIdentifier
00068 {
00069 self = [super init];
00070
00071 if (self)
00072 _identifier = anIdentifier;
00073
00074 return self;
00075 }
00076
00077
00082 - (void)setLabel:(CPString)aLabel
00083 {
00084 _label = aLabel;
00085 }
00086
00090 - (CPString)label
00091 {
00092 return _label;
00093 }
00094
00095
00099 - (CPTabState)tabState
00100 {
00101 return _tabState;
00102 }
00103
00104
00109 - (void)setIdentifier:(id)anIdentifier
00110 {
00111 _identifier = anIdentifier;
00112 }
00113
00117 - (id)identifier
00118 {
00119 return _identifier;
00120 }
00121
00122
00126 - (void)setView:(CPView)aView
00127 {
00128 _view = aView;
00129 }
00130
00134 - (CPView)view
00135 {
00136 return _view;
00137 }
00138
00139
00144 - (void)setAuxiliaryView:(CPView)anAuxiliaryView
00145 {
00146 _auxiliaryView = anAuxiliaryView;
00147 }
00148
00152 - (CPView)auxiliaryView
00153 {
00154 return _auxiliaryView;
00155 }
00156
00157
00161 - (CPTabView)tabView
00162 {
00163 return _tabView;
00164 }
00165
00166 @end
00167
00168 var CPTabViewItemIdentifierKey = "CPTabViewItemIdentifierKey",
00169 CPTabViewItemLabelKey = "CPTabViewItemLabelKey",
00170 CPTabViewItemViewKey = "CPTabViewItemViewKey",
00171 CPTabViewItemAuxViewKey = "CPTabViewItemAuxViewKey";
00172
00173
00174 @implementation CPTabViewItem (CPCoding)
00175
00176 - (id)initWithCoder:(CPCoder)aCoder
00177 {
00178 self = [super init];
00179
00180 if (self)
00181 {
00182 _identifier = [aCoder decodeObjectForKey:CPTabViewItemIdentifierKey];
00183 _label = [aCoder decodeObjectForKey:CPTabViewItemLabelKey];
00184
00185 _view = [aCoder decodeObjectForKey:CPTabViewItemViewKey];
00186 _auxiliaryView = [aCoder decodeObjectForKey:CPTabViewItemAuxViewKey];
00187 }
00188
00189 return self;
00190 }
00191
00192 - (void)encodeWithCoder:(CPCoder)aCoder
00193 {
00194 [aCoder encodeObject:_identifier forKey:CPTabViewItemIdentifierKey];
00195 [aCoder encodeObject:_label forKey:CPTabViewItemLabelKey];
00196
00197 [aCoder encodeObject:_view forKey:CPTabViewItemViewKey];
00198 [aCoder encodeObject:_auxiliaryView forKey:CPTabViewItemAuxViewKey];
00199 }
00200
00201 @end