2013-03-15 13:11:33 +00:00
|
|
|
@implementation CocoaProgressBar : NSProgressIndicator
|
|
|
|
|
2013-03-21 12:59:01 +00:00
|
|
|
-(id) initWith:(phoenix::ProgressBar&)progressBarReference {
|
2013-03-15 13:11:33 +00:00
|
|
|
if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0)]) {
|
|
|
|
progressBar = &progressBarReference;
|
|
|
|
|
|
|
|
[self setIndeterminate:NO];
|
|
|
|
[self setMinValue:0.0];
|
|
|
|
[self setMaxValue:100.0];
|
|
|
|
}
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
namespace phoenix {
|
|
|
|
|
|
|
|
void pProgressBar::setPosition(unsigned position) {
|
|
|
|
@autoreleasepool {
|
|
|
|
[cocoaView setDoubleValue:position];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void pProgressBar::constructor() {
|
|
|
|
@autoreleasepool {
|
|
|
|
cocoaView = cocoaProgressBar = [[CocoaProgressBar alloc] initWith:progressBar];
|
|
|
|
setPosition(progressBar.state.position);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void pProgressBar::destructor() {
|
|
|
|
@autoreleasepool {
|
|
|
|
[cocoaView release];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|