PageRenderTime 17ms CodeModel.GetById 9ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

/Frameworks/AppKit/browser.platform/CPRadio.j

http://github.com/jfahrenkrug/MapKit-HelloWorld
Unknown | 151 lines | 151 code | 0 blank | 0 comment | 0 complexity | 4ca451397b50896c5aedcba9432d0f04 MD5 | raw file
  1I;21;Foundation/CPObject.jI;18;Foundation/CPSet.ji;10;CPButton.jc;5034;
  2var _1=objj_allocateClassPair(CPButton,"CPRadio"),_2=_1.isa;
  3class_addIvars(_1,[new objj_ivar("_radioGroup")]);
  4objj_registerClassPair(_1);
  5objj_addClassForBundle(_1,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
  6class_addMethods(_1,[new objj_method(sel_getUid("initWithFrame:radioGroup:"),function(_3,_4,_5,_6){
  7with(_3){
  8_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPButton")},"initWithFrame:",_5);
  9if(_3){
 10objj_msgSend(_3,"setRadioGroup:",_6||objj_msgSend(CPRadioGroup,"new"));
 11objj_msgSend(_3,"setHighlightsBy:",CPContentsCellMask);
 12objj_msgSend(_3,"setShowsStateBy:",CPContentsCellMask);
 13objj_msgSend(_3,"setImagePosition:",CPImageLeft);
 14objj_msgSend(_3,"setAlignment:",CPLeftTextAlignment);
 15objj_msgSend(_3,"setBordered:",YES);
 16}
 17return _3;
 18}
 19}),new objj_method(sel_getUid("initWithFrame:"),function(_7,_8,_9){
 20with(_7){
 21return objj_msgSend(_7,"initWithFrame:radioGroup:",_9,nil);
 22}
 23}),new objj_method(sel_getUid("nextState"),function(_a,_b){
 24with(_a){
 25return CPOnState;
 26}
 27}),new objj_method(sel_getUid("setRadioGroup:"),function(_c,_d,_e){
 28with(_c){
 29if(_radioGroup===_e){
 30return;
 31}
 32objj_msgSend(_radioGroup,"_removeRadio:",_c);
 33_radioGroup=_e;
 34objj_msgSend(_radioGroup,"_addRadio:",_c);
 35}
 36}),new objj_method(sel_getUid("radioGroup"),function(_f,_10){
 37with(_f){
 38return _radioGroup;
 39}
 40}),new objj_method(sel_getUid("setObjectValue:"),function(_11,_12,_13){
 41with(_11){
 42objj_msgSendSuper({receiver:_11,super_class:objj_getClass("CPButton")},"setObjectValue:",_13);
 43if(objj_msgSend(_11,"state")===CPOnState){
 44objj_msgSend(_radioGroup,"_setSelectedRadio:",_11);
 45}
 46}
 47})]);
 48class_addMethods(_2,[new objj_method(sel_getUid("radioWithTitle:theme:"),function(_14,_15,_16,_17){
 49with(_14){
 50return objj_msgSend(_14,"buttonWithTitle:theme:",_16,_17);
 51}
 52}),new objj_method(sel_getUid("radioWithTitle:"),function(_18,_19,_1a){
 53with(_18){
 54return objj_msgSend(_18,"buttonWithTitle:",_1a);
 55}
 56}),new objj_method(sel_getUid("standardButtonWithTitle:"),function(_1b,_1c,_1d){
 57with(_1b){
 58var _1e=objj_msgSend(objj_msgSend(CPRadio,"alloc"),"init");
 59objj_msgSend(_1e,"setTitle:",_1d);
 60return _1e;
 61}
 62}),new objj_method(sel_getUid("themeClass"),function(_1f,_20){
 63with(_1f){
 64return "radio";
 65}
 66})]);
 67var _21="CPRadioRadioGroupKey";
 68var _1=objj_getClass("CPRadio");
 69if(!_1){
 70objj_exception_throw(new objj_exception(OBJJClassNotFoundException,"*** Could not find definition for class \"CPRadio\""));
 71}
 72var _2=_1.isa;
 73class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_22,_23,_24){
 74with(_22){
 75_22=objj_msgSendSuper({receiver:_22,super_class:objj_getClass("CPButton")},"initWithCoder:",_24);
 76if(_22){
 77_radioGroup=objj_msgSend(_24,"decodeObjectForKey:",_21);
 78}
 79return _22;
 80}
 81}),new objj_method(sel_getUid("encodeWithCoder:"),function(_25,_26,_27){
 82with(_25){
 83objj_msgSendSuper({receiver:_25,super_class:objj_getClass("CPButton")},"encodeWithCoder:",_27);
 84objj_msgSend(_27,"encodeObject:forKey:",_radioGroup,_21);
 85}
 86})]);
 87var _1=objj_allocateClassPair(CPObject,"CPRadioGroup"),_2=_1.isa;
 88class_addIvars(_1,[new objj_ivar("_radios"),new objj_ivar("_selectedRadio")]);
 89objj_registerClassPair(_1);
 90objj_addClassForBundle(_1,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
 91class_addMethods(_1,[new objj_method(sel_getUid("init"),function(_28,_29){
 92with(_28){
 93_28=objj_msgSendSuper({receiver:_28,super_class:objj_getClass("CPObject")},"init");
 94if(_28){
 95_radios=objj_msgSend(CPSet,"set");
 96_selectedRadio=nil;
 97}
 98return _28;
 99}
100}),new objj_method(sel_getUid("_addRadio:"),function(_2a,_2b,_2c){
101with(_2a){
102objj_msgSend(_radios,"addObject:",_2c);
103if(objj_msgSend(_2c,"state")===CPOnState){
104objj_msgSend(_2a,"_setSelectedRadio:",_2c);
105}
106}
107}),new objj_method(sel_getUid("_removeRadio:"),function(_2d,_2e,_2f){
108with(_2d){
109if(_selectedRadio===_2f){
110_selectedRadio=nil;
111}
112objj_msgSend(_radios,"removeObject:",_2f);
113}
114}),new objj_method(sel_getUid("_setSelectedRadio:"),function(_30,_31,_32){
115with(_30){
116if(_selectedRadio===_32){
117return;
118}
119objj_msgSend(_selectedRadio,"setState:",CPOffState);
120_selectedRadio=_32;
121}
122}),new objj_method(sel_getUid("selectedRadio"),function(_33,_34){
123with(_33){
124return _selectedRadio;
125}
126}),new objj_method(sel_getUid("radios"),function(_35,_36){
127with(_35){
128return objj_msgSend(_radios,"allObjects");
129}
130})]);
131var _37="CPRadioGroupRadiosKey",_38="CPRadioGroupSelectedRadioKey";
132var _1=objj_getClass("CPRadioGroup");
133if(!_1){
134objj_exception_throw(new objj_exception(OBJJClassNotFoundException,"*** Could not find definition for class \"CPRadioGroup\""));
135}
136var _2=_1.isa;
137class_addMethods(_1,[new objj_method(sel_getUid("initWithCoder:"),function(_39,_3a,_3b){
138with(_39){
139_39=objj_msgSendSuper({receiver:_39,super_class:objj_getClass("CPObject")},"init");
140if(_39){
141_radios=objj_msgSend(_3b,"decodeObjectForKey:",_37);
142_selectedRadio=objj_msgSend(_3b,"decodeObjectForKey:",_38);
143}
144return _39;
145}
146}),new objj_method(sel_getUid("encodeWithCoder:"),function(_3c,_3d,_3e){
147with(_3c){
148objj_msgSend(_3e,"encodeObject:forKey:",_radios,_37);
149objj_msgSend(_3e,"encodeObject:forKey:",_selectedRadio,_38);
150}
151})]);