From 236cd0fac84bf18ffefcca4b3e5a16ea439ed580 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Sat, 17 Oct 2015 00:18:19 +0200 Subject: [PATCH] options editor, generic editor, spoted bug, props not filtered when that target is a sub-component --- src/ce_optionseditor.lfm | 2 +- src/ce_optionseditor.pas | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ce_optionseditor.lfm b/src/ce_optionseditor.lfm index 5922b1d1..4d644e7e 100644 --- a/src/ce_optionseditor.lfm +++ b/src/ce_optionseditor.lfm @@ -36,7 +36,7 @@ inherited CEOptionEditorWidget: TCEOptionEditorWidget Width = 140 Align = alLeft AutoExpand = True - DefaultItemHeight = 18 + DefaultItemHeight = 16 HideSelection = False ReadOnly = True ScrollBars = ssAutoBoth diff --git a/src/ce_optionseditor.pas b/src/ce_optionseditor.pas index 2cb0f993..3930cda3 100644 --- a/src/ce_optionseditor.pas +++ b/src/ce_optionseditor.pas @@ -243,12 +243,18 @@ end; procedure TCEOptionEditorWidget.inspectorEditorFilter(Sender: TObject;aEditor: TPropertyEditor; var aShow: boolean); +var + nme: string; + len: integer; begin if aEditor.GetComponent(0) is TComponent then begin - if aEditor.GetPropInfo^.Name = 'Tag' then + nme := aEditor.GetPropInfo^.Name; + len := length(nme); + // TODO-cbugfix: filtering does not work on sub componenets 'e.g D2HL options) + if (len > 2) and (nme[len - 2 .. len] = 'Tag') then aShow := false - else if aEditor.GetPropInfo^.Name = 'Name' then + else if (len > 3) and (nme[len - 3 .. len] = 'Name') then aShow := false else if aEditor.GetPropInfo^.PropType = TypeInfo(TCollection) then aShow := false;