Object TreeView brief description
In Delphi 6 IDE, the most prominent new feature may be Object TreeView. Since Delphi 6 is relatively new, it is very small to introduce it, so many people don't know how to use Object TreeView, even too much to turn it off. In fact, when the components on the form are increasing, you will find the powerful features of Object TreeView.
The following is a brief introduction to the Object TreeView feature, its main content takesselves from "Mastering Delphi 6", I just do some work to finish and translate. I hope to help with friends who use Delphi 6.
About Object TreeView
1. In the Data Module designer of Delphi 5, a TreeView uses a relationship between non-visual components (such as DataSet, Fields, Actions, etc.). Object TreeView in Delphi 6 is its extension, not only for Data Module, but also available for normal forms and other objects.
If Object TreeView is currently invisible, you want to use it, select View | Object TreeView.
2. Object TreeView uses a hierarchical view to display components on the form and the relationship between them. The most typical is the father and child relationship: For example, all the components on the FORM are sub-nodes of Form; if you put a panel to the form, put a button on the Panel, but Button will become a child node of Panel.
Object TreeView, Object Inspector, and Form Designer are synchronized. That is to say, the component is automatically selected in the Object TreeView in the Object TreeView, and the properties and events of the component are displayed in the Object Inspector; the same, select a component in Object TreeView, This component will also be selected at the same time, and its properties and events are displayed in the Object Inspector. Therefore, Object Inspector can be seen as an enhancement of the form designer, more in the form, and is covered with each other, and select a component in Object Inspector, which is often selected from the form, or from the list of Object Inspector. Finding is convenient and fast.
3. Other relationships between the components can also be displayed in Object TreeView. For example, as follows:
(1) Use the Menu Designer Design menu, all menu items are displayed under the MainMenu node by its hierarchy in the menu;
(2) For data set components, such as TTABLE, Object TreeView also display some objects that will be generated at runtime, such as session, alias, etc., but because they are generated, they cannot edit their properties, These objects in Object TreeView will be represented in an unnamed node and a special icon, and when selecting these nodes, there is no attribute in the Object Inspector to edit.
(3) For ListView, Object TreeView also lists its columns, and click the right click on the columns to edit the columns directly. This is easier to select Columns Editor than selecting ListView from Form Designer. Some other components have similar situations, such as HEADERCONTROL SECTIONS, Coolbar's Bands, Statusbar's PANELS, can be edited directly from the shortcut menu. (ToolBar is default, although butttons are not listed, Button and Separetor can still be created in the shortcut menu from the Object TreeView.) 4. To accurately set the Contains relationship between the components, Object TreeView is also a useful tool. You can verify it by the following test:
(1) Place a PANEL on the form;
(2) Select the Button component from the component panel;
(3) Position the mouse over the Object TreeView (but do not press). You will notice that when the mouse pointing as a member of the Container, such as Form and Panel, the cursor shape will become an arrow with a paper shape, which means that the component can be placed on the container. Conversely, if the mouse stays on the component such as ListBox, Label, the cursor will become a NO DROP shape indicating that they cannot be used as Container.
(4) Position the cursor on the panel and press the left button. Button will automatically become a child node of Panel, and Panel and Button have also established a Contains relationship.
You can easily change the Contains relationship between the components. For example, in Object TreeView, drag the Button to the Form, now there is no longer panel, but the form itself. In the past, this operation was done by CUT & PASTE, but Cut & Paste also had a disadvantage, that is, after the component is cut, it is lost between it and other components. Use Object TreeView without this shortcoming.
There are a lot of components on the form, and when it is covered with each other, it is quite troublesome to find and operate a component in Form Designer. At this time, Object TreeView can display its role.
Object TreeView and Diagram view in Code Editor can also play a more powerful role. However, these contents are quite, need to be used in one topic.
Object TreeView is useful, but the price is to account for a point of screen space. Since Delphi IDE supports Docking of each tool, you can combine Object TreeView and Object Inpector, becoming a window, which can save a little bit of screen space. Object TreeView and Object Inspector can be arranged in left and right, or can be arranged up and down, and there are advantages and disadvantages in both ways. You can choose the way you like, then use the Save Desktop button on the Desktop toolbar to save your desktop settings for the next time.