From: <sr...@us...> - 2006-04-11 01:05:46
|
Revision: 666 Author: srmitch Date: 2006-04-10 18:05:38 -0700 (Mon, 10 Apr 2006) ViewCVS: http://svn.sourceforge.net/instantobjects?rev=666&view=rev Log Message: ----------- Fix for bug #1467511 in SF BT. Bug Symptom(s): Currently, when adding a new attribute in ModelMaker, in the attribute editor there aren't field types other than "part" and "parts" available. Bug Cause: The current code in InstantAttributeEditor does not check to see if the attribute is a Complex type before restricting the types loaded. Fix affects: <<InstantAttributeEditor.pas>> procedure TInstantAttributeEditorForm.LoadTypes. Modified Paths: -------------- trunk/Source/Design/InstantAttributeEditor.pas Modified: trunk/Source/Design/InstantAttributeEditor.pas =================================================================== --- trunk/Source/Design/InstantAttributeEditor.pas 2006-04-10 18:55:03 UTC (rev 665) +++ trunk/Source/Design/InstantAttributeEditor.pas 2006-04-11 01:05:38 UTC (rev 666) @@ -282,6 +282,20 @@ end; procedure TInstantAttributeEditorForm.LoadTypes; + + procedure RestrictForComplexAttr; + var + I: Integer; + begin + for I := Pred(TypeEdit.Items.Count) downto 0 do + if not ((TypeEdit.Items[I] = 'Part') or + (TypeEdit.Items[I] = 'Parts') or + (IsClassPersistent(ObjectClassEdit.Text) and + ((TypeEdit.Items[I] = 'Reference') or + (TypeEdit.Items[I] = 'References')))) then + TypeEdit.Items.Delete(I); + end; + var I: Integer; begin @@ -292,14 +306,8 @@ I := TypeEdit.Items.IndexOf('Unknown'); if I <> -1 then TypeEdit.Items.Delete(I); - if not Assigned(FModel) then - for I := Pred(TypeEdit.Items.Count) downto 0 do - if not ((TypeEdit.Items[I] = 'Part') or - (TypeEdit.Items[I] = 'Parts') or - (IsClassPersistent(ObjectClassEdit.Text) and - ((TypeEdit.Items[I] = 'Reference') or - (TypeEdit.Items[I] = 'References')))) then - TypeEdit.Items.Delete(I); + if not Assigned(FModel) and Subject.IsComplex then + RestrictForComplexAttr; finally TypeEdit.Items.EndUpdate; end; |