- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
@interface MICheckBox : UIButton{
BOOL isChecked;
AppDelegate * appp;
}
@property(nonatomic,assign)BOOL isChecked;
@property(nonatomic,retain)AppDelegate * appp;
-(IBAction) checkBoxClicked:(id)tt;
@end
@implementation MICheckBox
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
appp=(AppDelegate *)[[UIApplication sharedApplication]delegate];
if (self) {
self.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
[self setImage:[UIImage imageNamed:@"cb_dark_off.png"] forState:UIControlStateNormal];
[self addTarget:self action:@selector(checkBoxClicked:)forControlEvents:UIControlEventTouchUpInside];
}
return self;
}
-(IBAction)checkBoxClicked:(id)tt{
MICheckBox *ss = (MICheckBox *)tt;
if(self.isChecked ==NO){
self.isChecked =YES;
[self setImage:[UIImage imageNamed:@"cb_dark_on.png"]forState:UIControlStateNormal];
int JumpTo_swichCase = ss.tag/1000;
NSLog(@"---------------------------------------------------------------");
NSLog(@"AAAAAAA Which Swich CASE==%d",JumpTo_swichCase);
switch (JumpTo_swichCase) {
case 12:{
if(ss.tag>=12100){
NSLog(@"AAAAAAA CK.tag=%d",ss.tag);
int GG = ss.tag;
GG=GG-12100;
NSLog(@"You have Cheked CK===%@",[appp.Arr_ZWhyDiditHappen objectAtIndex:GG]);
[appp.ArrSTATUS_CKWhyDidHappen addObject:[appp.Arr_ZWhyDiditHappen objectAtIndex:GG]];
}else if (ss.tag>=12000){
NSLog(@"AAAAAAA CK.tag=%d",ss.tag);
int GG = ss.tag;
GG=GG-12000;
NSLog(@"You have Cheked CK===%@",[appp.Arr_ZhowYouFelt objectAtIndex:GG]);
[appp.ArrSTATUS_CKHowyouFelt addObject:[appp.Arr_ZhowYouFelt objectAtIndex:GG]];
}
}break;
default:{
}break;
}
}
//------------------------------------------------------------------------------------------
else{
self.isChecked =NO;
[self setImage:[UIImage imageNamed:@"cb_dark_off.png"]forState:UIControlStateNormal];
int JumpTo_swichCase = ss.tag/1000;
NSLog(@"---------------------------------------------------------------");
NSLog(@"RRRRRRRR Which Swich CASE==%d",JumpTo_swichCase);
switch (JumpTo_swichCase) {
case 12:{
if(ss.tag>=12100){
NSLog(@"RRRRRRRR CK.tag=%d",ss.tag);
int GG = ss.tag;
GG=GG-12100;
NSLog(@"You have Cheked CK===%@",[appp.Arr_ZWhyDiditHappen objectAtIndex:GG]);
[appp.ArrSTATUS_CKWhyDidHappen removeObject:[appp.Arr_ZWhyDiditHappen objectAtIndex:GG]];
}else if (ss.tag>=12000){
NSLog(@"RRRRRRRR CK.tag=%d",ss.tag);
int GG = ss.tag;
GG=GG-12000;
NSLog(@"You have Cheked CK===%@",[appp.Arr_ZhowYouFelt objectAtIndex:GG]);
[appp.ArrSTATUS_CKHowyouFelt removeObject:[appp.Arr_ZhowYouFelt objectAtIndex:GG]];
}
}break;
default:{
}break;
}
}
}
Вот такой вот чекбокс. Пример использования внутри.
ArtFeel 18.10.2013 12:35 # −1
Horse2 18.10.2013 14:15 # −11
Lure Of Chaos 18.10.2013 20:31 # +2
под катом
an0nym 19.10.2013 06:04 # −4
guest 19.10.2013 09:31 # −18
tirinox 19.10.2013 18:51 # −3
guest 19.10.2013 21:02 # −5
jdryand 25.08.2021 04:09 # 0