@interface RefreshBar : UINavigationBar {
_H<UIProgressIndicator> indicator_;
_H<UITextLabel> prompt_;
- _H<UIProgressBar> progress_;
_H<UINavigationButton> cancel_;
}
frame.origin.y = ([self frame].size.height - frame.size.height) / 2;
[cancel_ setFrame:frame];
- CGSize prgsize = {75, 100};
- CGRect prgrect = {{
- [self frame].size.width - prgsize.width - 10,
- ([self frame].size.height - prgsize.height) / 2
- } , prgsize};
- [progress_ setFrame:prgrect];
-
CGSize indsize([UIProgressIndicator defaultSizeForStyle:[indicator_ activityIndicatorViewStyle]]);
unsigned indoffset = ([self frame].size.height - indsize.height) / 2;
CGRect indrect = {{indoffset, indoffset}, indsize};
[prompt_ setFont:[UIFont systemFontOfSize:15]];
[self addSubview:prompt_];
- progress_ = [[[UIProgressBar alloc] initWithFrame:CGRectZero] autorelease];
- [progress_ setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleLeftMargin];
- [(UIProgressBar *) progress_ setStyle:0];
- [self addSubview:progress_];
-
cancel_ = [[[UINavigationButton alloc] initWithTitle:UCLocalize("CANCEL") style:UINavigationButtonStyleHighlighted] autorelease];
[cancel_ setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin];
[cancel_ addTarget:delegate action:@selector(cancelPressed) forControlEvents:UIControlEventTouchUpInside];
- (void) start {
[prompt_ setText:UCLocalize("UPDATING_DATABASE")];
- [progress_ setProgress:0];
}
- (void) stop {
}
- (void) setProgress:(float)progress {
- [progress_ setProgress:progress];
}
@end