-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEyeCandy.m
67 lines (57 loc) · 2.3 KB
/
EyeCandy.m
1
2
3
4
5
6
7
8
9
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
#import "EyeCandy.h"
#import "NSLogX.h"
@implementation EyeCandy
- (void) showStandardAlert:(NSString *)title closeBtnTitle:(NSString *)closeTitle withError:(NSError *)error
{
alertButton = [NSArray arrayWithObjects:closeTitle,nil];
alert = [[UIAlertSheet alloc] initWithTitle:title buttons:alertButton defaultButtonIndex:0 delegate:self context:nil];
[alert setBodyText: [error localizedDescription]];
[alert popupAlertAnimated: TRUE];
}
- (void) showStandardAlertWithString:(NSString *)title closeBtnTitle:(NSString *)closeTitle withError:(NSString *)error
{
alertButton = [NSArray arrayWithObjects:closeTitle,nil];
alert = [[UIAlertSheet alloc] initWithTitle:title buttons:alertButton defaultButtonIndex:0 delegate:self context:nil];
[alert setBodyText: error];
[alert popupAlertAnimated: TRUE];
}
- (void) showAlertWithTitle:(NSString *)title closeBtnTitle:(NSString *)closeTitle withText:(NSString *)string andStyle:(int) style
{
alertButton = [NSArray arrayWithObjects:closeTitle,nil];
alert = [[UIAlertSheet alloc] initWithTitle:title buttons:alertButton defaultButtonIndex:0 delegate:self context:nil];
[alert setBodyText: string];
[alert setAlertSheetStyle: style];
[alert popupAlertAnimated: TRUE];
}
- (void) showAlertYesNoWithTitle:(NSString *)title withText:(NSString *)string andStyle:(int) style andDelegate:(id) delegate andContext:(id) context
{
//alertButton = [NSArray arrayWithObjects:closeTitle,nil];
alert = [[ UIAlertSheet alloc ] initWithFrame: CGRectMake(0, 240, 320, 240) ];
[alert setTitle: title];
[alert setBodyText: string];
[alert setContext: context];
[alert addButtonWithTitle:NSLocalizedString(@"YES", @"YES")];
[alert setDestructiveButton: [alert addButtonWithTitle:NSLocalizedString(@"NO", @"NO")]];
[alert setDelegate: delegate];
[alert setAlertSheetStyle: style];
[alert popupAlertAnimated: TRUE];
}
- (void) alertSheet: (UIAlertSheet*)sheet buttonClicked:(int)button
{
NSLogX(@"alert butt %d\n", button);
[sheet dismissAnimated: TRUE];
}
- (void)showProgressHUD:(NSString *)label withView:(UIView *)v withRect:(struct CGRect)rect
{
progress = [[UIProgressHUD alloc] initWithFrame: rect];
[progress setText: label];
//[progress drawRect: rect];
[progress show: YES];
[v addSubview:progress];
}
- (void)hideProgressHUD
{
[progress show: NO];
[progress removeFromSuperview];
}
@end