options editor, generic editor, spoted bug, props not filtered when that target is a sub-component

This commit is contained in:
Basile Burg 2015-10-17 00:18:19 +02:00
parent e2a763708b
commit 236cd0fac8
2 changed files with 9 additions and 3 deletions

View File

@ -36,7 +36,7 @@ inherited CEOptionEditorWidget: TCEOptionEditorWidget
Width = 140
Align = alLeft
AutoExpand = True
DefaultItemHeight = 18
DefaultItemHeight = 16
HideSelection = False
ReadOnly = True
ScrollBars = ssAutoBoth

View File

@ -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;