mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-05-30 16:50:52 +00:00
o handle dateFormat and numberFormat Alt Keys
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@19311 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
418fd06dab
commit
96ad9c2592
1 changed files with 22 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
/** GSWTextField.m - <title>GSWeb: Class GSWTextField</title>
|
/** GSWTextField.m - <title>GSWeb: Class GSWTextField</title>
|
||||||
|
|
||||||
Copyright (C) 1999-2003 Free Software Foundation, Inc.
|
Copyright (C) 1999-2004 Free Software Foundation, Inc.
|
||||||
|
|
||||||
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
Written by: Manuel Guesdon <mguesdon@orange-concept.com>
|
||||||
Date: Jan 1999
|
Date: Jan 1999
|
||||||
|
@ -38,36 +38,56 @@ RCS_ID("$Id$")
|
||||||
|
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
-(id)initWithName:(NSString*)aName
|
-(id)initWithName:(NSString*)aName
|
||||||
associations:(NSDictionary*)associations
|
associations:(NSDictionary*)associations
|
||||||
contentElements:(NSArray*)elements
|
contentElements:(NSArray*)elements
|
||||||
{
|
{
|
||||||
NSMutableDictionary* tmpAssociations=[NSMutableDictionary dictionaryWithDictionary:associations];
|
NSMutableDictionary* tmpAssociations=[NSMutableDictionary dictionaryWithDictionary:associations];
|
||||||
|
|
||||||
LOGObjectFnStartC("GSWTextField");
|
LOGObjectFnStartC("GSWTextField");
|
||||||
|
|
||||||
NSDebugMLLog(@"gswdync",@"aName=%@ associations:%@ elements=%@",aName,associations,elements);
|
NSDebugMLLog(@"gswdync",@"aName=%@ associations:%@ elements=%@",aName,associations,elements);
|
||||||
|
|
||||||
[tmpAssociations setObject:[GSWAssociation associationWithValue:@"text"]
|
[tmpAssociations setObject:[GSWAssociation associationWithValue:@"text"]
|
||||||
forKey:@"type"];
|
forKey:@"type"];
|
||||||
[tmpAssociations removeObjectForKey:dateFormat__Key];
|
[tmpAssociations removeObjectForKey:dateFormat__Key];
|
||||||
|
[tmpAssociations removeObjectForKey:dateFormat__AltKey];
|
||||||
[tmpAssociations removeObjectForKey:numberFormat__Key];
|
[tmpAssociations removeObjectForKey:numberFormat__Key];
|
||||||
|
[tmpAssociations removeObjectForKey:numberFormat__AltKey];
|
||||||
[tmpAssociations removeObjectForKey:useDecimalNumber__Key];
|
[tmpAssociations removeObjectForKey:useDecimalNumber__Key];
|
||||||
[tmpAssociations removeObjectForKey:formatter__Key];
|
[tmpAssociations removeObjectForKey:formatter__Key];
|
||||||
|
|
||||||
if ((self=[super initWithName:aName
|
if ((self=[super initWithName:aName
|
||||||
associations:tmpAssociations
|
associations:tmpAssociations
|
||||||
contentElements:nil])) //No Childs!
|
contentElements:nil])) //No Childs!
|
||||||
{
|
{
|
||||||
_dateFormat = [[associations objectForKey:dateFormat__Key
|
_dateFormat = [[associations objectForKey:dateFormat__Key
|
||||||
withDefaultObject:[_dateFormat autorelease]] retain];
|
withDefaultObject:[_dateFormat autorelease]] retain];
|
||||||
|
if (!_dateFormat)
|
||||||
|
_dateFormat = [[associations objectForKey:dateFormat__AltKey
|
||||||
|
withDefaultObject:[_dateFormat autorelease]] retain];
|
||||||
NSDebugMLLog(@"gswdync",@"GSWTextField: dateFormat=%@",_dateFormat);
|
NSDebugMLLog(@"gswdync",@"GSWTextField: dateFormat=%@",_dateFormat);
|
||||||
|
|
||||||
_numberFormat = [[associations objectForKey:numberFormat__Key
|
_numberFormat = [[associations objectForKey:numberFormat__Key
|
||||||
withDefaultObject:[_numberFormat autorelease]] retain];
|
withDefaultObject:[_numberFormat autorelease]] retain];
|
||||||
|
if (!_numberFormat)
|
||||||
|
_numberFormat = [[associations objectForKey:numberFormat__AltKey
|
||||||
|
withDefaultObject:[_numberFormat autorelease]] retain];
|
||||||
NSDebugMLLog(@"gswdync",@"GSWTextField: numberFormat=%@",_numberFormat);
|
NSDebugMLLog(@"gswdync",@"GSWTextField: numberFormat=%@",_numberFormat);
|
||||||
|
|
||||||
_useDecimalNumber = [[associations objectForKey:useDecimalNumber__Key
|
_useDecimalNumber = [[associations objectForKey:useDecimalNumber__Key
|
||||||
withDefaultObject:[_useDecimalNumber autorelease]] retain];
|
withDefaultObject:[_useDecimalNumber autorelease]] retain];
|
||||||
NSDebugMLLog(@"gswdync",@"GSWTextField: useDecimalNumber=%@",_useDecimalNumber);
|
NSDebugMLLog(@"gswdync",@"GSWTextField: useDecimalNumber=%@",_useDecimalNumber);
|
||||||
|
|
||||||
_formatter = [[associations objectForKey:formatter__Key
|
_formatter = [[associations objectForKey:formatter__Key
|
||||||
withDefaultObject:[_formatter autorelease]] retain];
|
withDefaultObject:[_formatter autorelease]] retain];
|
||||||
NSDebugMLLog(@"gswdync",@"GSWTextField: formatter=%@",_formatter);
|
NSDebugMLLog(@"gswdync",@"GSWTextField: formatter=%@",_formatter);
|
||||||
|
|
||||||
|
if (_dateFormat && _numberFormat)
|
||||||
|
ExceptionRaise0(@"GSWTextField",@"You can't use 'dateFormat' and 'numberFormat' parameters at the same time.");
|
||||||
};
|
};
|
||||||
|
|
||||||
LOGObjectFnStopC("GSWTextField");
|
LOGObjectFnStopC("GSWTextField");
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue