Jon Lennart Aasenden
Jon Lennart Aasenden

Reputation: 4020

Delphi non-rtti inspector

I have some virtual controls which is a part of a designer system i have made. They mimic delphi's own components, except that they are fully owner-drawn. The problem I am faced with is that, since my property system is somewhat different from ordinary Delphi - I cant use an RTTI inspector to edit the properties.

Does anyone know about a inspector that looks and acts like the normal delphi inspector, but that allows me to define the properties by code?

And if possible, one which allows me to define enums:

with edInspector.Items.add('align') do
Begin
  Options.add('alLeft',ftord(TMyAlign.azLeft));
  Options.add('alTop',ord(TMyAlign.azTop));
  Options.add('alRight',ord(TMyAlign.azRight));
  Options.add('alBottom',ord(TMyAlign.azBottom));
  Options.add('alClient',ord(TMyAlign.azClient));
end;

and complex types:

with edInspector.Items.add('font') do
Begin
  subitems.add('name',dtString).value:=def_FontName;
  subitems.add('size',dtInteger).value:=def_fontSize;
  subitems.add('color',dtColor).Value:=def_fontColor;
end;

Upvotes: 5

Views: 1420

Answers (2)

menjaraz
menjaraz

Reputation: 7575

With Delphi Runtime Inspector, you will be able to see object information at run-time.

Upvotes: 0

Wouter van Nifterick
Wouter van Nifterick

Reputation: 24086

Give Inspex a try. It's pretty cool.

http://www.raize.com/DevTools/Inspex/Default.asp

You can add properties dynamically, and you'll get property editors for most of the common types.

It can behave pretty much like the Delphi object inspector (it lets you edit sets, if you add multiple objects, it detects which properties are the same, and hides the others, and it does the same for property values).

It shows properties in a tree-like structure if there are multiple levels. You can easily populate it by adding any TObject, via a string, or by adding the properties one by one.

Screenshot:

Screenshot

Upvotes: 2

Related Questions