mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 08:50:16 +02:00
IdeIntf: Support restoring default value in Object Inspector for Set types. Issue #18734.
git-svn-id: trunk@48023 -
This commit is contained in:
parent
1f9ffa32fe
commit
d15ee98ee4
@ -541,6 +541,7 @@ type
|
||||
function GetAttributes: TPropertyAttributes; override;
|
||||
function GetName: shortstring; override;
|
||||
function GetValue: ansistring; override;
|
||||
function GetVerbCount: Integer; override;
|
||||
function GetVisualValue: ansistring; override;
|
||||
procedure GetValues(Proc: TGetStrProc); override;
|
||||
procedure SetValue(const NewValue: ansistring); override;
|
||||
@ -559,6 +560,7 @@ type
|
||||
function GetAttributes: TPropertyAttributes; override;
|
||||
function GetEditLimit: Integer; override;
|
||||
procedure GetProperties(Proc: TGetPropEditProc); override;
|
||||
procedure SetValue(const NewValue: ansistring); override;
|
||||
function OrdValueToVisualValue(OrdValue: longint): string; override;
|
||||
end;
|
||||
|
||||
@ -2809,7 +2811,7 @@ begin
|
||||
with FPropList^[I] do
|
||||
Changed := Changed or (GetOrdProp(Instance, PropInfo) <> NewValue);
|
||||
if Changed then begin
|
||||
for I:=0 to FPropCount-1 do
|
||||
for I := 0 to FPropCount - 1 do
|
||||
with FPropList^[I] do SetOrdProp(Instance, PropInfo, NewValue);
|
||||
Modified;
|
||||
end;
|
||||
@ -3518,6 +3520,11 @@ begin
|
||||
Result := '(' + Result + ')';
|
||||
end;
|
||||
|
||||
function TSetElementPropertyEditor.GetVerbCount: Integer;
|
||||
begin
|
||||
Result:=0;
|
||||
end;
|
||||
|
||||
function TSetElementPropertyEditor.GetVisualValue: ansistring;
|
||||
begin
|
||||
Result := inherited GetVisualValue;
|
||||
@ -3596,6 +3603,20 @@ begin
|
||||
Proc(TSetElementPropertyEditor.Create(Self, I));
|
||||
end;
|
||||
|
||||
procedure TSetPropertyEditor.SetValue(const NewValue: ansistring);
|
||||
var
|
||||
S: TIntegerSet;
|
||||
TypeInfo: PTypeInfo;
|
||||
I: Integer;
|
||||
begin
|
||||
S := [];
|
||||
TypeInfo := GetTypeData(GetPropType)^.CompType;
|
||||
for I := 0 to SizeOf(Integer) * 8 - 1 do
|
||||
if Pos(GetEnumName(TypeInfo, I), NewValue) > 0 then
|
||||
Include(S, I);
|
||||
SetOrdValue(Integer(S));
|
||||
end;
|
||||
|
||||
function TSetPropertyEditor.OrdValueToVisualValue(OrdValue: longint): string;
|
||||
var
|
||||
S: TIntegerSet;
|
||||
|
Loading…
Reference in New Issue
Block a user