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
00052 @implementation CPTabViewItem : CPObject
00053 {
00054 id _identifier;
00055 CPString _label;
00056
00057 CPView _view;
00058 CPView _auxiliaryView;
00059 }
00060
00065 - (id)initWithIdentifier:(id)anIdentifier
00066 {
00067 self = [super init];
00068
00069 if (self)
00070 _identifier = anIdentifier;
00071
00072 return self;
00073 }
00074
00075
00080 - (void)setLabel:(CPString)aLabel
00081 {
00082 _label = aLabel;
00083 }
00084
00088 - (CPString)label
00089 {
00090 return _label;
00091 }
00092
00093
00097 - (CPTabState)tabState
00098 {
00099 return _tabState;
00100 }
00101
00102
00107 - (void)setIdentifier:(id)anIdentifier
00108 {
00109 _identifier = anIdentifier;
00110 }
00111
00115 - (id)identifier
00116 {
00117 return _identifier;
00118 }
00119
00120
00124 - (void)setView:(CPView)aView
00125 {
00126 _view = aView;
00127 }
00128
00132 - (CPView)view
00133 {
00134 return _view;
00135 }
00136
00137
00142 - (void)setAuxiliaryView:(CPView)anAuxiliaryView
00143 {
00144 _auxiliaryView = anAuxiliaryView;
00145 }
00146
00150 - (CPView)auxiliaryView
00151 {
00152 return _auxiliaryView;
00153 }
00154
00155
00159 - (CPTabView)tabView
00160 {
00161 return _tabView;
00162 }
00163
00164 @end
00165
00166 var CPTabViewItemIdentifierKey = "CPTabViewItemIdentifierKey",
00167 CPTabViewItemLabelKey = "CPTabViewItemLabelKey",
00168 CPTabViewItemViewKey = "CPTabViewItemViewKey",
00169 CPTabViewItemAuxViewKey = "CPTabViewItemAuxViewKey";
00170
00171
00172 @implementation CPTabViewItem (CPCoding)
00173
00174 - (id)initWithCoder:(CPCoder)aCoder
00175 {
00176 self = [super init];
00177
00178 if (self)
00179 {
00180 _identifier = [aCoder decodeObjectForKey:CPTabViewItemIdentifierKey];
00181 _label = [aCoder decodeObjectForKey:CPTabViewItemLabelKey];
00182
00183 _view = [aCoder decodeObjectForKey:CPTabViewItemViewKey];
00184 _auxiliaryView = [aCoder decodeObjectForKey:CPTabViewItemAuxViewKey];
00185
00186 CPLog.warn("_identifier="+_identifier+" _label="+_label+" _view="+_view+" _auxiliaryView="+_auxiliaryView);
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