Expose sub components to Delphi designer - delphi

I have created a component inheriting TFrame and added an ActionList and ToolBar to the frame as I want to make a base form available to other projects and developers. The question is: how can I expose the ActionList property at design time? The ActionList is showing in the object inspector and I can see it's events and properties, but the actions inside the ActionList are not available at design time.
More details:
I have created a class inheriting from TFrame and added an TActionList in the Delphi IDE designer. Then I added it to a package and installed it as a component. Now I can drop that component on a form and it adds the whole frame I designed to the form. I see the ActioList in the object inspector, but the problem is I cannot see the actions inside the ActionList. I need to add actions to ActionList on the forms which are using the component.

Related

(delphi) how to add property to child controls?

In the Delphi IDE, some components in Delphi have the ability to "add" properties to the child controls they contain in the property editor.
How can I achieve the same thing with my own TCustomPanel descendant?
Some more details:
What I want to achieve is the following: I have a very complex configuration dialog for an application with a large number of visual components.
I want to add to each of these components a "complexity index" (an integer) that will be used to show or hide the component based on a selection made by the user (a dropdown with "simple", "advanced" and "expert" options).
I understand that the property will actually belong to the parent panel but I need a way to display it, in the IDE, as if it was attached to the control it is related to.
The perfect exemples are the various "organizational" panels provided by Delphi: TGridPanel and TRelativePanel. Each of these have a ControlCollection (published) properties that is used to hold the actual states of the additional properties but I failed to locate how the property editor knows that it must attach the properties to the child controls.
Here is a screenshot of a TLabel placed inside a TRelativePanel with the relevant properties highlighted:

How to add a child control to a TActionToolBar?

I have a TActionManager setup with various actions which are then displayed in both a TActionMainMenuBar and a TActionToolBar.
What I require is to be able to display a TComboBox as a child to the TActionToolBar. I tried creating a new TActionClientItem and changing the CommandStyle to csComboBox and assigning my TComboBox to the ContainedControl property but at runtime there is no change, ie the combo box is not shown as a child control in the TActionToolBar.
I have tried toggling and changing several properties within the TActionClientItem with no luck, I then turned to the help docs and found the following:
Use CommandStyle to change the behavior and the appearance of an action client item located on a ribbon group. CommandStyle has no effect if the action client item is not located on a ribbon group.
So I guess CommandStyle was misleading me and hence changing those properties had no effect because I am not using a ribbon control.
Due to the design of my Application I don't want to switch to other controls such as TToolBar or TCoolBar for example. Is it possible to allow child controls such as a TComboBox to be used on a TActionToolBar?

Is there a way to activate component editor menu for a concealed component in Delphi

I implemented two menu items for my component in Delphi IDE with TComponentEditor descendant. They're both supposed to be used with "right-clicking" a component on the form. But can I do this for component that is currently hidden (concealed) by other components? So I select a component with other tools (for example object inspector) and would like to activate one of my context menu items.
Shift-F10 doesn't work (at least in D5).
Bringing the component to top for this task is not an option.
Right-click the component in the Object TreeView (Shift-Alt-F11).
D7: Menu > View > Object TreeView
XE2: Menu > View > Structure
Or make a property editor with paDialog in the attributes and forward the Edit method to your component editor. Then double clicking that property or clicking the ellipsis will bring up the component editor, just like the Colums property for TDBEdit does.
If you feel like writing a something mimicking Delphi IDE's Object TreeView, I suggests you the following resources:
Populating all controls of a container object using recursion (Blog post). Using TVirtualTreeView like the Delphi IDE is better than the stock TTreeView to my opinion.
Study the commercial TLMDComponentTree
of the LMD IDE-Tools (Excerpt: This powerful control allows to use a Delphi IDE like Object TreeView. Collections, child controls etc. are automatically handled).

Delphi Making Component From a TForm object

I have a added components on a form object dynamically
Edit1 := TEdit.Create(form3);
I have got the object form3 of Tform class. Now what i want to do is I want to create a component template of form3 so that I can just drag and drop that component template on any of my other from and all the components present in it will be automatically available for me to use. Can any one help me with how to about doing component template?
From the second part of your question it seems you want to make a reuseable Frame that you can drop at design time on a form, and drag it around. Frames can be dropped multiple times on multiple forms. Changes in the design are reflected in the copies. Create a frame with File > New > Frame (Delphi 7) or File > New > Other > Delphi Projects > Delphi Files > VCL Frame (XE2).
However, if the components therein should also be visible during designing, then you have to create those controls also at designtime. A frame works exactly like a normal form, so there should be no problem there. Controls generated in code will only show up at runtime, which is just fine if you want that.

Firemonkey and dockable forms

Is it possible to have dockable forms in FireMonkey, as I have inspected the forms properties, and there is no such property to do that.
Is there any workaround to accomplish that?
There's nothing built in, as far as I know but it shouldn't be too difficult to add in yourself. Just bear in mind that any form can parent any control on another form:
On the child form, add any controls inside a container (e.g. a TLayout).
Create the child form.
Set the Parent property of the TLayout (etc.) to the parent form (or, more probably a container on the parent form so you can set the child TLayout's alignment to alClient).
If you want to show the placement during a drag operation, experiment with the various effec ts included.
Unlike VCL, the Firemonkey does not have a built-in dockable interface for creating dock forms. But there is a commercial component for creating a complete dockable interface in FMX. The component implements dockable forms only. So far, the docked document panels are not supported (like the visual studio IDE does) and no docked toolbars. But in general, they have all the necessary functionality, including auto-hide panels and the ability to be saved/restored in/from XML.
https://www.devmachines.com/firedocking-overview.html

Resources