LMD DesignPack Guide


Design Objects Collections


TLMDDesignObjects is a component for representing object collections. For example, it can represent designer current selection. The instances of this class can be connected to several LMD-DesignPack components and play different roles. Like DB-aware Delphi visual controls automatically communicate with datasets, LMD-DesignPack controls communicate with TLMDDesignObjects collections. So, by clicking some component while designing, you will change object TLMDDesignObjects collection connected to TLMDDesigner.Selection property. Also, by changing such collection manually in code, you will change selected in designer components.

 

The key idea of TLMDDesignObjects – is that it can be connected to more then one Design Pack component. For example, same collection can be connected to TLMDDesigner.Selection property and to TLMDPropertyInspector.Selection property. This will force property inspector to show currently selected in designer components. However, you if you don’t want property inspector to be synchronized with designer you can use distinct Selection collection for property inspector and fill it manually in code.

 

The collection item type is TPersistent. So, for example, objects that are inspected in property inspector should be at least descendants of TPersistent class. Though a designer mostly operates with components, that are TComponent descendants, designer selection can still contain instances that are not descendants of TComponent. This is made to be consistent with property inspector and to support different VCL like property and component editors. Such property (or component) editor can change current selection. For example, collection editor changes selection when you click on one of the collection items. And such a collection item is not a descendant of TComponent.