fix, hide TComponent props in option editor.

Name modification could lead to load/save errors
This commit is contained in:
Basile Burg 2015-02-24 10:06:04 +01:00
parent a23eb197d0
commit a9c03259d7
2 changed files with 18 additions and 1 deletions

View File

@ -66,6 +66,7 @@ inherited CEOptionEditorWidget: TCEOptionEditorWidget
Filter = [tkInteger, tkChar, tkEnumeration, tkFloat, tkSet, tkMethod, tkSString, tkLString, tkAString, tkWString, tkVariant, tkArray, tkRecord, tkInterface, tkClass, tkObject, tkWChar, tkBool, tkInt64, tkQWord, tkDynArray, tkInterfaceRaw, tkProcVar, tkUString, tkUChar, tkHelper]
Indent = 16
NameFont.Color = clWindowText
OnEditorFilter = inspectorEditorFilter
OnModified = inspectorModified
PreferredSplitterX = 170
SplitterX = 170

View File

@ -7,7 +7,7 @@ interface
uses
Classes, SysUtils, FileUtil, RTTIGrids, Forms, Controls, Graphics, ExtCtrls,
Menus, ComCtrls, Buttons, ce_common, ce_widget, ce_interfaces,
ce_observer;
ce_observer, PropEdits, ObjectInspector;
type
@ -22,6 +22,8 @@ type
//TODO-cbugfix: linux only, a conversion error is raised after a color's been edited using the dialog color.
{ TCEOptionEditorWidget }
TCEOptionEditorWidget = class(TCEWidget)
btnCancel: TSpeedButton;
btnAccept: TSpeedButton;
@ -33,6 +35,8 @@ type
selCat: TTreeView;
procedure btnAcceptClick(Sender: TObject);
procedure btnCancelClick(Sender: TObject);
procedure inspectorEditorFilter(Sender: TObject; aEditor: TPropertyEditor;
var aShow: boolean);
procedure inspectorModified(Sender: TObject);
procedure selCatDeletion(Sender: TObject; Node: TTreeNode);
procedure selCatSelectionChanged(Sender: TObject);
@ -175,6 +179,18 @@ begin
.optionedEvent(oeeCancel);
end;
procedure TCEOptionEditorWidget.inspectorEditorFilter(Sender: TObject;aEditor:
TPropertyEditor; var aShow: boolean);
begin
if aEditor.GetComponent(0) is TComponent then
begin
if aEditor.GetPropInfo^.Name = 'Tag' then
aSHow := false;
if aEditor.GetPropInfo^.Name = 'Name' then
aSHow := false;
end;
end;
procedure TCEOptionEditorWidget.btnAcceptClick(Sender: TObject);
begin
if selCat.Selected = nil then exit;