Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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;
like image 957
Jon Lennart Aasenden Avatar asked Nov 04 '22 05:11

Jon Lennart Aasenden


1 Answers

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

like image 178
Wouter van Nifterick Avatar answered Nov 15 '22 05:11

Wouter van Nifterick