IDEIntf: added TOICustomPropertyGrid.OnEditorFilter

git-svn-id: trunk@40747 -
This commit is contained in:
mattias 2013-04-08 10:12:29 +00:00
parent 1531418952
commit eba7a492a5
3 changed files with 20 additions and 2 deletions

1
.gitattributes vendored
View File

@ -5126,6 +5126,7 @@ ideintf/docs/idecommands.xml svneol=native#text/plain
ideintf/docs/ideimagesintf.xml svneol=native#text/plain
ideintf/docs/ideoptionsintf.xml svneol=native#text/plain
ideintf/docs/lazideintf.xml svneol=native#text/plain
ideintf/docs/objectinspector.xml svneol=native#text/plain
ideintf/docs/packageintf.xml svneol=native#text/plain
ideintf/docs/projectintf.xml svneol=native#text/plain
ideintf/fieldseditor.lfm svneol=native#text/plain

View File

@ -0,0 +1,10 @@
<?xml version="1.0"?>
<fpdoc-descriptions><package name="IDEIntf"><module name="ObjectInspector"><element name="TOICustomPropertyGrid.OnEditorFilter"><short>Event for filtering root properties</short><descr>Set <var>aShow</var> to <b>false</b> to not show property.
For example:
<p><code>if aEditor.GetName='Visible' then aShow:=false;</code>
</p>
</descr>
</element>
</module>
</package>
</fpdoc-descriptions>

View File

@ -252,6 +252,9 @@ type
out HintWinRect: TRect; out AHint: string
): boolean of object;
TOIEditorFilterEvent = procedure(Sender: TObject; aEditor: TPropertyEditor;
var aShow: boolean) of object;
TOICustomPropertyGrid = class(TCustomControl)
private
FBackgroundColor: TColor;
@ -260,6 +263,7 @@ type
FGutterEdgeColor: TColor;
FHighlightColor: TColor;
FLayout: TOILayout;
FOnEditorFilter: TOIEditorFilterEvent;
FOnOIKeyDown: TKeyEvent;
FOnPropertyHint: TOIPropertyHint;
FOnSelectionChange: TNotifyEvent;
@ -481,6 +485,7 @@ type
property Indent: integer read FIndent write FIndent;
property ItemIndex: integer read FItemIndex write SetItemIndex;
property Layout: TOILayout read FLayout write FLayout default oilHorizontal;
property OnEditorFilter: TOIEditorFilterEvent read FOnEditorFilter write FOnEditorFilter;
property OnModified: TNotifyEvent read FOnModified write FOnModified;
property OnOIKeyDown: TKeyEvent read FOnOIKeyDown write FOnOIKeyDown;
property OnSelectionChange: TNotifyEvent read FOnSelectionChange write FOnSelectionChange;
@ -2281,6 +2286,8 @@ function TOICustomPropertyGrid.EditorFilter(
const AEditor: TPropertyEditor): Boolean;
begin
Result := IsInteresting(AEditor, FFilter);
if Result and Assigned(OnEditorFilter) then
OnEditorFilter(Self,AEditor,Result);
end;
procedure TOICustomPropertyGrid.EraseBackground(DC: HDC);
@ -3107,7 +3114,7 @@ begin
end;
end;
procedure TOICustomPropertyGrid.HintTimer(sender : TObject);
procedure TOICustomPropertyGrid.HintTimer(Sender: TObject);
var
HintRect : TRect;
AHint : String;
@ -3173,7 +3180,7 @@ begin
FHintWindow.ActivateHint(HintRect, AHint);
end;
Procedure TOICustomPropertyGrid.ResetHintTimer;
procedure TOICustomPropertyGrid.ResetHintTimer;
begin
if FHintWindow = nil then exit;