-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBCProgressDialog.m
101 lines (70 loc) · 1.89 KB
/
BCProgressDialog.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
//
// ProgressDialog.m
//
// Created by Tom Houpt on 11/4/30.
// Copyright 2011 "Voyages". All rights reserved.
//
#import "BCProgressDialog.h"
@implementation BCProgressDialog
-(id)init; {
self = [super init];
if (self) {
if (!dialog) {
// [[NSBundle mainBundle ]loadNibNamed:@"BCProgressDialog" owner:self topLevelObjects:NULL];
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
[NSBundle loadNibNamed:@"BCProgressDialog" owner:self];
#pragma clang diagnostic pop
}
}
return self;
}
-(void)startDisplayForWindow:(NSWindow *)ownerWindow; {
[NSApp beginSheet: dialog
modalForWindow: ownerWindow
modalDelegate: nil
didEndSelector: nil
contextInfo: nil];
// See NSApplication Class Reference/runModalSession
}
-(void)endDisplay; {
[dialog close];
[NSApp endSheet: dialog];
[dialog orderOut: self];
}
-(void)setIconImage:(NSImage *)theImage; {
[iconImageView setImage:theImage];
}
-(void)setTitleLabel:(NSString *)text; {
[title setStringValue:text];
}
-(void)setTopLabel:(NSString *)top andTopIndicator:(double)value; {
[topLabel setStringValue:top];
[topIndicator setDoubleValue:value];
[dialog display];
}
-(void)setSubLabel:(NSString *)sub andSubIndicator:(double)value; {
[subLabel setStringValue:sub];
[subIndicator setDoubleValue:value];
[dialog display];
}
-(void)hideSubLabelAndIndicator; {
[subLabel setHidden:YES];
[subIndicator setHidden:YES];
[dialog setViewsNeedDisplay:YES];
}
-(IBAction)cancelButtonPressed:(id)sender; {
//
// // user cancelled
// if (_threadData) {
// cancelWorkerRequest(_threadData->request);
// }
//
// // stop the timer
// [self setProgressTimer:nil];
//
// [exportProgressPanel close];
// [NSApp endSheet:exportProgressPanel];
}
-(BOOL)cancelWasPressed; { return cancelWasPressed; }
@end