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] 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 Indent = 16
NameFont.Color = clWindowText NameFont.Color = clWindowText
OnEditorFilter = inspectorEditorFilter
OnModified = inspectorModified OnModified = inspectorModified
PreferredSplitterX = 170 PreferredSplitterX = 170
SplitterX = 170 SplitterX = 170

View File

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