PageRenderTime 28ms CodeModel.GetById 15ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/Frameworks/AppKit/browser.platform/CPTabView.j

http://github.com/polymar/polish
Unknown | 428 lines | 428 code | 0 blank | 0 comment | 0 complexity | 7fd8ea4359d770d4a8705f7a28cf5972 MD5 | raw file
  1i;13;CPImageView.ji;15;CPTabViewItem.ji;8;CPView.jc;18589;
  2CPTopTabsBezelBorder=0;
  3CPNoTabsBezelBorder=4;
  4CPNoTabsLineBorder=5;
  5CPNoTabsNoBorder=6;
  6var _1=nil,_2=nil,_3=nil,_4=nil,_5=nil;
  7var _6=7,_7=7;
  8var _8=1,_9=2,_a=4,_b=8;
  9var _c=objj_allocateClassPair(CPView,"CPTabView"),_d=_c.isa;
 10class_addIvars(_c,[new objj_ivar("_labelsView"),new objj_ivar("_backgroundView"),new objj_ivar("_separatorView"),new objj_ivar("_auxiliaryView"),new objj_ivar("_contentView"),new objj_ivar("_tabViewItems"),new objj_ivar("_selectedTabViewItem"),new objj_ivar("_tabViewType"),new objj_ivar("_delegate"),new objj_ivar("_delegateSelectors")]);
 11objj_registerClassPair(_c);
 12objj_addClassForBundle(_c,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
 13class_addMethods(_c,[new objj_method(sel_getUid("initWithFrame:"),function(_e,_f,_10){
 14with(_e){
 15_e=objj_msgSendSuper({receiver:_e,super_class:objj_getClass("CPView")},"initWithFrame:",_10);
 16if(_e){
 17_tabViewType=CPTopTabsBezelBorder;
 18_tabViewItems=[];
 19}
 20return _e;
 21}
 22}),new objj_method(sel_getUid("viewDidMoveToWindow"),function(_11,_12){
 23with(_11){
 24if(_tabViewType!=CPTopTabsBezelBorder||_labelsView){
 25return;
 26}
 27objj_msgSend(_11,"_createBezelBorder");
 28objj_msgSend(_11,"layoutSubviews");
 29}
 30}),new objj_method(sel_getUid("_createBezelBorder"),function(_13,_14){
 31with(_13){
 32var _15=objj_msgSend(_13,"bounds");
 33_labelsView=objj_msgSend(objj_msgSend(_CPTabLabelsView,"alloc"),"initWithFrame:",CGRectMake(0,0,CGRectGetWidth(_15),0));
 34objj_msgSend(_labelsView,"setTabView:",_13);
 35objj_msgSend(_labelsView,"setAutoresizingMask:",CPViewWidthSizable);
 36objj_msgSend(_13,"addSubview:",_labelsView);
 37_backgroundView=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectMakeZero());
 38objj_msgSend(_backgroundView,"setBackgroundColor:",_5);
 39objj_msgSend(_backgroundView,"setAutoresizingMask:",CPViewWidthSizable|CPViewHeightSizable);
 40objj_msgSend(_13,"addSubview:",_backgroundView);
 41_separatorView=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectMakeZero());
 42objj_msgSend(_separatorView,"setBackgroundColor:",objj_msgSend(objj_msgSend(_13,"class"),"bezelBorderColor"));
 43objj_msgSend(_separatorView,"setAutoresizingMask:",CPViewWidthSizable|CPViewMaxYMargin);
 44objj_msgSend(_13,"addSubview:",_separatorView);
 45}
 46}),new objj_method(sel_getUid("layoutSubviews"),function(_16,_17){
 47with(_16){
 48if(_tabViewType==CPTopTabsBezelBorder){
 49var _18=objj_msgSend(_16,"bounds"),_19=objj_msgSend(_CPTabLabelsView,"height");
 50_18.origin.y+=_19;
 51_18.size.height-=_19;
 52objj_msgSend(_backgroundView,"setFrame:",_18);
 53var _1a=5;
 54if(_auxiliaryView){
 55_1a=CGRectGetHeight(objj_msgSend(_auxiliaryView,"frame"));
 56objj_msgSend(_auxiliaryView,"setFrame:",CGRectMake(_6,_19,CGRectGetWidth(_18)-_6-_7,_1a));
 57}
 58objj_msgSend(_separatorView,"setFrame:",CGRectMake(_6,_19+_1a,CGRectGetWidth(_18)-_6-_7,1));
 59}
 60objj_msgSend(_contentView,"setFrame:",objj_msgSend(_16,"contentRect"));
 61}
 62}),new objj_method(sel_getUid("addTabViewItem:"),function(_1b,_1c,_1d){
 63with(_1b){
 64objj_msgSend(_1b,"insertTabViewItem:atIndex:",_1d,objj_msgSend(_tabViewItems,"count"));
 65}
 66}),new objj_method(sel_getUid("insertTabViewItem:atIndex:"),function(_1e,_1f,_20,_21){
 67with(_1e){
 68if(!_labelsView&&_tabViewType==CPTopTabsBezelBorder){
 69objj_msgSend(_1e,"_createBezelBorder");
 70}
 71objj_msgSend(_tabViewItems,"insertObject:atIndex:",_20,_21);
 72objj_msgSend(_labelsView,"tabView:didAddTabViewItem:",_1e,_20);
 73if(objj_msgSend(_tabViewItems,"count")==1){
 74objj_msgSend(_1e,"selectFirstTabViewItem:",_1e);
 75}
 76if(_delegateSelectors&_b){
 77objj_msgSend(_delegate,"tabViewDidChangeNumberOfTabViewItems:",_1e);
 78}
 79}
 80}),new objj_method(sel_getUid("removeTabViewItem:"),function(_22,_23,_24){
 81with(_22){
 82objj_msgSend(_tabViewItems,"removeObjectIdenticalTo:",_24);
 83objj_msgSend(_labelsView,"tabView:didRemoveTabViewItem:",_22,_24);
 84if(_delegateSelectors&_b){
 85objj_msgSend(_delegate,"tabViewDidChangeNumberOfTabViewItems:",_22);
 86}
 87}
 88}),new objj_method(sel_getUid("indexOfTabViewItem:"),function(_25,_26,_27){
 89with(_25){
 90return objj_msgSend(_tabViewItems,"indexOfObjectIdenticalTo:",_27);
 91}
 92}),new objj_method(sel_getUid("indexOfTabViewItemWithIdentifier:"),function(_28,_29,_2a){
 93with(_28){
 94var _2b=0,_2c=objj_msgSend(_tabViewItems,"count");
 95for(;_2b<_2c;++_2b){
 96if(objj_msgSend(objj_msgSend(_tabViewItems[_2b],"identifier"),"isEqual:",_2a)){
 97return _2b;
 98}
 99}
100return _2b;
101}
102}),new objj_method(sel_getUid("numberOfTabViewItems"),function(_2d,_2e){
103with(_2d){
104return objj_msgSend(_tabViewItems,"count");
105}
106}),new objj_method(sel_getUid("tabViewItemAtIndex:"),function(_2f,_30,_31){
107with(_2f){
108return _tabViewItems[_31];
109}
110}),new objj_method(sel_getUid("tabViewItems"),function(_32,_33){
111with(_32){
112return _tabViewItems;
113}
114}),new objj_method(sel_getUid("selectFirstTabViewItem:"),function(_34,_35,_36){
115with(_34){
116var _37=objj_msgSend(_tabViewItems,"count");
117if(_37){
118objj_msgSend(_34,"selectTabViewItemAtIndex:",0);
119}
120}
121}),new objj_method(sel_getUid("selectLastTabViewItem:"),function(_38,_39,_3a){
122with(_38){
123var _3b=objj_msgSend(_tabViewItems,"count");
124if(_3b){
125objj_msgSend(_38,"selectTabViewItemAtIndex:",_3b-1);
126}
127}
128}),new objj_method(sel_getUid("selectNextTabViewItem:"),function(_3c,_3d,_3e){
129with(_3c){
130if(!_selectedTabViewItem){
131return;
132}
133var _3f=objj_msgSend(_3c,"indexOfTabViewItem:",_selectedTabViewItem),_40=objj_msgSend(_tabViewItems,"count");
134objj_msgSend(_3c,"selectTabViewItemAtIndex:",_3f+1%_40);
135}
136}),new objj_method(sel_getUid("selectPreviousTabViewItem:"),function(_41,_42,_43){
137with(_41){
138if(!_selectedTabViewItem){
139return;
140}
141var _44=objj_msgSend(_41,"indexOfTabViewItem:",_selectedTabViewItem),_45=objj_msgSend(_tabViewItems,"count");
142objj_msgSend(_41,"selectTabViewItemAtIndex:",_44==0?_45:_44-1);
143}
144}),new objj_method(sel_getUid("selectTabViewItem:"),function(_46,_47,_48){
145with(_46){
146if((_delegateSelectors&_9)&&!objj_msgSend(_delegate,"tabView:shouldSelectTabViewItem:",_46,_48)){
147return;
148}
149if(_delegateSelectors&_a){
150objj_msgSend(_delegate,"tabView:willSelectTabViewItem:",_46,_48);
151}
152if(_selectedTabViewItem){
153_selectedTabViewItem._tabState=CPBackgroundTab;
154objj_msgSend(_labelsView,"tabView:didChangeStateOfTabViewItem:",_46,_selectedTabViewItem);
155objj_msgSend(_contentView,"removeFromSuperview");
156objj_msgSend(_auxiliaryView,"removeFromSuperview");
157}
158_selectedTabViewItem=_48;
159_selectedTabViewItem._tabState=CPSelectedTab;
160_contentView=objj_msgSend(_selectedTabViewItem,"view");
161objj_msgSend(_contentView,"setAutoresizingMask:",CPViewWidthSizable|CPViewHeightSizable);
162_auxiliaryView=objj_msgSend(_selectedTabViewItem,"auxiliaryView");
163objj_msgSend(_auxiliaryView,"setAutoresizingMask:",CPViewWidthSizable);
164objj_msgSend(_46,"addSubview:",_contentView);
165if(_auxiliaryView){
166objj_msgSend(_46,"addSubview:",_auxiliaryView);
167}
168objj_msgSend(_labelsView,"tabView:didChangeStateOfTabViewItem:",_46,_selectedTabViewItem);
169objj_msgSend(_46,"layoutSubviews");
170if(_delegateSelectors&_8){
171objj_msgSend(_delegate,"tabView:didSelectTabViewItem:",_46,_48);
172}
173}
174}),new objj_method(sel_getUid("selectTabViewItemAtIndex:"),function(_49,_4a,_4b){
175with(_49){
176objj_msgSend(_49,"selectTabViewItem:",_tabViewItems[_4b]);
177}
178}),new objj_method(sel_getUid("selectedTabViewItem"),function(_4c,_4d){
179with(_4c){
180return _selectedTabViewItem;
181}
182}),new objj_method(sel_getUid("setTabViewType:"),function(_4e,_4f,_50){
183with(_4e){
184if(_tabViewType==_50){
185return;
186}
187_tabViewType=_50;
188if(_tabViewType==CPNoTabsBezelBorder||_tabViewType==CPNoTabsLineBorder||_tabViewType==CPNoTabsNoBorder){
189objj_msgSend(_labelsView,"removeFromSuperview");
190}else{
191if(!objj_msgSend(_labelsView,"superview")){
192objj_msgSend(_4e,"addSubview:",_labelsView);
193}
194}
195if(_tabViewType==CPNoTabsLineBorder||_tabViewType==CPNoTabsNoBorder){
196objj_msgSend(_backgroundView,"removeFromSuperview");
197}else{
198if(!objj_msgSend(_backgroundView,"superview")){
199objj_msgSend(_4e,"addSubview:",_backgroundView);
200}
201}
202objj_msgSend(_4e,"layoutSubviews");
203}
204}),new objj_method(sel_getUid("tabViewType"),function(_51,_52){
205with(_51){
206return _tabViewType;
207}
208}),new objj_method(sel_getUid("contentRect"),function(_53,_54){
209with(_53){
210var _55=CGRectMakeCopy(objj_msgSend(_53,"bounds"));
211if(_tabViewType==CPTopTabsBezelBorder){
212var _56=objj_msgSend(_CPTabLabelsView,"height"),_57=_auxiliaryView?CGRectGetHeight(objj_msgSend(_auxiliaryView,"frame")):5,_58=1;
213_55.origin.y+=_56+_57+_58;
214_55.size.height-=_56+_57+_58*2;
215_55.origin.x+=_6;
216_55.size.width-=_6+_7;
217}
218return _55;
219}
220}),new objj_method(sel_getUid("setDelegate:"),function(_59,_5a,_5b){
221with(_59){
222if(_delegate==_5b){
223return;
224}
225_delegate=_5b;
226_delegateSelectors=0;
227if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tabView:shouldSelectTabViewItem:"))){
228_delegateSelectors|=_9;
229}
230if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tabView:willSelectTabViewItem:"))){
231_delegateSelectors|=_a;
232}
233if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tabView:didSelectTabViewItem:"))){
234_delegateSelectors|=_8;
235}
236if(objj_msgSend(_delegate,"respondsToSelector:",sel_getUid("tabViewDidChangeNumberOfTabViewItems:"))){
237_delegateSelectors|=_b;
238}
239}
240}),new objj_method(sel_getUid("mouseDown:"),function(_5c,_5d,_5e){
241with(_5c){
242var _5f=objj_msgSend(_labelsView,"convertPoint:fromView:",objj_msgSend(_5e,"locationInWindow"),nil),_60=objj_msgSend(_labelsView,"representedTabViewItemAtPoint:",_5f);
243if(_60){
244objj_msgSend(_5c,"selectTabViewItem:",_60);
245}
246}
247})]);
248class_addMethods(_d,[new objj_method(sel_getUid("initialize"),function(_61,_62){
249with(_61){
250if(_61!=CPTabView){
251return;
252}
253var _63=objj_msgSend(CPBundle,"bundleForClass:",_61),_64=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initByReferencingFile:size:","",CGSizeMake(7,0)),_65=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_63,"pathForResource:","CPTabView/CPTabViewBezelBackgroundCenter.png"),CGSizeMake(1,1)),_66=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_63,"pathForResource:","CPTabView/CPTabViewBezelBorderLeft.png"),CGSizeMake(7,1)),_67=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_63,"pathForResource:","CPTabView/CPTabViewBezelBorder.png"),CGSizeMake(1,1)),_68=objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_63,"pathForResource:","CPTabView/CPTabViewBezelBorderRight.png"),CGSizeMake(7,1));
254_5=objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPNinePartImage,"alloc"),"initWithImageSlices:",[_64,_64,_64,_66,_65,_68,_66,_67,_68]));
255_4=objj_msgSend(CPColor,"colorWithPatternImage:",_67);
256}
257}),new objj_method(sel_getUid("bezelBorderColor"),function(_69,_6a){
258with(_69){
259return _4;
260}
261})]);
262var _6b="CPTabViewItemsKey",_6c="CPTabViewSelectedItemKey",_6d="CPTabViewTypeKey",_6e="CPTabViewDelegateKey";
263var _c=objj_getClass("CPTabView");
264if(!_c){
265objj_exception_throw(new objj_exception(OBJJClassNotFoundException,"*** Could not find definition for class \"CPTabView\""));
266}
267var _d=_c.isa;
268class_addMethods(_c,[new objj_method(sel_getUid("initWithCoder:"),function(_6f,_70,_71){
269with(_6f){
270if(_6f=objj_msgSendSuper({receiver:_6f,super_class:objj_getClass("CPView")},"initWithCoder:",_71)){
271_tabViewType=objj_msgSend(_71,"decodeIntForKey:",_6d);
272_tabViewItems=[];
273objj_msgSend(_6f,"_createBezelBorder");
274var _72=objj_msgSend(_71,"decodeObjectForKey:",_6b);
275for(var i=0;_72&&i<_72.length;i++){
276objj_msgSend(_6f,"insertTabViewItem:atIndex:",_72[i],i);
277}
278var _74=objj_msgSend(_71,"decodeObjectForKey:",_6c);
279if(_74){
280objj_msgSend(_6f,"selectTabViewItem:",_74);
281}
282objj_msgSend(_6f,"setDelegate:",objj_msgSend(_71,"decodeObjectForKey:",_6e));
283}
284return _6f;
285}
286}),new objj_method(sel_getUid("encodeWithCoder:"),function(_75,_76,_77){
287with(_75){
288var _78=_subviews;
289_subviews=[];
290objj_msgSendSuper({receiver:_75,super_class:objj_getClass("CPView")},"encodeWithCoder:",_77);
291_subviews=_78;
292objj_msgSend(_77,"encodeObject:forKey:",_tabViewItems,_6b);
293objj_msgSend(_77,"encodeObject:forKey:",_selectedTabViewItem,_6c);
294objj_msgSend(_77,"encodeInt:forKey:",_tabViewType,_6d);
295objj_msgSend(_77,"encodeConditionalObject:forKey:",_delegate,_6e);
296}
297})]);
298var _79=nil,_7a=10,_7b=15;
299var _c=objj_allocateClassPair(CPView,"_CPTabLabelsView"),_d=_c.isa;
300class_addIvars(_c,[new objj_ivar("_tabView"),new objj_ivar("_tabLabels")]);
301objj_registerClassPair(_c);
302objj_addClassForBundle(_c,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
303class_addMethods(_c,[new objj_method(sel_getUid("initWithFrame:"),function(_7c,_7d,_7e){
304with(_7c){
305_7c=objj_msgSendSuper({receiver:_7c,super_class:objj_getClass("CPView")},"initWithFrame:",_7e);
306if(_7c){
307_tabLabels=[];
308objj_msgSend(_7c,"setBackgroundColor:",_79);
309objj_msgSend(_7c,"setFrameSize:",CGSizeMake(CGRectGetWidth(_7e),26));
310}
311return _7c;
312}
313}),new objj_method(sel_getUid("setTabView:"),function(_7f,_80,_81){
314with(_7f){
315_tabView=_81;
316}
317}),new objj_method(sel_getUid("tabView"),function(_82,_83){
318with(_82){
319return _tabView;
320}
321}),new objj_method(sel_getUid("tabView:didAddTabViewItem:"),function(_84,_85,_86,_87){
322with(_84){
323var _88=objj_msgSend(objj_msgSend(_CPTabLabel,"alloc"),"initWithFrame:",CGRectMakeZero());
324objj_msgSend(_88,"setTabViewItem:",_87);
325_tabLabels.push(_88);
326objj_msgSend(_84,"addSubview:",_88);
327objj_msgSend(_84,"layoutSubviews");
328}
329}),new objj_method(sel_getUid("tabView:didRemoveTabViewItem:"),function(_89,_8a,_8b,_8c){
330with(_89){
331var _8d=objj_msgSend(_8b,"indexOfTabViewItem:",_8c),_8e=_tabLabels[_8d];
332objj_msgSend(_tabLabels,"removeObjectAtIndex:",_8d);
333objj_msgSend(_8e,"removeFromSuperview");
334objj_msgSend(_89,"layoutSubviews");
335}
336}),new objj_method(sel_getUid("tabView:didChangeStateOfTabViewItem:"),function(_8f,_90,_91,_92){
337with(_8f){
338objj_msgSend(_tabLabels[objj_msgSend(_91,"indexOfTabViewItem:",_92)],"setTabState:",objj_msgSend(_92,"tabState"));
339}
340}),new objj_method(sel_getUid("representedTabViewItemAtPoint:"),function(_93,_94,_95){
341with(_93){
342var _96=0,_97=_tabLabels.length;
343for(;_96<_97;++_96){
344var _98=_tabLabels[_96];
345if(CGRectContainsPoint(objj_msgSend(_98,"frame"),_95)){
346return objj_msgSend(_98,"tabViewItem");
347}
348}
349return nil;
350}
351}),new objj_method(sel_getUid("layoutSubviews"),function(_99,_9a){
352with(_99){
353var _9b=0,_9c=_tabLabels.length,_9d=((objj_msgSend(_99,"bounds").size.width)-(_9c-1)*_7a-2*_7b)/_9c,x=_7b;
354for(;_9b<_9c;++_9b){
355var _9f=_tabLabels[_9b],_a0={origin:{x:x,y:8},size:{width:_9d,height:18}};
356objj_msgSend(_9f,"setFrame:",_a0);
357x=(_a0.origin.x+_a0.size.width)+_7a;
358}
359}
360}),new objj_method(sel_getUid("setFrameSize:"),function(_a1,_a2,_a3){
361with(_a1){
362if(CGSizeEqualToSize(objj_msgSend(_a1,"frame").size,_a3)){
363return;
364}
365objj_msgSendSuper({receiver:_a1,super_class:objj_getClass("CPView")},"setFrameSize:",_a3);
366objj_msgSend(_a1,"layoutSubviews");
367}
368})]);
369class_addMethods(_d,[new objj_method(sel_getUid("initialize"),function(_a4,_a5){
370with(_a4){
371if(_a4!=objj_msgSend(_CPTabLabelsView,"class")){
372return;
373}
374var _a6=objj_msgSend(CPBundle,"bundleForClass:",_a4);
375_79=objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPThreePartImage,"alloc"),"initWithImageSlices:isVertical:",[objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_a6,"pathForResource:","CPTabView/_CPTabLabelsViewLeft.png"),CGSizeMake(12,26)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_a6,"pathForResource:","CPTabView/_CPTabLabelsViewCenter.png"),CGSizeMake(1,26)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_a6,"pathForResource:","CPTabView/_CPTabLabelsViewRight.png"),CGSizeMake(12,26))],NO));
376}
377}),new objj_method(sel_getUid("height"),function(_a7,_a8){
378with(_a7){
379return 26;
380}
381})]);
382var _a9=nil,_aa=nil;
383var _c=objj_allocateClassPair(CPView,"_CPTabLabel"),_d=_c.isa;
384class_addIvars(_c,[new objj_ivar("_tabViewItem"),new objj_ivar("_labelField")]);
385objj_registerClassPair(_c);
386objj_addClassForBundle(_c,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
387class_addMethods(_c,[new objj_method(sel_getUid("initWithFrame:"),function(_ab,_ac,_ad){
388with(_ab){
389_ab=objj_msgSendSuper({receiver:_ab,super_class:objj_getClass("CPView")},"initWithFrame:",_ad);
390if(_ab){
391_labelField=objj_msgSend(objj_msgSend(CPTextField,"alloc"),"initWithFrame:",CGRectMakeZero());
392objj_msgSend(_labelField,"setAlignment:",CPCenterTextAlignment);
393objj_msgSend(_labelField,"setFrame:",CGRectMake(5,0,CGRectGetWidth(_ad)-10,20));
394objj_msgSend(_labelField,"setAutoresizingMask:",CPViewWidthSizable);
395objj_msgSend(_labelField,"setFont:",objj_msgSend(CPFont,"boldSystemFontOfSize:",11));
396objj_msgSend(_ab,"addSubview:",_labelField);
397objj_msgSend(_ab,"setTabState:",CPBackgroundTab);
398}
399return _ab;
400}
401}),new objj_method(sel_getUid("setTabState:"),function(_ae,_af,_b0){
402with(_ae){
403objj_msgSend(_ae,"setBackgroundColor:",_b0==CPSelectedTab?_aa:_a9);
404}
405}),new objj_method(sel_getUid("setTabViewItem:"),function(_b1,_b2,_b3){
406with(_b1){
407_tabViewItem=_b3;
408objj_msgSend(_b1,"update");
409}
410}),new objj_method(sel_getUid("tabViewItem"),function(_b4,_b5){
411with(_b4){
412return _tabViewItem;
413}
414}),new objj_method(sel_getUid("update"),function(_b6,_b7){
415with(_b6){
416objj_msgSend(_labelField,"setStringValue:",objj_msgSend(_tabViewItem,"label"));
417}
418})]);
419class_addMethods(_d,[new objj_method(sel_getUid("initialize"),function(_b8,_b9){
420with(_b8){
421if(_b8!=objj_msgSend(_CPTabLabel,"class")){
422return;
423}
424var _ba=objj_msgSend(CPBundle,"bundleForClass:",_b8);
425_a9=objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPThreePartImage,"alloc"),"initWithImageSlices:isVertical:",[objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_ba,"pathForResource:","CPTabView/_CPTabLabelBackgroundLeft.png"),CGSizeMake(6,18)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_ba,"pathForResource:","CPTabView/_CPTabLabelBackgroundCenter.png"),CGSizeMake(1,18)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_ba,"pathForResource:","CPTabView/_CPTabLabelBackgroundRight.png"),CGSizeMake(6,18))],NO));
426_aa=objj_msgSend(CPColor,"colorWithPatternImage:",objj_msgSend(objj_msgSend(CPThreePartImage,"alloc"),"initWithImageSlices:isVertical:",[objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_ba,"pathForResource:","CPTabView/_CPTabLabelSelectedLeft.png"),CGSizeMake(3,18)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_ba,"pathForResource:","CPTabView/_CPTabLabelSelectedCenter.png"),CGSizeMake(1,18)),objj_msgSend(objj_msgSend(CPImage,"alloc"),"initWithContentsOfFile:size:",objj_msgSend(_ba,"pathForResource:","CPTabView/_CPTabLabelSelectedRight.png"),CGSizeMake(3,18))],NO));
427}
428})]);