当前位置:网站首页>[1. Delphi foundation] 1 Introduction to Delphi Programming

[1. Delphi foundation] 1 Introduction to Delphi Programming

2022-07-06 07:34:00 Janeb1018

1.DelphiXE Introduction to programming

1.1Delphi brief introduction

Delphi, yes Windows Platform under the famous rapid application development tool (Rapid Application Development, abbreviation RAD). Its predecessor , That is DOS For a time “Borland Turbo Pascal”, The earliest version was made in the United States Borland( Bao LAN ) The company 1995 Annual development . The main creator is Anders Hejlsberg. After years of development , This product is also transferred to Embarcadero It's part of the company .

Delphi It's an integrated development environment (IDE), The core of use is traditional Pascal Language develops from Object Pascal, Take the graphical user interface as the development environment , through IDE、VCL Tools and compilers , With the function of linking database , Constitute an application development tool centered on object-oriented programming .

from Borland company-launched Delphi Is a new visual programming environment , It provides us with a kind of convenience 、 shortcut Windows Application development tools . It has been used. MicrosoftWindows Many advanced features and design ideas of graphical user interface , It adopts a flexible and reusable complete object-oriented programming language (Object-Oriented Language)、 The fastest compiler in the world today 、 The most advanced database technology . For the vast number of program developers , Use Delphi Develop application software , Undoubtedly, it will greatly improve the programming efficiency , And with the deepening of application , You will find that programming is no longer a boring job ——Delphi Every design detail of , Will bring you a joy .

1.2DelphiXE Software features

  • Develop highly connected Apps

Various modern devices ( equipment ) Every day is increasing at an alarming rate . Current mobile 、 The tablet 、 Wearable devices and the fast-growing internet of things .RAD Studio Provided in a single RAD Studio The development environment is a solution that allows developers to keep up with trends .

  • Develop high-performance native applications

It can quickly develop efficient and linked enterprise databases 、 Cloud services 、 Native applications for sensing devices and various devices .

  • all-new FireUI Multi device designer (Multi-Device Designer)

Let your team develop with a single code in a very short time PCs、 The tablet 、 Smart phones and even wearable devices such as Google Glass Native application of . With a common main form and what the device needs views, It can develop multiple platforms and devices at the same time apps, Give Way APP And can be listed quickly . Just maintain a common code without sacrificing the Nativity of the platform .

  • New powerful parallel execution Library ( Parallel Programming Library)

Give developers incredible code parallel execution ability , Significantly improve performance .

  • new Bluetooth App Tethering

XE Support Bluetooth and low power consumption Bluetooth (BLE), Give Way App Tethering Can support at the same time WIFI And blue buds . Let you have Windows Applications can be extended more widely .

  • new Enterprise Mobility Services (EMS)

Powerful EMS Intermediary technology ,EMS Allows developers to easily develop REST / JSON Enterprise class mobile multi tier application architecture based on . Quickly deploy new EMS To publish and manage APIs、 Enterprise information .

  • Use... With ease REST and BaaS Suppliers connect to popular cloud services

such as , Push notification 、 verification 、 Storage and other services

  • Make it easy and fast Web application development

uniGUI Web The application framework will Web The application development experience extends to a new level .uniGUI send Delphi Developers can use a unique set of visual components in IDE Created in , Design and commissioning Web Applications . Each component is designed to provide a connection with Delphi VCL The same functions as the corresponding visual components in . This provides a very comfortable development environment , Very close to the original VCL Application development , Have a simple learning curve . uniGUI Web An application can use one of the available deployment options ( Such as Windows service , Stand alone server or ISAPI modular ) Deploy to server .

1.3DelphiXE Introduction to programming

Use Delphi General steps for writing applications :

  1. New application

  2. Set form properties

  3. Add interface components

  4. Set component properties

  5. Add component events

  6. Write event response code

  7. Compile and run the application

Introductory example : Place three buttons on the form , Namely “ Zoom in ”、“ narrow ”、“ close ”, Enlarge the form respectively 、 Zoom out and close the functions of the application .

1. New application

start-up DelphiXE, choice “File”->"New"->"VCL Forms Application".

2. Set form properties

Put the form's Caption Property is set to “ first Delphi forms ”.

3. Add interface components

take TButton Component added form , find TButton Double click or drag the component onto the form .

4. Set component properties

Will all TButton The properties of components are set according to the following table :

object attribute Property value explain
Button1caption Zoom in The title of the button
Button2caption narrow The title of the button
Button3caption close The title of the button

5. Add component events

Select the component Button1, Select... In the object viewer Events tab , stay OnClick To the right of Button1Click Back carriage return , The same way to set Button2、Button3 Events .

If you use the default event handler name , It can also be in OnClick Double click on the right side of .

6. Write component event response code

The code is as follows :

procedure TForm1.Button1Click(Sender: TObject);
begin
  Form1.Height := Form1.Height + 10;
  Form1.Width := Form1.Width + 10;
end;
​
procedure TForm1.Button2Click(Sender: TObject);
begin
  Form1.Height := Form1.Height - 10;
  Form1.Width := Form1.Width - 10;
end;
​
procedure TForm1.Button3Click(Sender: TObject);
begin
  close;
end;

7. Compile and run the application

Click... Above the toolbar “Run” button . The operation effect is as follows :

原网站

版权声明
本文为[Janeb1018]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202131916479157.html