mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 00:02:03 +02:00
ideintf: improve TSetElementPropertyEditor - report non default values
git-svn-id: trunk@17609 -
This commit is contained in:
parent
6096d9d91f
commit
cdb0d3c467
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user