mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 21:39:21 +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 GetAttributes: TPropertyAttributes; override;
|
||||||
function GetName: shortstring; override;
|
function GetName: shortstring; override;
|
||||||
function GetValue: ansistring; override;
|
function GetValue: ansistring; override;
|
||||||
|
function GetVerbCount: Integer; override;
|
||||||
function GetVisualValue: ansistring; override;
|
function GetVisualValue: ansistring; override;
|
||||||
procedure GetValues(Proc: TGetStrProc); override;
|
procedure GetValues(Proc: TGetStrProc); override;
|
||||||
procedure SetValue(const NewValue: ansistring); override;
|
procedure SetValue(const NewValue: ansistring); override;
|
||||||
@ -559,6 +560,7 @@ type
|
|||||||
function GetAttributes: TPropertyAttributes; override;
|
function GetAttributes: TPropertyAttributes; override;
|
||||||
function GetEditLimit: Integer; override;
|
function GetEditLimit: Integer; override;
|
||||||
procedure GetProperties(Proc: TGetPropEditProc); override;
|
procedure GetProperties(Proc: TGetPropEditProc); override;
|
||||||
|
procedure SetValue(const NewValue: ansistring); override;
|
||||||
function OrdValueToVisualValue(OrdValue: longint): string; override;
|
function OrdValueToVisualValue(OrdValue: longint): string; override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -3518,6 +3520,11 @@ begin
|
|||||||
Result := '(' + Result + ')';
|
Result := '(' + Result + ')';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TSetElementPropertyEditor.GetVerbCount: Integer;
|
||||||
|
begin
|
||||||
|
Result:=0;
|
||||||
|
end;
|
||||||
|
|
||||||
function TSetElementPropertyEditor.GetVisualValue: ansistring;
|
function TSetElementPropertyEditor.GetVisualValue: ansistring;
|
||||||
begin
|
begin
|
||||||
Result := inherited GetVisualValue;
|
Result := inherited GetVisualValue;
|
||||||
@ -3596,6 +3603,20 @@ begin
|
|||||||
Proc(TSetElementPropertyEditor.Create(Self, I));
|
Proc(TSetElementPropertyEditor.Create(Self, I));
|
||||||
end;
|
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;
|
function TSetPropertyEditor.OrdValueToVisualValue(OrdValue: longint): string;
|
||||||
var
|
var
|
||||||
S: TIntegerSet;
|
S: TIntegerSet;
|
||||||
|
Loading…
Reference in New Issue
Block a user