Revert partly "Add HookGetCheckboxForBoolean handler in OI only once."

This reverts partly commit 943e4e4ff7.
This commit is contained in:
Basile Burg 2021-09-26 16:28:56 +02:00 committed by Juha
parent 0b368ce10d
commit 45a590ed0b

View File

@ -1385,6 +1385,7 @@ procedure TOICustomPropertyGrid.SetPropertyEditorHook(
begin begin
if FPropertyEditorHook=NewPropertyEditorHook then exit; if FPropertyEditorHook=NewPropertyEditorHook then exit;
FPropertyEditorHook:=NewPropertyEditorHook; FPropertyEditorHook:=NewPropertyEditorHook;
FPropertyEditorHook.AddHandlerGetCheckboxForBoolean(@HookGetCheckboxForBoolean);
IncreaseChangeStep; IncreaseChangeStep;
SetSelection(FSelection); SetSelection(FSelection);
end; end;
@ -4512,12 +4513,7 @@ begin
Selection := nil; Selection := nil;
for Page:=Low(TObjectInspectorPage) to High(TObjectInspectorPage) do for Page:=Low(TObjectInspectorPage) to High(TObjectInspectorPage) do
if GridControl[Page]<>nil then if GridControl[Page]<>nil then
begin
if Page=oipgpProperties then // Add HookGetCheckboxForBoolean only once.
FPropertyEditorHook.AddHandlerGetCheckboxForBoolean(
@GridControl[Page].HookGetCheckboxForBoolean);
GridControl[Page].PropertyEditorHook:=FPropertyEditorHook; GridControl[Page].PropertyEditorHook:=FPropertyEditorHook;
end;
OldSelection:=TPersistentSelectionList.Create; OldSelection:=TPersistentSelectionList.Create;
try try
FPropertyEditorHook.GetSelection(OldSelection); FPropertyEditorHook.GetSelection(OldSelection);