ideintf: improve TSetElementPropertyEditor - report non default values

git-svn-id: trunk@17609 -
This commit is contained in:
paul 2008-11-27 03:29:28 +00:00
parent 6096d9d91f
commit cdb0d3c467

View File

@ -528,6 +528,7 @@ type
function GetValue: ansistring; override;
procedure GetValues(Proc: TGetStringProc); override;
procedure SetValue(const NewValue: ansistring); override;
function IsNotDefaultValue: boolean; override;
end;
{ TSetPropertyEditor
@ -3201,6 +3202,8 @@ end;
function TSetElementPropertyEditor.GetAttributes: TPropertyAttributes;
begin
Result := [paMultiSelect, paValueList, paSortList];
if GetDefaultOrdValue <> NoDefaultValue then
Result := Result + [paHasDefaultValue];
end;
function TSetElementPropertyEditor.GetName: shortstring;
@ -3234,6 +3237,19 @@ begin
SetOrdValue(Integer(S));
end;
function TSetElementPropertyEditor.IsNotDefaultValue: boolean;
var
S1, S2: TIntegerSet;
begin
Result := (paHasDefaultValue in GetAttributes);
if Result then
begin
Integer(S1) := GetOrdValue;
Integer(S2) := GetDefaultOrdValue;
Result := (FElement in S1) <> (FElement in S2);
end;
end;
{ TSetPropertyEditor }
function TSetPropertyEditor.GetAttributes: TPropertyAttributes;