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 CPTabView _tabView;
00063 }
00064
00065 - (id)init
00066 {
00067 return [self initWithIdentifier:@""];
00068 }
00069
00074 - (id)initWithIdentifier:(id)anIdentifier
00075 {
00076 self = [super init];
00077
00078 if (self)
00079 _identifier = anIdentifier;
00080
00081 return self;
00082 }
00083
00084
00089 - (void)setLabel:(CPString)aLabel
00090 {
00091 _label = aLabel;
00092 }
00093
00097 - (CPString)label
00098 {
00099 return _label;
00100 }
00101
00102
00106 - (CPTabState)tabState
00107 {
00108 return _tabState;
00109 }
00110
00111
00116 - (void)setIdentifier:(id)anIdentifier
00117 {
00118 _identifier = anIdentifier;
00119 }
00120
00124 - (id)identifier
00125 {
00126 return _identifier;
00127 }
00128
00129
00133 - (void)setView:(CPView)aView
00134 {
00135 _view = aView;
00136 }
00137
00141 - (CPView)view
00142 {
00143 return _view;
00144 }
00145
00146
00151 - (void)setAuxiliaryView:(CPView)anAuxiliaryView
00152 {
00153 _auxiliaryView = anAuxiliaryView;
00154 }
00155
00159 - (CPView)auxiliaryView
00160 {
00161 return _auxiliaryView;
00162 }
00163
00164
00168 - (CPTabView)tabView
00169 {
00170 return _tabView;
00171 }
00172
00176 - (void)_setTabView:(CPTabView)aView
00177 {
00178 _tabView = aView;
00179 }
00180
00181 @end
00182
00183 var CPTabViewItemIdentifierKey = "CPTabViewItemIdentifierKey",
00184 CPTabViewItemLabelKey = "CPTabViewItemLabelKey",
00185 CPTabViewItemViewKey = "CPTabViewItemViewKey",
00186 CPTabViewItemAuxViewKey = "CPTabViewItemAuxViewKey";
00187
00188
00189 @implementation CPTabViewItem (CPCoding)
00190
00191 - (id)initWithCoder:(CPCoder)aCoder
00192 {
00193 self = [super init];
00194
00195 if (self)
00196 {
00197 _identifier = [aCoder decodeObjectForKey:CPTabViewItemIdentifierKey];
00198 _label = [aCoder decodeObjectForKey:CPTabViewItemLabelKey];
00199
00200 _view = [aCoder decodeObjectForKey:CPTabViewItemViewKey];
00201 _auxiliaryView = [aCoder decodeObjectForKey:CPTabViewItemAuxViewKey];
00202 }
00203
00204 return self;
00205 }
00206
00207 - (void)encodeWithCoder:(CPCoder)aCoder
00208 {
00209 [aCoder encodeObject:_identifier forKey:CPTabViewItemIdentifierKey];
00210 [aCoder encodeObject:_label forKey:CPTabViewItemLabelKey];
00211
00212 [aCoder encodeObject:_view forKey:CPTabViewItemViewKey];
00213 [aCoder encodeObject:_auxiliaryView forKey:CPTabViewItemAuxViewKey];
00214 }
00215
00216 @end