Re: Case insensitive autocomplete
Re: Case insensitive autocomplete
- Subject: Re: Case insensitive autocomplete
- From: Shaun Wexler <email@hidden>
- Date: Wed, 23 Mar 2005 13:46:47 -0800
On Mar 23, 2005, at 12:19 PM, Nicko van Someren wrote:
The biggest problem with using poseAsClass is that it's only useful if
you want all your combo boxes to behave the same way.
No problem; just add a category, such as:
@interface NSComboBox (CaseInsensitiveCompletion)
- (BOOL)usesCaseInsensitiveCompletion;
@end
@implementation NSComboBox (CaseInsensitiveCompletion)
- (BOOL)usesCaseInsensitiveCompletion {
return NO;
}
@end
@interface CaseInsensitiveComboBox : NSComboBox
- (BOOL)usesCaseInsensitiveCompletion;
@end
@implementation CaseInsensitiveComboBox
- (BOOL)usesCaseInsensitiveCompletion {
return YES;
}
@end
@interface PosedAsNSComboBox : NSComboBox
@end
@implementation PosedAsNSComboBox
- (NSString *)completedString:(NSString *)substring
{
if (![self usesCaseInsensitiveCompletion] || [self usesDataSource]) {
return [super completedString:substring];
}
// else perform case-insensitive completion, etc...
}
@end
--
Shaun Wexler
MacFOH
http://www.macfoh.com
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden