Debian Codegraph @

phoenix/cocoa/widget/progress-bar.cpp

raw
1 @implementation CocoaProgressBar : NSProgressIndicator
2
3 -(id) initWith:(phoenix::ProgressBar&)progressBarReference {
4 if(self = [super initWithFrame:NSMakeRect(0, 0, 0, 0)]) {
5 progressBar = &progressBarReference;
6
7 [self setIndeterminate:NO];
8 [self setMinValue:0.0];
9 [self setMaxValue:100.0];
10 }
11 return self;
12 }
13
14 @end
15
16 namespace phoenix {
17
18 void pProgressBar::setPosition(unsigned position) {
19 @autoreleasepool {
20 [cocoaView setDoubleValue:position];
21 }
22 }
23
24 void pProgressBar::constructor() {
25 @autoreleasepool {
26 cocoaView = cocoaProgressBar = [[CocoaProgressBar alloc] initWith:progressBar];
27 setPosition(progressBar.state.position);
28 }
29 }
30
31 void pProgressBar::destructor() {
32 @autoreleasepool {
33 [cocoaView release];
34 }
35 }
36
37 }