"Mastering Delphi 6 Study Notes"

zhaozj2021-02-11  196

"Mastering Delphi 6 Study Notes"

This article is some of my experience in reading "Mastering Delphi 6", on the one hand, because the original book is English, so I think some important part of the more important part of the part, remember to make a memo; on the other hand I also hope to share "Master Delphi 6" this good book and Delphi 6 excellent tools with everyone. The first part "Object TreeView brief description" has been posted, and the order number is started from this part. Because it is recorded, it is difficult to discover and unstoppore, you are welcome to criticize advice.

This article does not explain the concept and steps, so it is not suitable for Delphi beginners. I hope that there must be experienced friends from Delphi from this article.

Diagram view on Code Editor

1. Similar to Object TreeView, the Diagram view in Code Editor is also developed from similar concepts in Data Module, and now it is also separated from Data Module, which can be applied to all forms.

2. The Diagram view does not automatically display any components. To display certain components, drag from the Object TreeView you need to the white area in the Diagram view (you can drag multiple components once in Object TreeView). The Diagram view will automatically display the relationship between the components. For example, dragging Form and its components thereon into a Diagram view, the arrows pointing to FORM appears on all components in the view, indicating that all components are owned by Form.

3. You can use the Property Connector in the Diagram view to the association between the components. For example, add a TEDIT and a TLABEL, and add an arrow from TLABEL to TEDIT with the Diagram view, you will find the focuscontrol word on the arrow, while in Object Inspector, Label FocusControl is automatically set to Edit1. All of this can be automatically completed because the only one in the TLabel all attributes is the FocusControl property that can point to TEDIT objects. This way, you can design the association between objects. Converse, you can't point the Property Connector from Edit to Label, because there is no corresponding attribute to complete this association; if you try to do this, you will get an error prompt, ask your intentions whether you want a reverse direction Relationship.

For data set components, you can also set the Master / Detail relationship between them and the Lookup relationship, which is very similar to the above steps.

You can also insert an comment block and make your intentions more clearly.

4. The Diagram view can be modified, thereby more beautiful and clear. For each component or association in the view, you can set their color and z-Order order by shortcut menu; for associated arrows, you can also modify its shape and point to, increase the inflection point.

5. Multiple DiaGram can be used for the same unit. Just enter its name in the Name text box and add an optional description information. By the combination box on the toolbar in the Diagram view, you can switch between each DIAGRAM. You can establish DiaGram for the relationship between the Contains relationship between the components, respectively, this will be clearer.

6. After establishing a satisfactory Diagram, you can print. Just keep the focus in the Diagram view, then select File | Print. 7. In Delphi 5, Diagram information is reported in a separate .dti (Design-Time Information), the format of the file and the format of the .ini file are similar, and you can edit with a text editor. In Delphi 6, Diagram information is saved in the .ddp (Delphi Diagram Portfolio) file. This file format is similar to the .dfm binary format, and cannot be edited directly. However, Delphi 6 is still able to read the .dti file.

About VCL and CLX

Delphi 6 currently includes two basic libraries, where VCL is used from Delphi birth, while CLX (Component Library for Cross-Platform) is a new component library that supports cross-platform features. You can select the item type used from File | New, you can be Normal Application or Clx Application. You will find that the same application is written in VCL and CLX, which will have a little difference in executable file size.

When you choose a VCL Application or Clx Application, the component panel also changes, only displaying the type of components supported by the currently used library. This change is not big, you have to be careful to find it. In Clx Application, the Win32 page in the component panel disappears, and the Common Controls are replaced, including new components that are not available in several Win32. At the same time, there are some small changes in other pages. For users, they rarely pay attention to these details, but this is a great challenge for the Delphi development group, as many places in the system need to be refactored to accommodate new libraries. It should be said that at this point, the Delphi development group is quite excellent, Delphi can use Delphi 6 without difficulty from the previous version. However, you should know that under similar interfaces, the change in the bottom is quite huge - this is a must have to understand for a specific programmer, such as writing ToolsAPI programmers and others. .

Some changes in other changes

Delphi IDE adds a Window menu now, which is convenient to switch between Form Designer, Code Editor, and Object TreeView / Object Inspector. This is a small but very considerate user's improvement, because in the development environment, there is often a thing that is covered by other windows.

("Mastering Delphi 6" mentioned that the display or hide of the menu can be set by the Software / Borland / Delphi / 6.0 / Main window entry in the registry, where -1 represents true, and 0 represents false. But I didn't find this setting in my registry, I don't know how to add it. If you find it, welcome you to tell me.)

A submenu is now added in the shortcut menu of the component panel, which contains all panel names. You can use it to quickly switch to a panel. If you often have to scroll back and forth in the panel to find a page, you will definitely enjoy this new feature.

(By default, this shortcut menu is arranged in alphabetical order. You may want it to be arranged in the same order in the component panel. "Mastering Delphi6", you can set the corresponding registry The project is called. Because this paragraph is not very clear, because I have not tried it due to time relationship, I will put the original text here. If you are interested, you can try it .The Order of the Entries in the Tabs submenu of the Component Palette local menu can be set in the same order as the palette itself, and not sorted alphabetically. This is accomplished by setting to "0" (false) the value of the Sort Palette Tabs Menu key of the Main window registry section of delphi (under / soft / borland / delphi /6.0 for the current user).

)

Others have some small changes:

1. Add an option Auto Drag Docking in the Preference page in the Environment Options dialog, allowing you to prohibit the berth characteristics of each tool. If you don't like Docking, you can set this option. (To be honest, I don't know why "mastering delphi6" is particularly emphasized; I really like Docking, I always combine the Object Inspector and Object TreeView, and enter the Watch window Dock into the code Editor. This is really a lot. However, since the author said, it is necessary to have his reason, so I still respect the author's opinion and list this as headline.)

2. Add an Environment Variables page in the Environment Options dialog, allowing you to set the system environment variable. This is much better than hard coding, especially programmers who write server applications may need it.

3. The new Internet page can set which suffixed files as Internet files, and allow debugging Scripts, etc.

About TO-DO LIST:

In addition to visualizing editing in View | to-do list, you can also edit in the source file:

Procedure TFORM1.FormCreate (Sender: TOBJECT);

Begin

// Todo -omarco: Add Creeion Code

END;

This will add a project called Add Creation Code, whose Owner is MacRo. If you are familiar with this approach, editing will be faster than use with to-do list Editor (of course, managing to-do list still uses editor). -o Specifies Owner, -c Specifies Category, specifies Priority in a separate number. E.g:

// Todo 2 -omacro: Mouse Pressed

If a to-do list has been completed, you can change TODO to Done to indicate this. Or select the DONE check box in TO-DO LIST EDITOR. The item specified as DONE will be displayed in the form of a deletion line in the TO-DO LIST.

You can use the to-do list to copy to-do list into plain text or HTML format in TO-Do List Editor, and even specify the output format of HTML (but a bit strange is that Delphi only provides the way of Copy to Clipboard, but No EXPORT TO File function.) The code editor is multi-page interface, but in Delphi 6, these pages can also be changed to alter the order in the code editor by mouse drag. You can also switch between each page via Ctrl Tab or SHIFT CTRL TAB. All of the pages of the editing are listed in the page shortcut menu. When editing is quite average, you can quickly switch to a specific file (a small and convenient function, and the component panel) It is very useful as the Pages menu in the menu.)

Autosave in the Environment Options dialog is a very useful option that allows you to save your files, project files, or desktop settings before you run programs or debug programs, avoiding unexpected crash during debugging results in data loss. (I strongly recommend at least Auto Save Editor Files; I am very strange why this is not a default setting.)

转载请注明原文地址:https://www.9cbs.com/read-3867.html

New Post(0)