Skip to content

Commit dde627c

Browse files
committed
Replaced deprecated NSOnState, NSOffState, NSMixedState with new constants.
1 parent f7683c1 commit dde627c

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

SSYAlert.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1231,7 +1231,7 @@ extern NSObject <SSYAlertErrorHideManager> * gSSYAlertErrorHideManager ;
12311231
@brief Returns the state of the receiver's checkbox
12321232
12331233
@details Message is forwarded directly to the checkbox.
1234-
@result NSOnState, NSOffState or NSMixedState
1234+
@result NSControlStateValueOn, NSControlStateValueOff or NSControlStateValueMixed
12351235
*/
12361236
- (NSCellStateValue)checkboxState ;
12371237

SSYToolbarButton.h

+11-11
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,28 @@
2828
}
2929

3030
/*!
31-
@brief An internal variable, generally NSOnState,
32-
NSOffState or NSMixedState.
31+
@brief An internal variable, generally NSControlStateValueOn,
32+
NSControlStateValueOff or NSControlStateValueMixed.
3333
3434
@details This is KVO-compliant and is also exposed as a binding.
3535
*/
3636
@property (assign) NSInteger value ;
3737

3838
/*!
3939
@brief The image that will be displayed when the receiver's value is
40-
NSOnState.
40+
NSControlStateValueOn.
4141
*/
4242
@property (retain) NSImage* onImage ;
4343

4444
/*!
4545
@brief The image that will be displayed when the receiver's value is
46-
NSOnState.
46+
NSControlStateValueOn.
4747
*/
4848
@property (retain) NSImage* offImage ;
4949

5050
/*!
5151
@brief The image that will be displayed when the receiver's value is
52-
NSMixedState.
52+
NSControlStateValueMixed.
5353
*/
5454
@property (retain) NSImage* disImage ;
5555

@@ -61,7 +61,7 @@
6161

6262
/*!
6363
@brief The string that will be displayed under the button
64-
when the receiver's value is set to NSOnState. This value
64+
when the receiver's value is set to NSControlStateValueOn. This value
6565
defaults to nil, and if it is nil when the receiver's value
6666
is changed to this state, the label does not change. Thus,
6767
for a fixed, constant label, use super's -setLabel:
@@ -70,7 +70,7 @@
7070

7171
/*!
7272
@brief The string that will be displayed under the button
73-
when the receiver's value is set to NSOnState. This value
73+
when the receiver's value is set to NSControlStateValueOn. This value
7474
defaults to nil, and if it is nil when the receiver's value
7575
is changed to this state, the label does not change. Thus,
7676
for a fixed, constant label, use super's -setLabel:
@@ -80,7 +80,7 @@
8080

8181
/*!
8282
@brief The string that will be displayed under the button
83-
when the receiver's value is set to NSMixedState. This value
83+
when the receiver's value is set to NSControlStateValueMixed. This value
8484
defaults to nil, and if it is nil when the receiver's value
8585
is changed to this state, the label does not change. Thus,
8686
for a fixed, constant label, use super's -setLabel:
@@ -90,7 +90,7 @@
9090

9191
/*!
9292
@brief The receiver's toolTip
93-
when the receiver's value is set to NSOnState. This value
93+
when the receiver's value is set to NSControlStateValueOn. This value
9494
defaults to nil, and if it is nil when the receiver's value
9595
is changed to this state, the label does not change. Thus,
9696
for a fixed, constant toolTip, use super's -setToolTip:
@@ -99,7 +99,7 @@
9999

100100
/*!
101101
@brief The receiver's toolTip
102-
when the receiver's value is set to NSOnState. This value
102+
when the receiver's value is set to NSControlStateValueOn. This value
103103
defaults to nil, and if it is nil when the receiver's value
104104
is changed to this state, the label does not change. Thus,
105105
for a fixed, constant toolTip, use super's -setToolTip:
@@ -108,7 +108,7 @@
108108

109109
/*!
110110
@brief The receiver's toolTip
111-
when the receiver's value is set to NSMixedState. This value
111+
when the receiver's value is set to NSControlStateValueMixed. This value
112112
defaults to nil, and if it is nil when the receiver's value
113113
is changed to this state, the label does not change. Thus,
114114
for a fixed, constant toolTip, use super's -setToolTip:

SSYToolbarButton.m

+8-8
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,17 @@ - (void)setValue:(NSInteger)value {
8686
NSString* label = nil ;
8787
NSString* toolTip = nil ;
8888
switch (value) {
89-
case NSOnState:
89+
case NSControlStateValueOn:
9090
image = [self onImage] ;
9191
label = [self onLabel] ;
9292
toolTip = [self onToolTip] ;
9393
break ;
94-
case NSOffState:
94+
case NSControlStateValueOff:
9595
image = [self offImage] ;
9696
label = [self offLabel] ;
9797
toolTip = [self offToolTip] ;
9898
break ;
99-
case NSMixedState:
99+
case NSControlStateValueMixed:
100100
image = [self disImage] ;
101101
label = [self disLabel] ;
102102
toolTip = [self disToolTip] ;
@@ -105,7 +105,7 @@ - (void)setValue:(NSInteger)value {
105105

106106
if (self.view) {
107107
/* Change the image for a view-based button */
108-
[self.view setNeedsDisplay:YES];
108+
self.view.needsDisplay=YES;
109109
} else {
110110
/* Change the image for a image-based button */
111111
[self setImage:image] ;
@@ -142,7 +142,7 @@ - (IBAction)doDaClick:(id)sender {
142142
[self setFlashTimer:timer] ;
143143
}
144144

145-
//[self setValue:([self value] == NSOnState) ? NSOffState : NSOnState] ;
145+
//[self setValue:([self value] == NSControlStateValueOn) ? NSControlStateValueOff : NSControlStateValueOn] ;
146146
[[self externalTarget] performSelector:[self externalAction]
147147
withObject:self] ;
148148
}
@@ -183,15 +183,15 @@ - (void)drawRect:(NSRect)dirtyRect {
183183
NSImage* image = nil;
184184
NSString* toolTip = nil;
185185
switch (self.toolbarItem.value) {
186-
case NSOnState:
186+
case NSControlStateValueOn:
187187
image = [self.toolbarItem onImage];
188188
toolTip = [self.toolbarItem onToolTip];
189189
break ;
190-
case NSOffState:
190+
case NSControlStateValueOff:
191191
image = [self.toolbarItem offImage];
192192
toolTip = [self.toolbarItem offToolTip];
193193
break ;
194-
case NSMixedState:
194+
case NSControlStateValueMixed:
195195
image = self.toolbarItem.disImage;
196196
toolTip = self.toolbarItem.disToolTip;
197197
break ;

0 commit comments

Comments
 (0)