2

I experimented with various Delphi property editors and even made an editor as a separate window.

Now I would like to develop a visual control containing variable amount of several complex display items like this:

┌─────────────────────────┐
│    Parent control       │
│ ┌─────────────────────┐ │
│ │   Display Item 1    │ │
│ ├─────────────────────┤ │
│ │   Display Item 2    │ │
│ ├─────────────────────┤ │
│ │   Display Item 3    │ │
│ ├─────────────────────┤ │
│ │   Display Item 4    │ │
│ └─────────────────────┘ │
└─────────────────────────┘

and would like to edit each Display Item's properties in Object Inspector like it the TPageControl with its TTabSheets does.

It means that I click on some of Display Items and its properties appear in Object Inspector, ready to edit. I click Parent Control and can edit it's properties in Object Inspector.

How to achieve this? Please give me a clue.

P.S. I thought about the TDBGrid property editor, but it behaves differently: When I click on columns property in Object Inspector columns editor window appears and when I select some item in it, I can edit it's properties. I would like to do this without intermediate window.

Paul
  • 25,812
  • 38
  • 124
  • 247
  • You might take a look at the source code of TDBGrid control: its columns are basically items in a collection owned by the grid control itself. – MartynA Jan 12 '18 at 15:22
  • 1
    A Tabsheet is a separate object with its own properties - it is just that a page control manages the adding and removing of the child objects and their visiblity. When you click on a tab sheet you make that object active just because you clicked on it. Put in the context of your control, each display line would be an object in its own right with its own properties. I think that somehow you imagine that the properties of a tab sheet are somehow child properties of the TPageControl, but this is not the case. – Dsm Jan 12 '18 at 15:24
  • In what respect does it "behave differently"? The IDE presents the Columns in the OI, where they can be individually edited, so how does what what you want to do differ? – MartynA Jan 12 '18 at 15:26
  • 1
    I don't see a problem here. So long as you keep the control with default settings and you won't let it be a subcomponent (by `SetSubComponent`), you should achieve what you want. – Victoria Jan 12 '18 at 15:26
  • Related: https://stackoverflow.com/questions/8406567/creating-a-component-with-named-sub-components – Jerry Dodge Jan 12 '18 at 15:35
  • 1
    So, thank you girls and guys. Your advices were extremely helpful, but I'll continue on monday and will look at SetSubComponent :) – Paul Jan 12 '18 at 15:50
  • @Paul 'how to "Put in the context of your control"' by treating your display items as separate objects in their own right with their own published properties and only using parent control to manage them as entities. – Dsm Jan 15 '18 at 09:16

0 Answers0