"Delphi-The 0th chapter" preparation

Source: Internet
Author: User

0.0, know the Delphi toolbar.

If you have not changed the layout after you install Delphi, you should be able to find the toolbar above the interface. Right-click the toolbar to see some of the buttons that you can choose to display.

Psycho Tick is their own commonly used, because do not carry out web related items, so there is no check the relevance of HTML. This is checked according to your needs. Here's a general introduction to some of the keys that are often used.

0.0.0, view keys

From left to right, you view the cells in the project, view the windows in the project, convert the units to display, hide the invisible controls.

The function that the conversion unit displays is: if the currently active cell contains a window, then the conversion view (when the view is a window, converted to a cell, when the view is a unit of time converted to a window).

0.0.1, Standard keys

From left to right: new, open, save, Save all, open a project, add a unit to the project, remove a unit from the project.

The last two keys will be used when your project needs to add an external unit or replace a unit.

0.0.2, Debug keys

These are the most commonly used keys, not one of them. Of course, you can use shortcut keys instead (and usually do).

The left-most non-debug run, where you cannot debug breakpoints while running. The second is the debug run, you can debug the breakpoint. After the pause button is generally not much, because it is not easy to control the location of the stop. The stop key can be used to interrupt a debug run program for any situation, such as stopping the operation. The last three is a single-step debugging button, called stepping, step, step, respectively.

The function of stepping into the key is to execute the function in the function, and the step is to complete the execution of the function directly. If you finish using steps, the execution of the current function is completed.

Only these are commonly used temporarily, and some of the rest is related to the layout of the interface, but not the table.

0.1. Object Viewer

The object Viewer is an essential window for editing the GUI interface, which is the default in the lower left corner of the interface, such as some of the properties of ELT107 's main windows.

Notice that there is a property and events two tabs that contain the properties of this selection control (attributes noted as published in the class, which are not table-related), and the Events tab contains the event involved in the control, such as:

If you need to add an event, double-click on the right side of the event and the system will automatically write the pre-code, just add the relevant content later. These follow-up will be introduced.

0.2. Project Control window

In the middle right side of the window, displays information related to the project, such as engineering information for ELT106.

Here you can set up the way the program is built (publish or debug, if you choose to publish it will not be able to debug), the program build platform (such as Win32, Android, etc.). Of course, you can also do some related operations, such as open the project in the unit file (double-click).

0.4 tool Panel

In the lower right corner of the window, when the GUI is edited, it can be used to display the add-on control, and when the project file is not opened, the project can be created.

If you know the name for a control but don't know the category, you can use the Find feature.

0.5. Code editing window

The following is the display window for the core code of ELT107:

On the leftmost side, there is a column of empty columns, where the breakpoint debug identifier is displayed, such as:

On the right side of the breakpoint debug identity, is the row count ruler. A line number is displayed for each of the 10 rows, and a dash is displayed for each five lines, and the general line displays the points. The row number of the selected row is also displayed.

Then is the Code Editor, the system by default for some words or formats have a specific display format, such as comments using green italic, reserved words using blue bold and so on.

Unlike the general text editor, the Delphi-provided text editor has spaces in each location by default, that is, if you want to have a space, you only need to click the appropriate location, then the default fill space. Also, this is not wrapped by default, and the property appears to be immutable.

At the far right of the code page, a thin line of light gray is provided as follows:

The thin line here is a length identifier, which can be modified in the settings for the length of the unit in characters.

In addition to displaying the current row and column, there are two tabs,

One is the code page, which is the code for the current file, and the other is history, where you can find historical files to restore your work in all sorts of unusual situations. The history files are stored in a hidden folder in the root directory.

0.6. Simple setup of Code editing window

If we are not satisfied with the system default code format settings, you can right-click Gouges, select Properties, as follows: (Psycho is hereby emphasized with a black rectangle)

After opening, you can modify the default color under the Color tab, which is generally not recommended.

In the Display tab, you can select the default size and the number of line limit characters for the font.

The rest of the adjustment is not recommended.

0.7, the first knowledge of Delphi GUI

On the development efficiency of GUI, Delphi is undoubtedly the dominate, and compared with Vcl,firemonkey, it has more excellent GUI effect and cross-platform feature. If you want to make a simple animation, using Firemonkey is undoubtedly very convenient. This section psycho will use a simple example to let you feel the Firemonkey animation function.

First, run Delphi and select menu items: File–new–multi-device application–delphi, such as:

Then select Blank Application.

Once created, we can see a blank window, leave it alone, and enter "Trectangle" (that is, the rectangle) in the Find box in the lower right corner. Such as:

After we click the rectangle control and drag the mouse at the window, you can create a rectangle.

Then we find the Fill property in the bottom left Object Viewer, click the plus sign on the left to find the Color property,

We notice that there is a film shape in front of the value area of the Color property, which we will use later, for the time being. We then double-click its value to pop up the palette:

Choose one of your favorite colors, or enter a favorite color. Like White. We can also modify its value directly in the value area, the format of the color is eight hexadecimal, according to two digits, followed by the brightness, red component, green component, blue component, in accordance with the tri-color composition.

We then found the sides property, for example, there are four check boxes.

You can check the box directly by clicking on the front side, which measures whether the border is displayed. For Boolean variables, they are given in such a way.

Then, find the height, Width property, adjust its size, the same way. We can also adjust the coordinates of x, y under the Position property (click the Plus view sub-property). (in the case of VCL, the coordinates are left and top, and the variable types of coordinates and dimensions in VCL are integers, and firemonkey are single-precision real numbers).

Then we animate the rectangle, and we can try to add the following animations:

1, left and right translation

2. Pan up and down

3. Rotation

4. Change the color

First, for left and right panning, find the X under position and pay attention to the rightmost drop-down triangle logo. Click to select Create New tfloatanimation.

Tick Autoreserve, set duration to 1, tick enable,loop, set Startvalue to 100,stopvalue to 300. (You can choose the value you like)

The next step is to pan up and down and follow the same steps. Where Autoreserve is auto-back, duration for duration, enable for active, loop for loop, and last two for start and end values. It is recommended to set different cycles, such as 1.5 seconds duration.

For rotation, find RotationAngle and make similar settings.

Colors find the color under Fill, where the type of animation is somewhat different, choose Create New tcoloranimation.

After that, a similar setting is made.

For the Firemonkey animation architecture, one thing has to be mentioned. Some people say that the animation effect of Firemonkey is rubbish, only can make the animation of linear change how much useful. Please note that there is also a film designation before the value area of the Startvalue and Stopvalue. In other words, this is an animation engine that can make a very complex effect, and if timed modifications are made with a timer, you can have a richer gameplay.

Exercise: Follow a similar scenario to explore animating effects within an animation effect. (no reference answer available)

"Delphi-The 0th chapter" preparation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.