Skip to content

Commit 686a430

Browse files
committed
Replaced more constants deprecated in macOS 10.12 related to NSControl and NSButton sizes and type enumerations.
1 parent 1b30954 commit 686a430

6 files changed

+12
-12
lines changed

SSYAlert.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -982,8 +982,8 @@ - (void)setShowsProgressBar:(BOOL)showsProgressBar {
982982
if (!progressBar_) {
983983
// Add progress bar
984984
progressBar_ = [[NSProgressIndicator alloc] initWithFrame:NSZeroRect] ;
985-
[progressBar_ setControlSize:NSSmallControlSize] ;
986-
[progressBar_ setStyle:NSProgressIndicatorBarStyle] ;
985+
[progressBar_ setControlSize:NSControlSizeSmall] ;
986+
[progressBar_ setStyle:NSProgressIndicatorStyleBar] ;
987987
[progressBar_ sizeToFit] ;
988988
[progressBar_ setUsesThreadedAnimation:YES] ;
989989
[self setProgressBar:progressBar_] ;

SSYLabelledRadioButtons.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ - (id)initWithLabel:(NSString*)label
216216
// We assume this order when accessing the subviews later.
217217

218218
NSButtonCell* cell = [[NSButtonCell alloc] initTextCell:NSLocalizedString(@"proto", nil)] ;
219-
[cell setButtonType:NSRadioButton] ;
219+
[cell setButtonType:NSButtonTypeRadio] ;
220220
[cell setTitle:@""] ;
221221
NSMatrix* matrix = [[NSMatrix alloc] initWithFrame:NSZeroRect
222222
mode:NSRadioModeMatrix

SSYPopUpTableHeaderCell.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ - (id)copyWithZone:(NSZone *)zone {
3737
- (id)init {
3838
if (self = [super init]) {
3939
// Set up the popup cell attributes
40-
[self setControlSize:NSMiniControlSize] ;
40+
[self setControlSize:NSControlSizeMini] ;
4141
[self setBordered:NO] ;
4242
[self setBezeled:NO] ;
4343
[self setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]] ;

SSYProgressView.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
#define CIRCLESTYLE SSYProgressIndicatorStyleCircle
99
#else
1010
#define PROGRESSINDICATORCLASS NSProgressIndicator
11-
#define BARSTYLE NSProgressIndicatorBarStyle
12-
#define CIRCLESTYLE NSProgressIndicatorSpinningStyle
11+
#define BARSTYLE NSProgressIndicatorStyleBar
12+
#define CIRCLESTYLE NSProgressIndicatorStyleSpinning
1313
#endif
1414

1515

SSYProgressView.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -587,11 +587,11 @@ - (void)unsafeStartSpinning {
587587
spinnerFrame.size.width = height ;
588588
PROGRESSINDICATORCLASS* spinner = [[PROGRESSINDICATORCLASS alloc] initWithFrame:spinnerFrame] ;
589589
// The following is to eliminate this warning from appearing in system console:
590-
// "A regular control size progress indicator … with the frame size for small control size detected. Please use -setControlSize: to explicitly specify NSSmallControlSize"
590+
// "A regular control size progress indicator … with the frame size for small control size detected. Please use -setControlSize: to explicitly specify NSControlSizeSmall"
591591
// I'm not sure if this is the correct threshold, but it worked for my application.
592-
// Also, apparently, there should be a threshold for NSMiniControlSize, but I haven't run into that yet.
592+
// Also, apparently, there should be a threshold for NSControlSizeMini, but I haven't run into that yet.
593593
if (height < 17.0) {
594-
[spinner setControlSize:NSSmallControlSize] ;
594+
[spinner setControlSize:NSControlSizeSmall] ;
595595
}
596596
[self addSubview:spinner] ;
597597
[spinner release] ;

SSYVerticalCenteredTextField.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ - (void)setFont:(NSFont*)font {
1212
if (newFontSize != oldFontSize) {
1313
NSControlSize newControlSize ;
1414
if (newFontSize > 13) {
15-
newControlSize = NSRegularControlSize ;
15+
newControlSize = NSControlSizeRegular ;
1616
}
1717
else if (newFontSize > 10) {
18-
newControlSize = NSSmallControlSize ;
18+
newControlSize = NSControlSizeSmall ;
1919
}
2020
else {
21-
newControlSize = NSMiniControlSize ;
21+
newControlSize = NSControlSizeMini ;
2222
}
2323
[[self cell] setControlSize:newControlSize] ;
2424

0 commit comments

Comments
 (0)