Recent

Author Topic: how do I get items in object inspector tree view  (Read 8426 times)

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: how do I get items in object inspector tree view
« Reply #15 on: February 13, 2017, 02:43:57 pm »
Look at the sourcecode for any of the provided components that show sub components in the object inspector. There are many of those.
Basically: write a component editor for it.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: how do I get items in object inspector tree view
« Reply #16 on: February 13, 2017, 05:21:35 pm »
Look at the sourcecode for any of the provided components that show sub components in the object inspector. There are many of those.
Basically: write a component editor for it.
We have traveled this route. It's about the TreeView not the OI grid.
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: how do I get items in object inspector tree view
« Reply #17 on: February 13, 2017, 05:25:07 pm »
Look at the sourcecode for any of the provided components that show sub components in the object inspector. There are many of those.
Basically: write a component editor for it.
We have traveled this route. It's about the TreeView not the OI grid.
Well, why doesn't that work then? A custom property editor CAN use a treeview.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

Michael Collier

  • Sr. Member
  • ****
  • Posts: 301
Re: how do I get items in object inspector tree view
« Reply #18 on: February 13, 2017, 05:41:20 pm »
Maybe some confusion here.. The tree view that I'm referring to is the one in the top of the object inspector. I'm not looking to use a TTreeview in my own property editor.

Ernest

  • Newbie
  • Posts: 6
Re: how do I get items in object inspector tree view
« Reply #19 on: February 13, 2023, 05:50:26 pm »
The tree view that I'm referring to is the one in the top of the object inspector.

Unfortunately, that thread ended almost 5 years ago without a constructive solution. Is there any good solution for the described need?

In my case:
I'm trying to create a custom component Hugo derived from TPanel. Let's say, Hugo has 5 buttons so i can switch between 5 pages. So i created a variable FNotes (derived from TNotebook) which is my subcomponent. Because i registered Hugo in the palette, so i can place him on the main form and he is visible in the Object Inspector (OI) as a graphic icon with its properties in the grid.

Problem:
The thing is that i can only access the pages in the code (e.g. via Hugo.FNotes.Page...) to place a button or other visual element on it. I want to place different elements on each page individually and it will be helpful for a design time to see every placed object on it.

Question:
How is it possible to show the subcomponents of a custom component (=own creation!) in the tree view in the Object Inspector? Like it happens standard if you place elements on themself (cf. attached pic below for a better understanding).

Disclaimer
I described above just a reduced principle example. I know, the easiest solution in that case is just to put TNotebook on the main form and place visual component on it.

 

TinyPortal © 2005-2018