mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-23 14:29:07 +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;
|
function GetValue: ansistring; override;
|
||||||
procedure GetValues(Proc: TGetStringProc); override;
|
procedure GetValues(Proc: TGetStringProc); override;
|
||||||
procedure SetValue(const NewValue: ansistring); override;
|
procedure SetValue(const NewValue: ansistring); override;
|
||||||
|
function IsNotDefaultValue: boolean; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TSetPropertyEditor
|
{ TSetPropertyEditor
|
||||||
@ -3201,6 +3202,8 @@ end;
|
|||||||
function TSetElementPropertyEditor.GetAttributes: TPropertyAttributes;
|
function TSetElementPropertyEditor.GetAttributes: TPropertyAttributes;
|
||||||
begin
|
begin
|
||||||
Result := [paMultiSelect, paValueList, paSortList];
|
Result := [paMultiSelect, paValueList, paSortList];
|
||||||
|
if GetDefaultOrdValue <> NoDefaultValue then
|
||||||
|
Result := Result + [paHasDefaultValue];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSetElementPropertyEditor.GetName: shortstring;
|
function TSetElementPropertyEditor.GetName: shortstring;
|
||||||
@ -3234,6 +3237,19 @@ begin
|
|||||||
SetOrdValue(Integer(S));
|
SetOrdValue(Integer(S));
|
||||||
end;
|
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 }
|
{ TSetPropertyEditor }
|
||||||
|
|
||||||
function TSetPropertyEditor.GetAttributes: TPropertyAttributes;
|
function TSetPropertyEditor.GetAttributes: TPropertyAttributes;
|
||||||
|
Loading…
Reference in New Issue
Block a user