Add OSX 10.5 methods.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33081 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2011-05-21 22:18:22 +00:00
parent f4a8cab41b
commit f881df45ed
3 changed files with 52 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2011-05-22 Fred Kiefer <FredKiefer@gmx.de>
* Headers/AppKit/NSControl.h:
* Source/NSControl.m (-takeIntegerValueFrom:, -setIntegerValue:)
(-integerValue): Add OSX 10.5 methods.
2011-05-19 Fred Kiefer <FredKiefer@gmx.de>
* Headers/AppKit/NSView.h,

View file

@ -84,6 +84,12 @@
- (void) setIntValue: (int)anInt;
- (int) intValue;
#if OS_API_VERSION(MAC_OS_X_VERSION_10_5, GS_API_LATEST)
- (NSInteger) integerValue;
- (void) setIntegerValue: (NSInteger)anInt;
- (void) takeIntegerValueFrom: (id)sender;
#endif
- (void) setStringValue: (NSString *)aString;
- (NSString *) stringValue;

View file

@ -206,6 +206,15 @@ static NSNotificationCenter *nc;
return [[self selectedCell] intValue];
}
/** <p>Returns the value of the NSControl's selected cell as int.</p>
<p>See Also: -setIntegerValue: [NSCell-integerValue] -floatValue -doubleValue
-stringValue</p>
*/
- (NSInteger) integerValue
{
return [[self selectedCell] integerValue];
}
/** <p>Returns the value of the NSControl's selected cell as NSString.</p>
<p>See Also: -setStringValue: [NSCell-stringValue] -intValue -floatValue
-doubleValue -stringValue</p>
@ -280,6 +289,26 @@ static NSNotificationCenter *nc;
}
}
/** <p>Sets the value of the NSControl's selected cell to int.
If the selected cell is an action cell, it marks self for display.</p>
<p>See Also: -integerValue [NSCell-setIntegerValue:] -setDoubleValue:
-setFloatValue: -setStringValue:</p>
*/
- (void) setIntegerValue: (NSInteger)anInt
{
NSCell *selected = [self selectedCell];
BOOL wasEditing = [self abortEditing];
[selected setIntegerValue: anInt];
if (![selected isKindOfClass: actionCellClass])
[self setNeedsDisplay: YES];
if (wasEditing)
{
[[self window] makeFirstResponder: self];
}
}
/** <p>Sets the value of the NSControl's selected cell to NSString.
If the selected cell is an action cell, it marks self for display.</p>
<p>See Also: -stringValue [NSCell-setStringValue:] -setIntValue:
@ -343,7 +372,7 @@ static NSNotificationCenter *nc;
}
/**<p>Sets the NSControl's selected cell to the sender's float int.</p>
<p>See Also: [NSCell-takeDoubleValueFrom:] -takeDoubleValueFrom:
<p>See Also: [NSCell-takeIntValueFrom:] -takeDoubleValueFrom:
-takeFloatValueFrom: -takeStringValueFrom:</p>
*/
- (void) takeIntValueFrom: (id)sender
@ -352,6 +381,16 @@ static NSNotificationCenter *nc;
[self setNeedsDisplay: YES];
}
/**<p>Sets the NSControl's selected cell to the sender's float int.</p>
<p>See Also: [NSCell-takeIntegerValueFrom:] -takeDoubleValueFrom:
-takeFloatValueFrom: -takeStringValueFrom:</p>
*/
- (void) takeIntegerValueFrom: (id)sender
{
[[self selectedCell] takeIntegerValueFrom: sender];
[self setNeedsDisplay: YES];
}
- (void) takeObjectValueFrom: (id)sender
{
[[self selectedCell] takeObjectValueFrom: sender];