|
From: Steven M. <sr...@us...> - 2005-02-21 06:37:41
|
Update of /cvsroot/instantobjects/Source/Design In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7935 Modified Files: InstantAttributeEditor.pas Log Message: Further updates since external storage unification changes. Still needs further minor update to improve user experience for ObjectFoundry. Index: InstantAttributeEditor.pas =================================================================== RCS file: /cvsroot/instantobjects/Source/Design/InstantAttributeEditor.pas,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** InstantAttributeEditor.pas 18 Feb 2005 14:49:38 -0000 1.11 --- InstantAttributeEditor.pas 21 Feb 2005 06:37:31 -0000 1.12 *************** *** 117,121 **** FModel: TInstantCodeModel; FOnLoadClasses: TInstantStringsEvent; ! FOnLoadClassAttributes: TInstantAttrStringsEvent; function GetSubject: TInstantCodeAttribute; procedure SetSubject(const Value: TInstantCodeAttribute); --- 117,121 ---- FModel: TInstantCodeModel; FOnLoadClasses: TInstantStringsEvent; ! FOnLoadClassAttributes: TInstantAttrStringsEvent; function GetSubject: TInstantCodeAttribute; procedure SetSubject(const Value: TInstantCodeAttribute); *************** *** 430,434 **** Delete(Name, 1, Length(Prefix)); Value := Name; ! end end; --- 430,434 ---- Delete(Name, 1, Length(Prefix)); Value := Name; ! end; end; *************** *** 517,523 **** EnableCtrl(StorageNameEdit, not IsExternal or (Subject.AttributeType = atPart)); ! EnableCtrl(ExternalStorageNameLabel, IsExternal and (Subject.StorageKind = skExternal) and not (Subject.AttributeType = atPart)); ! EnableCtrl(ExternalStorageNameEdit, IsExternal and (Subject.StorageKind = skExternal) and not (Subject.AttributeType = atPart)); --- 517,523 ---- EnableCtrl(StorageNameEdit, not IsExternal or (Subject.AttributeType = atPart)); ! EnableCtrl(ExternalStorageNameLabel, IsExternal and not (Subject.AttributeType = atPart)); ! EnableCtrl(ExternalStorageNameEdit, IsExternal and not (Subject.AttributeType = atPart)); *************** *** 534,543 **** begin with StorageKindEdit do ! SubjectExposer.AssignFieldValue(Field, Text); UpdateControls; end; procedure TInstantAttributeEditorForm.ExternalStorageNameEditChange(Sender: TObject); begin UpdateControls; end; --- 534,548 ---- begin with StorageKindEdit do ! if Text <> '' then ! SubjectExposer.AssignFieldValue(Field, Text); UpdateControls; + ComputeExternalStorageName; end; procedure TInstantAttributeEditorForm.ExternalStorageNameEditChange(Sender: TObject); begin + with ExternalStorageNameEdit do + if Text <> '' then + SubjectExposer.AssignFieldValue(Field, Text); UpdateControls; end; *************** *** 557,561 **** inherited; UpdateControls; - ComputeExternalStorageName; end; --- 562,565 ---- *************** *** 564,571 **** function GetClassStorageName: string; begin ! if Subject.Metadata.ClassMetadata.StorageName <> '' then ! Result := Subject.Metadata.ClassMetadata.StorageName ! else ! Result := Subject.Metadata.ClassMetadata.Name; end; --- 568,586 ---- function GetClassStorageName: string; begin ! if Assigned(FModel) then ! begin ! if Subject.Metadata.ClassMetadata.StorageName <> '' then ! Result := Subject.Metadata.ClassMetadata.StorageName ! else begin ! Result := Subject.Metadata.ClassMetadata.Name; ! // Remove the 'T' from classname ! if (Length(Result) > 1) and (Result[1] = 'T') then ! Delete(Result, 1, 1); ! end; ! end ! else begin ! // ToDo: Fix this up for ObjectFoundry. ! Result := ''; ! end; end; *************** *** 579,592 **** begin - { if ExternalStorageNameEdit.Enabled then - begin ExternalStorageNameEdit.Text := Format('%s_%s', ! [GetClassStorageName(), GetStorageName()]); ! end else ExternalStorageNameEdit.Text := ''; ! } end; end. --- 594,615 ---- begin if ExternalStorageNameEdit.Enabled then ExternalStorageNameEdit.Text := Format('%s_%s', ! [GetClassStorageName(), GetStorageName()]) else ExternalStorageNameEdit.Text := ''; ! end; end. + + + + + + + + + + + |