Permalink
Browse files

added slide progress display and progress bar

  • Loading branch information...
1 parent 44be07c commit f09301f1488aab9da929315a6fd4ee7def528cd5 @schacon committed May 6, 2010
Showing with 195 additions and 98 deletions.
  1. +11 −1 Classes/ShowOffPadViewController.h
  2. +14 −1 Classes/ShowOffPadViewController.m
  3. +161 −96 ShowOffPadViewController.xib
  4. +9 −0 TODO
@@ -13,7 +13,11 @@
UIButton *nextButton;
UIButton *prevButton;
UIButton *footerButton;
- UILabel *notesArea;
+ UILabel *notesArea;
+ UILabel *slideProgress;
+ UILabel *timeElapsed;
+ UIProgressView *slideProgressBar;
+ UIProgressView *timeProgress;
}
@property(nonatomic,retain) UIWebView *webDisplayiPad;
@@ -22,10 +26,16 @@
@property (nonatomic, retain) IBOutlet UIButton *prevButton;
@property (nonatomic, retain) IBOutlet UIButton *footerButton;
@property (nonatomic, retain) IBOutlet UILabel *notesArea;
+@property (nonatomic, retain) IBOutlet UILabel *slideProgress;
+@property (nonatomic, retain) IBOutlet UILabel *timeElapsed;
+@property (nonatomic, retain) IBOutlet UIProgressView *slideProgressBar;
+@property (nonatomic, retain) IBOutlet UIProgressView *timeProgress;
- (IBAction)doNextButton;
- (IBAction)doPrevButton;
- (IBAction)doFooterButton;
+- (void) updateProgress;
+
@end
@@ -11,7 +11,8 @@
@implementation ShowOffPadViewController
@synthesize webDisplayiPad;
-@synthesize nextButton, prevButton, footerButton, notesArea;
+@synthesize nextButton, prevButton, footerButton, notesArea, slideProgress, timeElapsed;
+@synthesize slideProgressBar, timeProgress;
- (void)viewDidLoad {
NSString *urlAddress = @"http://localhost:9090";
@@ -32,13 +33,25 @@ - (IBAction) doNextButton {
if (![output isEqualToString:@""]) {
notesArea.text = output;
}
+ [self updateProgress];
}
- (IBAction) doPrevButton {
NSString *output = [webDisplayiPad stringByEvaluatingJavaScriptFromString:@"prevStep()"];
if (![output isEqualToString:@""]) {
notesArea.text = output;
}
+ [self updateProgress];
+}
+
+- (void) updateProgress {
+ NSString *progress = [webDisplayiPad stringByEvaluatingJavaScriptFromString:@"getSlideProgress()"];
+ slideProgress.text = progress;
+ NSArray *currentTotal = [progress componentsSeparatedByString:@"/"];
+ float currSlide = [[currentTotal objectAtIndex:0] floatValue];
+ float totSlides = [[currentTotal objectAtIndex:1] floatValue];
+ float currProgress = currSlide / totSlides;
+ slideProgressBar.progress = currProgress;
}
- (IBAction) doFooterButton {
Oops, something went wrong.

0 comments on commit f09301f

Please sign in to comment.