mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 15:10:38 +00:00
Start cleanup after big base change. Remove the usage of extension
methods. New 10.5 methods on NSCell. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29656 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c9d1292563
commit
43074e4a62
4 changed files with 66 additions and 7 deletions
|
@ -293,6 +293,22 @@ static NSColor *dtxtCol;
|
|||
}
|
||||
}
|
||||
|
||||
/**<p>Returns the cell's value as an NSInteger. </p>
|
||||
*<p>See Also: -setIntegerValue:</p>
|
||||
*/
|
||||
- (NSInteger) integerValue
|
||||
{
|
||||
if ((_cell.has_valid_object_value == YES) &&
|
||||
([_object_value respondsToSelector: @selector(integerValue)]))
|
||||
{
|
||||
return [_object_value integerValue];
|
||||
}
|
||||
else
|
||||
{
|
||||
return [[self stringValue] integerValue];
|
||||
}
|
||||
}
|
||||
|
||||
/**<p>Returns the cell's value as a NSString.</p>
|
||||
*<p>See Also: -setStringValue: </p>
|
||||
*/
|
||||
|
@ -412,6 +428,20 @@ static NSColor *dtxtCol;
|
|||
[self setObjectValue: number];
|
||||
}
|
||||
|
||||
/**
|
||||
*<p>Sets the NSCell's value to anInt.</p>
|
||||
*<p>See Also: -integerValue</p>
|
||||
*/
|
||||
- (void) setIntegerValue: (NSInteger)anInt
|
||||
{
|
||||
NSNumber *number;
|
||||
|
||||
// NB: GNUstep can set an int value for an image cell.
|
||||
|
||||
number = [NSNumber numberWithInteger: anInt];
|
||||
[self setObjectValue: number];
|
||||
}
|
||||
|
||||
/**<p>Sets the cell's value to a NSString.
|
||||
The NSCell's type is set to NSTextCellType if needed</p>
|
||||
<p>See Also: -stringValue</p>
|
||||
|
@ -1335,12 +1365,19 @@ static NSColor *dtxtCol;
|
|||
|
||||
- (void) setTitleWithMnemonic: (NSString*)aString
|
||||
{
|
||||
unsigned int location = [aString rangeOfString: @"&"].location;
|
||||
NSRange r = [aString rangeOfString: @"&"];
|
||||
|
||||
[self setTitle: [aString stringByReplacingString: @"&"
|
||||
withString: @""]];
|
||||
// TODO: We should underline this character
|
||||
[self setMnemonicLocation: location];
|
||||
if (r.length > 0)
|
||||
{
|
||||
unsigned int location = r.location;
|
||||
|
||||
|
||||
[self setTitle: [[aString substringToIndex: location]
|
||||
stringByAppendingString:
|
||||
[aString substringFromIndex: NSMaxRange(r)]]];
|
||||
// TODO: We should underline this character
|
||||
[self setMnemonicLocation: location];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString*) mnemonic
|
||||
|
@ -1479,6 +1516,14 @@ static NSColor *dtxtCol;
|
|||
[self setIntValue: [sender intValue]];
|
||||
}
|
||||
|
||||
/** <p>Sets the NSCell's NSInteger value to sender's NSInteger value</p>
|
||||
<p>See Also: -setIntegerValue:</p>
|
||||
*/
|
||||
- (void) takeIntegerValueFrom: (id)sender
|
||||
{
|
||||
[self setIntegerValue: [sender integerValue]];
|
||||
}
|
||||
|
||||
/** <p>Sets the NSCell's NSString value to sender's NSSting value</p>
|
||||
<p>See Also: -setStringValue:</p>
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue