2000-07-27 Mirko Viviani <mirko.viviani@rccr.cremona.it>

* GSWInput.m/.h: implemented (-valueInContext:) and (-resetAutoValue) to manage auto value attribute
	* GSWRadioButtonList.m/.h: fix to use the correct variable to set the selection binding.
	  Implemented auto value attribute
	* GSWPopUpButton.m/.h: fix to select object in the selection binding.
	  Implemented auto value attribute
	* GSWMailDelivery.m/.h: use the real sender in the sendmail command line
	  The following are changes made to support GDL2. Compile with -DGDL2
	* GSWSession.m: (-defaultEditingContext) create the default EOEditingContext
	* GSWComponent.m: (-setValue:forBinding:) if the parent doesn't provide the bindingName, attempts to set the value in the current component using takeValue:forKey:
	  (-valueForKeyBinding:) if the parent doesn't provide the bindingName, attempts to get the value from the current component using valueForKey:
	* GSWDisplayGroup.m/.h: implemented
	* NSObject+IVarAccess+PerfomSel.m: implemented (-getIVarNamed:) and (-setIVarNamed:withValue:) using EOKeyValueCoding protocol.
	  Now components have the responsibility to release its bindings.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@6998 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
mirko 2000-07-27 21:53:39 +00:00
parent 8550607f04
commit 0d12e3a6a9
14 changed files with 1633 additions and 141 deletions

View file

@ -1,3 +1,19 @@
2000-07-27 Mirko Viviani <mirko.viviani@rccr.cremona.it>
* GSWInput.m/.h: implemented (-valueInContext:) and (-resetAutoValue) to manage auto value attribute
* GSWRadioButtonList.m/.h: fix to use the correct variable to set the selection binding.
Implemented auto value attribute
* GSWPopUpButton.m/.h: fix to select object in the selection binding.
Implemented auto value attribute
* GSWMailDelivery.m/.h: use the real sender in the sendmail command line
The following are changes made to support GDL2. Compile with -DGDL2
* GSWSession.m: (-defaultEditingContext) create the default EOEditingContext
* GSWComponent.m: (-setValue:forBinding:) if the parent doesn't provide the bindingName, attempts to set the value in the current component using takeValue:forKey:
(-valueForKeyBinding:) if the parent doesn't provide the bindingName, attempts to get the value from the current component using valueForKey:
* GSWDisplayGroup.m/.h: implemented
* NSObject+IVarAccess+PerfomSel.m: implemented (-getIVarNamed:) and (-setIVarNamed:withValue:) using EOKeyValueCoding protocol.
Now components have the responsibility to release its bindings.
2000-07-08 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWAdaptors/Apache/GNUmakefile: added -I/usr/include/apache in APACHEHEADERS
* GSWAdaptors/common/GSWConfig.c: added directive name in GSWConfig_SetConfigFilePath errore message

View file

@ -832,8 +832,18 @@ associationsKeys:(NSArray*)_associationsKeys
{
_assoc=[self _associationWithName:parentBindingName_];
NSDebugMLLog(@"gswcomponents",@"_assoc=%@",_assoc);
[_assoc setValue:value_
inComponent:parent];
if(_assoc)
[_assoc setValue:value_
inComponent:parent];
#if GDL2
else
{
NS_DURING
[self takeValue:value_ forKey:parentBindingName_];
NS_HANDLER;
NS_ENDHANDLER;
}
#endif
};
LOGObjectFnStop();
};
@ -851,7 +861,17 @@ associationsKeys:(NSArray*)_associationsKeys
{
_assoc=[self _associationWithName:parentBindingName_];
NSDebugMLLog(@"gswcomponents",@"_assoc=%@",_assoc);
_value=[_assoc valueInComponent:parent];
if(_assoc)
_value=[_assoc valueInComponent:parent];
#if GDL2
else
{
NS_DURING
_value = [self valueForKey:parentBindingName_];
NS_HANDLER;
NS_ENDHANDLER;
}
#endif
NSDebugMLLog(@"gswcomponents",@"_value=%@",_value);
};
LOGObjectFnStop();

View file

@ -26,6 +26,7 @@
#ifndef _GSWDisplayGroup_h__
#define _GSWDisplayGroup_h__
#if !GDL2
#include <eoaccess/EOModel.h>
#include <eoaccess/EOEntity.h>
#include <eoaccess/EOAttribute.h>
@ -48,6 +49,12 @@
#include <eoaccess/EOSQLExpression.h>
#define EODataSource EODatabaseDataSource
#else
#import <EOControl/EOQualifier.h>
#import <EOControl/EODataSource.h>
#import <EOControl/EODetailDataSource.h>
#import <EOAccess/EODatabaseDataSource.h>
#endif
@interface GSWDisplayGroup : NSObject <NSCoding>
{
@ -58,107 +65,160 @@
Array of selection indexes
*/
EODataSource *dataSource;
NSMutableArray *allObjects;
NSMutableArray *displayedObjects;
NSMutableArray *selectedObjects;
NSArray *selection;
NSArray *sortOrdering;
EOQualifier *qualifier;
NSArray *localKeys;
NSDictionary *insertedObjectDefaultValues;
NSMutableArray *savedAllObjects;
NSMutableDictionary *queryMatch;
NSMutableDictionary *queryMin;
NSMutableDictionary *queryMax;
NSMutableDictionary *queryOperator;
NSString *defaultStringMatchOperator;
NSString *defaultStringMatchFormat;
NSMutableDictionary *queryBindings;
unsigned numberOfObjectsPerBatch;
unsigned batchIndex;
struct {
unsigned int selectFirstObject:1;
unsigned int autoFetch:1;
unsigned int validateImmediately:1;
unsigned int queryMode:1;
unsigned int fetchAll:1;
unsigned int _reserved:27;
} flags;
struct {
unsigned int didChangeDataSource:1;
unsigned int displayArrayForObjects:1;
unsigned int selectsFirstObjectAfterFetch:1;
unsigned int shouldChangeSelection:1;
unsigned int didChangeSelection:1;
unsigned int didChangeSelectedObjects:1;
unsigned int createObjectFailed:1;
unsigned int shouldInsertObject:1;
unsigned int didInsertObject:1;
unsigned int shouldFetchObjects:1;
unsigned int didFetchObjects:1;
unsigned int shouldDeleteObject:1;
unsigned int didDeleteObject:1;
unsigned int didSetValueForObject:1;
unsigned int shouldRedisplay:1;
unsigned int shouldRefetchObjects:1;
unsigned int _reserved:16;
} delegateRespondsTo;
};
-(NSArray*)allObjects;
-(NSArray*)allQualifierOperators;
-(unsigned)batchCount;
-(BOOL)buildsQualifierFromInput;
-(BOOL)clearSelection;
-(unsigned)currentBatchIndex;
-(EODataSource*)dataSource;
-(NSString*)defaultStringMatchFormat;
-(NSString*)defaultStringMatchOperator;
-(id)delegate;
-(id)delete;
-(BOOL)deleteObjectAtIndex:(unsigned)index;
-(BOOL)deleteSelection;
-(NSString*)detailKey;
-(id)displayBatchContainingSelectedObject;
-(NSArray*)displayedObjects;
-(id)displayNextBatch;
-(id)displayPreviousBatch;
-(BOOL)endEditing;
-(id)executeQuery;
-(id)fetch;
-(BOOL)fetchesOnLoad;
-(BOOL)hasDetailDataSource;
-(BOOL) hasMultipleBatches;
-(id)init;
-(NSMutableDictionary*)inputObjectForQualifier;
-(BOOL)inQueryMode;
-(id)insert;
-(NSDictionary*)insertedObjectDefaultValues;
-(void)insertObject:object_
atIndex:(unsigned)index;
-(id)insertObjectAtIndex:(unsigned)index_;
-(EOQualifier*)lastQualifierFromInputValues;
-(NSArray*)localKeys;
-(id)masterObject;
-(unsigned)numberOfObjectsPerBatch;
-(EOQualifier*)qualifier;
-(EOQualifier*)qualifierFromInputValues;
-(EOQualifier*)qualifierFromQueryValues;
-(void)qualifyDataSource;
-(void)qualifyDisplayGroup;
-(NSMutableDictionary*)queryMatch;
-(NSMutableDictionary*)queryMax;
-(NSMutableDictionary*)queryMin;
-(NSMutableDictionary*)queryOperator;
-(void)redisplay;
-(void)relationalQualifierOperators;
-(NSMutableDictionary*)secondObjectForQualifier;
-(id)selectedObject;
-(NSArray*)selectedObjects;
-(NSArray*)selectionIndexes;
-(id)selectNext;
-(BOOL)selectObject:(id)object;
-(BOOL)selectObjectsIdenticalTo:(NSArray*)objects;
-(BOOL)selectObjectsIdenticalTo:(NSArray*)objects
selectFirstOnNoMatch:(BOOL)flag;
-(id)selectPrevious;
-(BOOL)selectsFirstObjectAfterFetch;
-(void)setBuildsQualifierFromInput:(BOOL)flag;
-(void)setCurrentBatchIndex:(unsigned)index_;
-(void)setDataSource:(EODataSource*)dataSource_;
-(void)setDefaultStringMatchFormat:(NSString*)format;
-(void)setDefaultStringMatchOperator:(NSString*)operator;
-(void)setDelegate:(id)object_;
-(void)setDetailKey:(NSString*)detailKey;
-(void)setFetchesOnLoad:(BOOL)flag;
-(void)setInQueryMode:(BOOL)flag;
-(void)setInsertedObjectDefaultValues:(NSDictionary*)defaultValues;
-(void)setLocalKeys:(NSArray*)keys;
-(void)setMasterObject:(id)masterObject;
-(void)setNumberOfObjectsPerBatch:(unsigned)count;
-(void)setObjectArray:(NSArray*)objects;
-(void)setQualifier:(EOQualifier*)qualifier_;
-(BOOL)setSelectionIndexes:(NSArray*)selection;
-(void)setSelectsFirstObjectAfterFetch:(BOOL)flag;
-(void)setSortOrdering:(NSArray*)orderings;
-(void)setValidatesChangesImmediately:(BOOL)flag;
-(NSArray*)sortOrdering;
-(void)updateDisplayedObjects;
-(BOOL)validatesChangesImmediately;
- (NSArray *)allObjects;
- (NSArray *)allQualifierOperators;
- (unsigned)batchCount;
- (BOOL)buildsQualifierFromInput;
- (BOOL)clearSelection;
- (unsigned)currentBatchIndex;
- (EODataSource *)dataSource;
- (NSString *)defaultStringMatchFormat;
- (NSString *)defaultStringMatchOperator;
- (id)delegate;
- (id)delete;
- (BOOL)deleteObjectAtIndex:(unsigned)index;
- (BOOL)deleteSelection;
- (NSString *)detailKey;
- (id)displayBatchContainingSelectedObject;
- (NSArray *)displayedObjects;
- (id)displayNextBatch;
- (id)displayPreviousBatch;
- (BOOL)endEditing;
- (id)executeQuery;
- (id)fetch;
- (BOOL)fetchesOnLoad;
- (BOOL)hasDetailDataSource;
- (BOOL)hasMultipleBatches;
- (unsigned)indexOfFirstDisplayedObject;
- (unsigned)indexOfLastDisplayedObject;
- (id)init;
- (NSMutableDictionary *)inputObjectForQualifier;
- (BOOL)inQueryMode;
- (id)insert;
- (NSDictionary *)insertedObjectDefaultValues;
- (void)insertObject:object_
atIndex:(unsigned)index;
- (id)insertObjectAtIndex:(unsigned)index_;
- (EOQualifier *)lastQualifierFromInputValues;
- (NSArray *)localKeys;
- (id)masterObject;
- (unsigned)numberOfObjectsPerBatch;
- (EOQualifier *)qualifier;
- (EOQualifier *)qualifierFromInputValues;
- (EOQualifier *)qualifierFromQueryValues;
- (void)qualifyDataSource;
- (void)qualifyDisplayGroup;
- (NSMutableDictionary*)queryBindings;
- (NSMutableDictionary*)queryMatch;
- (NSMutableDictionary*)queryMax;
- (NSMutableDictionary*)queryMin;
- (NSMutableDictionary*)queryOperator;
- (void)redisplay;
- (NSArray *)relationalQualifierOperators;
- (NSMutableDictionary *)secondObjectForQualifier;
- (id)selectedObject;
- (NSArray *)selectedObjects;
- (NSArray *)selectionIndexes;
- (id)selectNext;
- (BOOL)selectObject:(id)object;
- (BOOL)selectObjectsIdenticalTo:(NSArray *)objects;
- (BOOL)selectObjectsIdenticalTo:(NSArray *)objects
selectFirstOnNoMatch:(BOOL)flag;
- (id)selectPrevious;
- (BOOL)selectsFirstObjectAfterFetch;
- (void)setBuildsQualifierFromInput:(BOOL)flag;
- (void)setCurrentBatchIndex:(unsigned)index_;
- (void)setDataSource:(EODataSource *)dataSource_;
- (void)setDefaultStringMatchFormat:(NSString *)format;
- (void)setDefaultStringMatchOperator:(NSString *)operator;
- (void)setDelegate:(id)object_;
- (void)setDetailKey:(NSString *)detailKey;
- (void)setFetchesOnLoad:(BOOL)flag;
- (void)setInQueryMode:(BOOL)flag;
- (void)setInsertedObjectDefaultValues:(NSDictionary *)defaultValues;
- (void)setLocalKeys:(NSArray *)keys;
- (void)setMasterObject:(id)masterObject;
- (void)setNumberOfObjectsPerBatch:(unsigned)count;
- (void)setObjectArray:(NSArray *)objects;
- (void)setQualifier:(EOQualifier *)qualifier_;
- (BOOL)setSelectionIndexes:(NSArray *)selection;
- (void)setSelectsFirstObjectAfterFetch:(BOOL)flag;
- (void)setSortOrdering:(NSArray *)orderings;
- (void)setValidatesChangesImmediately:(BOOL)flag;
- (NSArray *)sortOrdering;
- (void)updateDisplayedObjects;
- (BOOL)validatesChangesImmediately;
/*
By Delegate
@end
// By Delegate
@interface NSObject (GSWDisplayGroupDelegation)
-(void)displayGroup:(GSWDisplayGroup*)displayGroup_
createObjectFailedForDataSource:(id)dataSource_;
-(void)displayGroup:(GSWDisplayGroup*)displayGroup_
didDeleteObject:(id)object_;
didDeleteObject:(id)object_;
-(void)displayGroup:(GSWDisplayGroup*)displayGroup_
didFetchObjects:(NSArray*)objects;
didFetchObjects:(NSArray*)objects;
-(void)displayGroup:(GSWDisplayGroup*)displayGroup_
didInsertObject:object_;
didInsertObject:object_;
-(void)displayGroup:(GSWDisplayGroup*)displayGroup_
didSetValue:(id)value
forObject:(id)object_ key:(NSString*)key;
didSetValue:(id)value
forObject:(id)object_
key:(NSString*)key;
-(NSArray*)displayGroup:(GSWDisplayGroup*)displayGroup_
displayArrayForObjects:(NSArray*)objects;
@ -168,7 +228,10 @@ shouldChangeSelectionToIndexes:(NSArray*)newIndexes;
-(BOOL)displayGroup:(GSWDisplayGroup*)displayGroup_
shouldInsertObject:object_
atIndex:(unsigned)index_;
atIndex:(unsigned)index_;
-(BOOL)displayGroup:(GSWDisplayGroup*)displayGroup
shouldDeleteObject:object;
-(BOOL)displayGroup:(GSWDisplayGroup*)displayGroup_
shouldRedisplayForEditingContextChangeNotification:(NSNotification*)notification_;
@ -180,7 +243,7 @@ shouldRefetchForInvalidatedAllObjectsNotification:(NSNotification*)notification_
-(void)displayGroupDidChangeSelectedObjects:(GSWDisplayGroup*)displayGroup_;
-(void)displayGroupDidChangeSelection:(GSWDisplayGroup*)displayGroup_;
-(BOOL)displayGroupShouldFetch:(GSWDisplayGroup*)displayGroup_;
*/
@end
#endif //_GSWDisplayGroup_h__

File diff suppressed because it is too large Load diff

View file

@ -52,6 +52,8 @@
//====================================================================
@interface GSWInput (GSWInputA)
-(NSString*)nameInContext:(GSWContext*)context_;
-(NSString*)valueInContext:(GSWContext*)context_;
-(void)resetAutoValue;
-(BOOL)disabledInContext:(GSWContext*)context_;
@end

View file

@ -122,6 +122,41 @@ static char rcsId[] = "$Id$";
return _name;
};
static int countAutoValue = 0;
//--------------------------------------------------------------------
- (NSString *)valueInContext:(GSWContext *)_context
{
//OK
GSWComponent *_component=nil;
NSString *_value=nil;
LOGObjectFnStartC("GSWInput");
countAutoValue++;
if(value)
{
_component=[_context component];
_value=[value valueInComponent:_component];
}
else
{
_value=[NSString stringWithFormat:@"%@.%d", [_context elementID], countAutoValue];
NSDebugMLLog(@"gswdync",@"_elementID=%@ _countAutoValue",[_context elementID], countAutoValue);
}
LOGObjectFnStopC("GSWInput");
return _value;
}
//--------------------------------------------------------------------
- (void)resetAutoValue
{
LOGObjectFnStartC("GSWInput");
countAutoValue = 0;
LOGObjectFnStopC("GSWInput");
}
//--------------------------------------------------------------------
-(BOOL)disabledInContext:(GSWContext*)_context
{

View file

@ -30,6 +30,7 @@
//====================================================================
@interface GSWMailDelivery : NSObject
{
NSString *sender;
};
+(GSWMailDelivery*)sharedInstance;

View file

@ -28,12 +28,24 @@ static char rcsId[] = "$Id$";
//====================================================================
@implementation GSWMailDelivery
static GSWMailDelivery *sharedInstance;
+ (void)initialize
{
sharedInstance = [GSWMailDelivery new];
}
+(GSWMailDelivery*)sharedInstance
{
LOGClassFnNotImplemented(); //TODOFN
return [[GSWMailDelivery new] autorelease];
return sharedInstance;
};
- (void)dealloc
{
DESTROY(sender);
}
-(NSString*)composeEmailFrom:(NSString*)sender_
to:(NSArray*)to_
cc:(NSArray*)cc_
@ -88,6 +100,7 @@ static char rcsId[] = "$Id$";
NSDebugMLog(@"subject_=%@",subject_);
NSDebugMLog(@"plainTextMessage_=%@",plainTextMessage_);
NSDebugMLog(@"sendNow_=%d",(int)sendNow_);
ASSIGN(sender, sender_);
for(i=0;i<_count;i++)
{
if (!_to)
@ -157,7 +170,7 @@ static char rcsId[] = "$Id$";
_emailString=[emailString_ stringByReplacingString:@"&"
withString:@"\\&"];
NSDebugMLog(@"_emailString=%@",_emailString);
_command=[NSString stringWithFormat:@"echo \"%@\" | /usr/sbin/sendmail manu@sbuilders.com",_emailString];
_command=[NSString stringWithFormat:@"echo \"%@\" | /usr/sbin/sendmail \"%@\"",_emailString, sender];
system([_command cString]);
};

View file

@ -39,6 +39,7 @@
GSWAssociation* selectedValue;
GSWAssociation* noSelectionString;
GSWAssociation* escapeHTML;
BOOL autoValue;
};
-(void)dealloc;

View file

@ -143,6 +143,8 @@ static char rcsId[] = "$Id$";
BOOL _optGroupLabel=NO;
#endif
LOGObjectFnStartC("GSWPopUpButton");
[self resetAutoValue];
autoValue = NO;
_request=[context_ request];
_isFromClientComponent=[_request isFromClientComponent];
_component=[context_ component];
@ -193,34 +195,51 @@ static char rcsId[] = "$Id$";
NSDebugMLLog(@"gswdync",@"_itemValue=%@",_itemValue);
if (_itemValue)
{
_valueValue=nil;
NSDebugMLLog(@"gswdync",@"value=%@",value);
if (value)
_valueValue=[self valueInContext:context_];
NSDebugMLLog(@"gswdync",@"_valueValue=%@",_valueValue);
if (_valueValue)
{
BOOL _isEqual;
NSDebugMLLog0(@"gswdync",@"Adding OPTION");
[response_ _appendContentAsciiString:@"\n<OPTION"];
if (selection)
{
_valueValue=[value valueInComponent:_component];
NSDebugMLLog(@"gswdync",@"_valueValue=%@",_valueValue);
if (_valueValue)
{
NSDebugMLLog0(@"gswdync",@"Adding OPTION");
[response_ _appendContentAsciiString:@"\n<OPTION"];
if (selectedValue)
{
BOOL _isEqual=SBIsValueEqual(_valueValue,_selectedValueValue);
if (_isEqual)
{
[response_ appendContentCharacter:' '];
[response_ _appendContentAsciiString:@"selected"];
};
};
if (value)
{
[response_ _appendContentAsciiString:@" value=\""];
[response_ _appendContentAsciiString:_valueValue];
[response_ appendContentCharacter:'"'];
};
[response_ appendContentCharacter:'>'];
};
if(value)
_isEqual=SBIsValueEqual(_valueValue,_selectionValue);
else
_isEqual=SBIsValueEqual(_itemValue,_selectionValue);
if (_isEqual)
{
[response_ appendContentCharacter:' '];
[response_ _appendContentAsciiString:@"selected"];
};
};
if (_isEqual == NO && selectedValue)
{
if(value)
_isEqual=SBIsValueEqual(_valueValue,_selectedValueValue);
else
_isEqual=SBIsValueEqual(_itemValue,_selectedValueValue);
if (_isEqual)
{
[response_ appendContentCharacter:' '];
[response_ _appendContentAsciiString:@"selected"];
};
};
if (value == nil)
autoValue = YES;
if (_valueValue)
{
[response_ _appendContentAsciiString:@" value=\""];
[response_ _appendContentAsciiString:_valueValue];
[response_ appendContentCharacter:'"'];
};
[response_ appendContentCharacter:'>'];
};
_displayStringValue=nil;
if (displayString)
{
@ -330,6 +349,7 @@ static char rcsId[] = "$Id$";
BOOL _disabled=NO;
BOOL _wasFormSubmitted=NO;
LOGObjectFnStartC("GSWPopUpButton");
[self resetAutoValue];
_disabled=[self disabledInContext:context_];
if (!_disabled)
{
@ -370,14 +390,16 @@ static char rcsId[] = "$Id$";
[item setValue:_itemValue
inComponent:_component];
NSDebugMLLog(@"gswdync",@"value=%@",value);
if (value)
_valueValue=[value valueInComponent:_component];
_valueValue=[self valueInContext:context_];
NSDebugMLLog(@"gswdync",@"_valueValue=%@ [class=%@] _formValue=%@ [class=%@]",
_valueValue,[_valueValue class],
_formValue,[_formValue class]);
_isEqual=SBIsValueEqual(_valueValue,_formValue);
if (_isEqual)
{
if(autoValue == NO)
_itemValue = _valueValue;
NSDebugMLLog(@"gswdync",@"selection=%@",selection);
if (selection)
{

View file

@ -38,6 +38,7 @@
GSWAssociation* displayString;
GSWAssociation* escapeHTML;
BOOL defaultEscapeHTML;
BOOL autoValue;
};
-(id)initWithName:(NSString*)name_

View file

@ -134,6 +134,8 @@ static char rcsId[] = "$Id$";
//OK
BOOL _disabledInContext=NO;
LOGObjectFnStart();
[self resetAutoValue];
_disabledInContext=[self disabledInContext:context_];
if (!_disabledInContext)
{
@ -169,22 +171,23 @@ static char rcsId[] = "$Id$";
[index setValue:[NSNumber numberWithShort:i]
inComponent:_component];
NSDebugMLLog(@"gswdync",@"value=%@",value);
if (value)
{
//TODOV
_valueValue=[value valueInComponent:_component];
NSDebugMLLog(@"gswdync",@"_valueValue=%@",_valueValue);
if (_valueValue)
{
BOOL _isEqual=SBIsValueEqual(_valueValue,_formValue);
NSDebugMLLog(@"gswdync",@"_isEqual=%s",(_isEqual ? "YES" : "NO"));
if (_isEqual)
{
_valueToSet=_valueValue;
_foundIndex=i;
};
};
_valueValue=[self valueInContext:context_];
NSDebugMLLog(@"gswdync",@"_valueValue=%@",_valueValue);
if (_valueValue)
{
BOOL _isEqual=SBIsValueEqual(_valueValue,_formValue);
NSDebugMLLog(@"gswdync",@"_isEqual=%s",(_isEqual ? "YES" : "NO"));
if (_isEqual)
{
if(autoValue == NO)
_valueToSet=_valueValue;
else
_valueToSet=[_listValue objectAtIndex:i];
_foundIndex=i;
};
};
};
NSDebugMLLog(@"gswdync",@"_component=%@",_component);
NSDebugMLLog(@"gswdync",@"_foundIndex=%d",_foundIndex);
@ -194,7 +197,7 @@ static char rcsId[] = "$Id$";
NS_DURING
{
if (_foundIndex>=0)
[selection setValue:_valueValue
[selection setValue:_valueToSet
inComponent:_component];
else
[selection setValue:nil
@ -208,7 +211,7 @@ static char rcsId[] = "$Id$";
NS_ENDHANDLER;
#else
if (_foundIndex>=0)
[selection setValue:_valueValue
[selection setValue:_valueToSet
inComponent:_component];
else
[selection setValue:nil
@ -246,6 +249,8 @@ static char rcsId[] = "$Id$";
id _valueValue=nil;
BOOL _isEqual=NO;
LOGObjectFnStart();
[self resetAutoValue];
autoValue = NO;
_request=[context_ request];
_isFromClientComponent=[_request isFromClientComponent];
_name=[self nameInContext:context_];
@ -269,11 +274,17 @@ static char rcsId[] = "$Id$";
[response_ appendContentString:@"<INPUT NAME=\""];
[response_ appendContentString:_name];
[response_ appendContentString:@"\" TYPE=radio VALUE=\""];
_valueValue=[value valueInComponent:_component];
_valueValue=[self valueInContext:context_];
[response_ appendContentHTMLAttributeValue:_valueValue];
[response_ appendContentCharacter:'"'];
//TODOV
_isEqual=SBIsValueEqual(_valueValue,_selectionValue);
if(value)
_isEqual=SBIsValueEqual(_valueValue,_selectionValue);
else
{
_isEqual=SBIsValueEqual([_listValue objectAtIndex:i],_selectionValue);
autoValue = YES;
}
if (_isEqual)
[response_ appendContentString:@"\" CHECKED"];
[response_ appendContentCharacter:'>'];

View file

@ -1019,6 +1019,13 @@ static char rcsId[] = "$Id$";
//--------------------------------------------------------------------
-(EOEditingContext*)defaultEditingContext
{
#if GDL2
if(editingContext == nil)
{
ASSIGN(editingContext, [[[EOEditingContext alloc] init] autorelease]);
}
#endif
return editingContext;
};

View file

@ -166,6 +166,46 @@ const char* GSGetInstanceVariableType(id obj, NSString *iVarName)
return selector;
};
#if GDL2
//--------------------------------------------------------------------
- (id)getIVarNamed:(NSString *)name_
{
id value;
NSLog(@"%@", name_);
NS_DURING
value = [self valueForKey:name_];
NS_HANDLER
{
if([self respondsToSelector:@selector(objectForKey:)] == YES)
value = [self objectForKey:name_];
else
[localException raise];
}
NS_ENDHANDLER;
return value;
}
//--------------------------------------------------------------------
- (void)setIVarNamed:(NSString *)name_
withValue:(id)value_
{
NS_DURING
[self takeValue:value_ forKey:name_];
NS_HANDLER
{
if([self respondsToSelector:@selector(setObject:forKey:)] == YES)
[self setObject:value_ forKey:name_];
else
[localException raise];
}
NS_ENDHANDLER;
}
#else
//--------------------------------------------------------------------
id PDataToId(const char* retType,void* pdata)
{
@ -744,7 +784,7 @@ void IdToPData(const char* retType,id _value,void* pdata)
withCacheObject:_ivarAccess];
// LOGObjectFnStop();
};
#endif