From: <sr...@us...> - 2006-05-30 06:52:52
|
Revision: 681 Author: srmitch Date: 2006-05-29 23:52:37 -0700 (Mon, 29 May 2006) ViewCVS: http://svn.sourceforge.net/instantobjects?rev=681&view=rev Log Message: ----------- Two fixes and a doc update: 1. Fix for # 1496971 Bug In Model Explorer Setting Index and Required properties. Applied to TInstantAttributeEditorForm.SaveData in InstantAttributeEditor.pas. 2. Fix for AV in Model Explorer when setting Method access properties for container attributes. Applied to TInstantCodeAttributeTailor.DeleteMethods in InstantCode.pas. 3. Updated Changes.txt file for the bug fix above. Modified Paths: -------------- trunk/Docs/Changes.txt trunk/Source/Core/InstantCode.pas trunk/Source/Design/InstantAttributeEditor.pas Modified: trunk/Docs/Changes.txt =================================================================== --- trunk/Docs/Changes.txt 2006-05-29 03:23:15 UTC (rev 680) +++ trunk/Docs/Changes.txt 2006-05-30 06:52:37 UTC (rev 681) @@ -5,6 +5,9 @@ - Help file has been improved. +- Bug fix for # 1496971 Bug In Model Explorer Setting Index and + Required properties. + - Bug fix for # 1475841. "TInstantContainer.Sort error if empty". - Bug fix for # 1475982. Rebuilding a Firebird database creates Modified: trunk/Source/Core/InstantCode.pas =================================================================== --- trunk/Source/Core/InstantCode.pas 2006-05-29 03:23:15 UTC (rev 680) +++ trunk/Source/Core/InstantCode.pas 2006-05-30 06:52:37 UTC (rev 681) @@ -3440,11 +3440,17 @@ procedure TInstantCodeAttributeTailor.DeleteMethods; begin DeleteItem(FAddMethod); + FAddMethod := nil; DeleteItem(FClearMethod); + FClearMethod := nil; DeleteItem(FDeleteMethod); + FDeleteMethod := nil; DeleteItem(FIndexOfMethod); + FIndexOfMethod := nil; DeleteItem(FInsertMethod); + FInsertMethod := nil; DeleteItem(FRemoveMethod); + FRemoveMethod := nil; end; destructor TInstantCodeAttributeTailor.Destroy; Modified: trunk/Source/Design/InstantAttributeEditor.pas =================================================================== --- trunk/Source/Design/InstantAttributeEditor.pas 2006-05-29 03:23:15 UTC (rev 680) +++ trunk/Source/Design/InstantAttributeEditor.pas 2006-05-30 06:52:37 UTC (rev 681) @@ -429,38 +429,58 @@ // SubjectExposer.PostChanges does not overwrite our changes. procedure TInstantAttributeEditorForm.SaveData; - procedure SaveOptions; + function SetChangedField(const AFieldName: String; ACheckBoxChecked: Boolean): + Boolean; begin - SubjectExposer.FieldByName('IsIndexed').AsBoolean := - OptionIndexedCheckBox.Checked; - SubjectExposer.FieldByName('IsRequired').AsBoolean := - OptionRequiredCheckBox.Checked; - SubjectExposer.FieldByName('ReadOnly').AsBoolean := - OptionReadOnlyCheckBox.Checked; - SubjectExposer.FieldByName('IsDefault').AsBoolean := - OptionDefaultCheckBox.Checked; + Result := False; + if SubjectExposer.FieldByName(AFieldName).AsBoolean <> + ACheckBoxChecked then + begin + SubjectExposer.FieldByName(AFieldName).AsBoolean := + ACheckBoxChecked; + Result := True; + end; end; - procedure SaveMethods; + function SaveOptions: Boolean; begin - SubjectExposer.FieldByName('IncludeAddMethod').AsBoolean := - MethodAddCheckBox.Checked; - SubjectExposer.FieldByName('IncludeRemoveMethod').AsBoolean := - MethodRemoveCheckBox.Checked; - SubjectExposer.FieldByName('IncludeInsertMethod').AsBoolean := - MethodInsertCheckBox.Checked; - SubjectExposer.FieldByName('IncludeDeleteMethod').AsBoolean := - MethodDeleteCheckBox.Checked; - SubjectExposer.FieldByName('IncludeIndexOfMethod').AsBoolean := - MethodIndexOfCheckBox.Checked; - SubjectExposer.FieldByName('IncludeClearMethod').AsBoolean := - MethodClearCheckBox.Checked; + Result := False; + if SetChangedField('IsIndexed', OptionIndexedCheckBox.Checked) then + Result := True; + if SetChangedField('IsRequired', OptionRequiredCheckBox.Checked) then + Result := True; + if SetChangedField('ReadOnly', OptionReadOnlyCheckBox.Checked) then + Result := True; + if SetChangedField('IsDefault', OptionDefaultCheckBox.Checked) then + Result := True; end; + function SaveMethods: Boolean; + begin + Result := False; + if SetChangedField('IncludeAddMethod', MethodAddCheckBox.Checked) then + Result := True; + if SetChangedField('IncludeRemoveMethod', MethodRemoveCheckBox.Checked) then + Result := True; + if SetChangedField('IncludeInsertMethod', MethodInsertCheckBox.Checked) then + Result := True; + if SetChangedField('IncludeDeleteMethod', MethodDeleteCheckBox.Checked) then + Result := True; + if SetChangedField('IncludeIndexOfMethod', MethodIndexOfCheckBox.Checked) then + Result := True; + if SetChangedField('IncludeClearMethod', MethodClearCheckBox.Checked) then + Result := True; + end; + +var + OptionsChanged: Boolean; + MethodsChanged: Boolean; begin inherited; - SaveOptions; - SaveMethods; + OptionsChanged := SaveOptions; + MethodsChanged := SaveMethods; + if OptionsChanged or MethodsChanged then + SubjectExposer.Edit; end; procedure TInstantAttributeEditorForm.SetLimited(Value: Boolean); |