Presentation on the topic of language programming of Delphi. Presentation on the topic "Fundamentals of Delphi robotics". Internal program organization at Delphi


The code editor window (Unit1.pas) creates the output text of the program module that is being split. The file that is being edited is located on the other page, which can be accessed by clicking on its label. The form designer window (Form1) allows you to design the form. Why are necessary elements placed on the form in the component panel? The Object Inspector window displays the authorities and object categories for the flow form Form1. It can be displayed using the View/Object Inspector command or by pressing the key. The Object Inspector window has 2 tabs: Properties and Events. Form designer window Code editor window Object inspector window


Dpr Main project file!!.Dfm Form file!!.Pas Pascal module file!!.Res Resource files!(created the first time saved).Opt Project parameters file.~* Backup files.Dcr Delphi Component Resource !.Dcu Compilations module file.Dsm Intermediate code.Dll Dynamic library files.Dsk Workspace configuration.Exe Concatenated files File extensions Language files for work programs


Application of a simple program The creation of new programs begins with the fact that Delphi automatically populates an empty window - the form Form1. The program interface contains components that can be selected from the Component Palette, placed on a form, and their power changed. The selection of a component on the panel is indicated by clicking the mouse on the required component, for example, a Button, and then clicking on the form. The selection of components will appear on it. After placing a form component, Delphi automatically makes changes to the module file, then. The row is added: The external appearance of the component is determined by its power, available in the Object Inspector window, if the component is visible on the form.


The Object Inspector window displays the names of all authorities and their significance. Powers are attributes that indicate the way components are displayed and function during the execution of programs. You can change the values ​​of authorities directly in the Inspector, in which case the main component is changed. We give our button a different title: write in the row Caption - About Form Actions of power Button: Cursor: TCursor - image of the mouse when hovering over the button (for example: crHandPoint) Default: Boolean - pressing the button is followed by the Enter key, meaning Default=True Fo nt: TFont - font Height:Integer - height of the button in pixels Width:Integer - width of the button in pixels Left:Integer - horizontal coordinate of the top left corner. Top:Integer – vertical coordinate of the left top corner.


In order for the button to respond to any prompt, it is necessary to specify a prompt processing procedure that will respond when the prompt is invalid. For which you need to double-click in the OnClick area (or double-click on the About Form button), as a result, Delphi automatically creates a sample procedure in the form module. var About: Tabout; begin About:=TAbout.Create(self); About.Show; end; Now, when you click on the About Form button, another form will appear named About, as we describe in the Unit2 module. Let's write the procedure


Let's describe the form to a friend in Unit2.pas. From the main menu, select the item File/New/Form Define this form Caption and Name - About Place a Button on the form with the title Close and the Label component, which is simple text, which cannot be edited when the program is installed. Text for the Caption field. Actions of power Label AutoSize:Boolean - automatic correction of the size of the Label, according to the text written Aligment:TAligment - method of aligning the text in the middle of the component, you can take the following values: - taLeftJustify - alignment to the left - taC enter - center text - taRightJustify - edge WordWrap: Boolean - automatic transfer of left rows to another row Transparent: Boolean - insightful writing or filling. The color of the filling is set using the Color brush. Label


When you click on the Close button, the About form will close. procedure TAbout.Button1Click(Sender: TObject); begin Close; end; Our Unit2 module appears When you press the About Form button on the first form, another form is displayed on the screen, which is previously invisible. Because Since the Unit1 module contains an operation with a different form, then the uses code of Unit2 can be placed in the implementation section of the Unit1 module. Or File/Use Unit…


To save the project, select File / Save Project As in the main menu. This is useful for checking the appearance and correct functioning of other form components, as well as for checking the generated code. After compiling the project, a program file is created under the name of the project file. Compilation


Launching a project You can launch a project in Windows from Delphi and Windows. With Delphi you can use the Run/Run command or by pressing the key. Note You cannot run another copy of the program if the program is already running. The development of the project can only continue after the completion of the work program. When a program is stuck in a loop, it is necessary to terminate the robot using the Delphi command using the Run/Program Reset command or by pressing the keys +



Lecture 1. Getting to know each other

Slide 2: History of Delphi

The history of Delphi begins in the 60s, when Professor N. Virt developed the language of the high level Pascal. This is the best language for learning programming, as well as for creating programs for the MS-DOS operating system. Then, in 1983, A. Heilsberg, together with other programs, also organized the Borland company, developing the Turbo Pascal compiler, which became the next step in the Delphi evolution. Then Object Pascal appeared, which is a substitute for the object-oriented approach to programming. When the first version of Windows appeared - Windows 3.10, Borland programs created Delphi 1. This was also an object-oriented middleware for visual development of programs, which was based on the Object Pascal language. With the advent of Windows 95, Delphi 2 appeared, then Delphi 3, 4, 5. The language of Object Pascal, which was the origin of Delphi, saw such significant changes that with the advent of Delphi 6, the Borland company, which has already turned into a corporation, voiced about Renaming Object Pascal from Delphi. That's why you think that Delphi is the visual middle ground of software development. There are also those who confirm that Delphi is one of the most advanced programming systems.

Slide 3: Delphi 7

We are running Delphi 7, the most stable version of Windows software for Win32 – like 32-bit versions of Windows. New versions of Delphi have appeared, but they are oriented towards .NET technology, which is something that novice programmers are getting ready for. Moreover, this technology has not yet been widely adopted, and the market for software created using Delphi still includes software products written in Delphi 7, and based on earlier versions. The basis of Delphi is not only the language itself, but also RAD (Rapid Application Development) - the middle of Swedish software development. Committed to visual programming, as well as a large library of visual components, Delphi allows you to create programs as quickly and efficiently as possible, taking over the main work and depriving the programmer of the creative process. It is clear that the ability of many professional programs for Windows to work with Delphi - programs required by all types of human activity.

Slide 4: Roboti cob

Delphi is launched in the most basic way, by selecting the Borland Delphi 7 menu and the Delphi command. Launching Delphi

Slide 5: Workable middleware of Delphi 7

Robotic center of Delphi 7

Slide 6: Workable middleware of Delphi 7

The working core of Delphi 7 contains a lot of windows, panels, and components. We will get to know most of them in an hour, but in the meantime we need to increase our respect for 5 windows: Head of Delphi. Here you will find the main menu, various toolbars and the component panel, which consists of no tabs. Form designer. Here we are visually important, as is the visible form of the program, here we are creating an interface, transferring various components to the form, and arranging them in such a way that the interface looks more attractive. We often have to switch between the form designer and the code editor, using the F12 key. Code editor. Here is the output code of the program, created by Delphi itself. Here we will enter our official code. Object inspector. The range of applications for managing objects in a project consists of two tabs – Properties and Events. Tree of objects. Here, bachimo, let’s be more precise about the very object of Nina. It will always be especially brown if there are no components on the form.

Slide 7: Component Palette

The component palette consists of several tabs: 1. Standard. All these components are analogues of Windows components. 2. Additional – additional components. 3. Win32 – components that are unique to the Win32 family of operating systems. This family includes Windows 9x, Windows ME, Windows 2000, Windows NT, Windows XP. 4. System - system components, which make access to the system easier. 5. Database Access – components for accessing databases. 6. Data Controls – components for working with databases. 7. dbExpress – more components for accessing databases that replaced the BDE. 8. BDE – old components for database access. 9. ADO – this is also a component for accessing databases, even using Active Data Object (ADO) technology. 10. InterBase – components for access to the InterBase database. 11. WebServices – components for Internet access. 12. InternetExpress – components for access to the Internet network. 13. FastNet – Merezhevy components. 14. QReport – components of creation of information. 15. Dialogs – components that allow easier access to standard dialogs. 16.Win3. 11 – components and access to Win 3.1 components. 17. Samples - different butts. All of these components are available in the output codes and are shipped directly from Delphi.

Slide 8: Form designer

Work on the program begins with the creation of the start form. The window of the starting form (Forml) contains the preparation of the main window of the program that is being expanded. In Delphi, an add-on that is broken down is called a project. The starting form is created by changing the value of the form controls Form1 and adding to the form the necessary visual and non-visual components in whatever order they appear (fields for entering and displaying text, command buttons, etc.). The power of the form is determined by its appearance: size, position on the screen, title text, frame type.

Slide 9: Object inspector window

It always plays a key role in visual programming and is used to change the power of visual components and the role of components that can be processed by a program. There are two tabs currently open – Properties and Events. To select the power of a required component, you need to see that component on the form. You can see a component in two ways: by clicking on the component or by selecting from the list. The Properties tab displays the powers and values ​​of the visible component. To activate the active power requirement of the visible component, you need to click on it with the mouse. You can change the brightness values ​​using different methods, depending on the type of characteristic.

10

Slide 10: Set of component powers

The visual component of the skin is a set of authorities. Let's look at the main power of the form. Most of them are present in various components. ActiveControl – indicates a component that is active during the process. Align – component alignment. Any component can be verified on one side of the father's component. This power can be given the following meanings: alNone – there is no verification. alBottom – alignment of the bottom edge. alLeft – topping with the left edge. AlRight – alignment from the right edge. AlTop – finishing of the top edge. The components are aligned to the form, and the form is aligned to the window. AutoScroll – logical type of space. This means whether the form automatically scrolls or scrolls. AutoSize – logical size type. This means that the components on the form automatically adjust their sizes. BorderIcons – power, which means what buttons are responsible for the window. This is the power that is revealed. If you click on the left-hand square under the name of the authority, a list of four authorities will open: biSystemMenu – show the menu (the left-hand icon in the window title row) and others; biMinimize – window minimization button; biMaximize – button to maximize the window; biHelp – help button.

11

Slide 11: Set of component powers

BorderStyle – the power of the window is determined by the frill look. This power can take the following meanings: bsSizeable – for the purpose. Standard window with normal frill, so you can change your dimensions; bsDialog – looks like a dialog window; bsNone – always worn without frill. bsSingle – the size is fixed and cannot be changed with the mouse; bsSizeToolWin – window with a thin frill. Particularly noteworthy is the title of the window. bsToolWindow – as before, but you cannot change the size of the window. BorderWidth – width of the window frill. Caption – title of the window. ClientHeight – the height of the client area of ​​the window. ClientWidth – width of the client area of ​​the window. Color – color of the client area of ​​the window. Constraints – this power has the power to set the maximum values ​​for the size of the window: MaxHeight – the maximum height of the window; MaxWidth – maximum window width; MinHeight – minimum window height; MinWidth – minimum window width. Once you set the values, you cannot stretch more than the maximum size or change less than the minimum.

12

Slide 12: Set of component powers

Cursor – this power represents the cursor that appears when the mouse is hovered over the form/component. DockSite – indicates that you can drop other components onto the form or component using Drag&Drop. DragKind – type of drag on an object during Drag&Drop. There are two options available here: dkDrag – standard Drag&Drop, in which the object is lost in place; dkDock – drag an object. Select this option if necessary so that the component can be attached to other components or forms. DragMode – Drag&Drop mode. There are two options available here: dmManual – manual mode. In this mode, the programmer is responsible for starting the dragging of the object; dmAutomatic – the Draq&Drop mode will turn on automatically as soon as the user begins to pull the component with the bear. In this case, there is no need to write additional code as in manual mode. Enabled—component availability. Since this power is still true, the buyer can work with this component. Otherwise the component is not available and is prepared in gray color. Font – the font that is selected when the text is displayed on the form.

13

Slide 13: Set of component powers

FormStyle – form style. The following options are available for selection: fsNormal – normal window; fsMDIForm – window for MDI windows; fsMDIChild – window in a child MDI window. The power fsMDIForm creates a head window, and fsMDIChild creates a child window that will be in the middle of the head window. Height – the height of the window. Hint – hint text that will appear in the row when the mouse is hovered over a form or component. HorzScrollBar – parameters for horizontal scrolling. Icon – the icon that appears at the window title. Left – left position of the window. Menu – the menu that appears in the main window. Name – name of the form or component.

14

Slide 14: Set of component powers

Position – position of the window at the hour at which the program starts. The following options are available here: poDefault – Windows itself will be displayed, so you can choose the windows that will be of your size; poDefaultPosOnly – Windows itself will not be able to de-rotate the window, and its dimensions will be the same as those installed in the authorities; poDefaultSizeOnly – Windows depends on what the size of the window will be, and the position will be what you ordered from the authorities; poDesigned – both the size and the position will be such as they were installed in the authorities; poDesktopCenter – the window will be displayed in the center of the desktop; poMainFormCenter – the window will be displayed in the center of the main form; poOwnerFormCenter – the window will be displayed in the center of the ruler’s window, so that the window that this is called; poScreenCenter – the window will be displayed in the center of the screen. ShowHint – means whether you need to show hints. Tag – this power can be abused for your own purposes. Top – top position of the window. VertScrollBar – vertical scrollbar. Visible – if the power of one thing is true, then the form and components are visible. Otherwise, the form of chi is an invisible component. Width – window width. WindowState – state of the window after launch. The following parameters are available: wsNormal – always displayed in normal mode; wsMaximized – always appears to be maximized; wsMinimized – the window is always displayed minimized.

15

Slide 15: Podii

In Delphi, all components are processed through subdivisions. During the programming process, it is necessary to create samples for different situations. For example, you can create a sampler for pressing keys on the keyboard and performing certain actions. The Pod Caller is a simple procedure or function that calls for a particular Pod. Let's take a look at the main steps where the main form of the program can respond. These can be found in the Events Object Inspector tab. OnActivate – signals when the program has become active. OnCanResize – this prompt is generated before you change the size of the window. OnClick – generated when the user clicks the form. OnClose – generated when the window is closed. OnCloseQuery – generated before the window is closed. OnCreate – generated when it is created. OnDblClick – generated when two people click on the window. OnDeactivate – generated when it is deactivated. OnDestroy – generated when available. OnHide – generated when the window is out of sight. OnKeyDown – generated when a key is pressed on the keyboard. OnKeyPress – generated when a key is pressed or released on the keyboard. OnKeyUp – generated when a key on the keyboard is released.

16

Slide 16: Podii

OnMouseDown – generated when the mouse button is pressed. OnMouseMove – generated when the bear collapses. OnMouseUp – generated when the mouse button is released. OnMouseWheel – generated by the mouse wheel. OnMouseWheelDown – generated when the mouse wheel is scrolled down. OnMouseWheelUp – generated when the mouse wheel is scrolled up. OnPaint – generated when you need to repaint the window. OnResize – generated when it is necessary to change the size of the window. OnShortCut – generated when the hot button is pressed. OnShow – generated when the window is shown, before the actual painting. This moment has already been created and is ready to be displayed, but has not yet been painted on the screen.

17

Slide 17: Code editor

In the code editor window, you can access it by dropping the form into the window and then typing the text in the program. To start working on a new project, use the code editor to create a Delphi program template.

18

Slide 18: Module

unit Unit 1; //The name of the module interface uses //After this word, we go to re-arrange the connected modules. Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs; Type //Following this description of types TForm1 = class (TForm) //The beginning of a description of the new object TForm1 //Components and concepts private //This last word can describe private declarations of an object (Private declarations) //Hint , how to generate Delphi (Here you can describe the different methods available only for the TForm1 object) public // This word can describe the open data of the object ( Public declarations ) // Hint, how to generate Delphi (Here you can describe the changes methods available from any other module) end ; var // Stunning global variables Form1: TForm1; //This describes the Form1 change to the object type TForm1 implementation ($ R *. dfm) // Connections. dfm file (file with data about visual objects) end. // end of the module

19

Slide 19: Module structure

The module begins with the word unit, followed by the name of the module Unit1. The module consists of the following sections: interface; implementation; Initialization. The interface section (beginning with the word interface) tells the compiler which part of the module is accessible to other program modules. This section has overhauled (after the word uses) library modules that are used by this module. There is also a Delphi description of the form that follows the word type. The implementation section is preceded by the word implementation and avoids local changes, procedures and functions that support the operation of the form. The implementation section begins with a directive ($R *.DFM) that tells the compiler to revise the form declaration during the generation process of the file being compiled. The description of the form is located in the file with the extended dfm, the name of which is associated with the name of the module. The form description file is generated by the Delphi engine based on the external appearance of the form. The directive ($R *.DFM) is followed by processing procedures for the shape of those components. The programmer can place other procedures and functions here. The initialization section allows the initialization of replaceable modules. Instructions for the initialization section are expanded after the implementation section (description of all procedures and functions) between begin and end. Since the initialization section is not in accordance with the instructions (as in the case of an application), the word begin is not indicated.

20

Slide 20: Project file structure

The main part of the program is a project file (. dpr), which contains the code of my Object Pascal, from which the program starts and ensures the initialization of other modules. In most cases, you can quit a Delphi program without looking at the entire file. They are created and modified by Delphi automatically during the program development process. The names that are given to the project file, for saving it, become the names of the compiled file. The code below is an example of what the project file looks like in the dropdown if the file names and forms have not been changed. program Project1 vikory Forms, Unit1 in "Unit1.pas" (Form 1); (SR *, RES) begin Application.CreateForm (T Form, Forml); Application.Run(Forml); end.

21

Slide 21: Project file structure

The head module begins with the word program, followed by the name of the program that goes with the name of the project. The project name is set at the time the project is saved, and it means the name of the program file that is created by the compiler. Next, the word uses is followed by the names of the modules that are being studied: the Forms library module and the unit l.pas form module. The line ($R *.RES), which is similar to a comment, is a compiler directive to include a resource file. Resource file Merge resources with programs: icons, cursors, bit images, etc. The star indicates that the name of the resource file is the same as that of the project file, except for the res extension. The resource file is not a text file, so you cannot view it with an additional text editor. To work with resource files, use special programs, for example, Resource Workshop. You can also install the Image Editor utility to enter the Delphi warehouse, access to which can be accessed by selecting the Image Editor command from the Tools menu. The configured part of the head module is located between the begin and end instructions. The program is installed and displayed on the start window screen.

22

Slide 22: Main files for the project

A Delphi project consists of forms, modules, project parameters, resources, etc. All this information is located in files. Many of these files are automatically created by Delphi when the program is created. Resources, such as bit matrices, icons, etc., are located in files that come from other devices or are created using additional numerical tools and resource editors, which are available in Delphi. In addition, the compiler creates files. Getting to know what these files do, knowing what files and information they contain will often help you in important situations. When designing a program, Delphi creates the following files:

23

Slide 23: Main files for the project

Project file (. dpr) This text file is compiled to save information about the forms and modules. This contains the initialization operators and launching programs on the computer. Module file (. pas) The skin form that is created, and starting with Delphi 5 - the skin frame, represents the text file of the module that is modified to save code. Sometimes you can create modules that are not connected to forms. A lot of Delphi functions and procedures are stored in modules. Form File (.dfm) This is a double or text file that Delphi creates to store information about your forms. Each form file is matched by a module file (.Pas). Project parameters file (.dfo) This file stores project parameter settings. Package Information File (.drf) This binary file is reviewed by Delphi when working with packages. Resource file (.res) This binary file contains the icon used by the project and other resources. File group file (. bpg) This is the file that is created when you work with a group of projects. Package file (. dpk) This file is a dpk package.

24

Slide 24: Main files for the project

Backup files (.- dp, ~df,. ~pa) These are definitely backup files for project files, module formats. If you are hopelessly stuck with your project, you can definitely change the extensions of these files and thus return to the previous unzipped option. Window configuration file (.dsk) The file saves the window configuration. Diagram files (. ddp) Diagram files that are created on the diagram page of the Code Editor window.

25

Slide 25: Main files for the project

Now a group of files is created by the compiler: file to be compiled (. exe) This is the file of your program to be compiled. It is a stand-alone compiled file, for which nothing else is needed, as long as you do not vikoryst the libraries that are located in DLLs, OCX, etc., and also because you do not vikorist the support of vikonnn packages Module object file (.dcu) This is a module file (. pas) that is compiled into a residual compilation file. Library that is dynamically attached (.dll) This file is created whenever you design a DLL. File instead of package (.dcp) This is a double file that contains the package header and the list of files that belong to it. dcu. Compiled package file (.bpl) This package is a DLL library file with Delphi specifications. Add-on files (hlp) These are standard Windows proof-files that can be accessed by your Delphi program. Image files or graphic files (.wmf, .bmp, .ico) These files can be used in Windows programs to create an attractive and user-friendly interface for the user.

26

Slide 26: Saving the project

To save the project, you need to delete the following actions: Select the menu command "File - Save All" (save everything), or press hot keys< Shift+Ctrl+S >, or click the button on the Delphi toolbar to immediately save the module (instead of the code editor window), and the Save Unitl As window will appear on the screen. In this window you need to select the folder assigned to the project files and enter the name of the module. After clicking the Save button, a window will appear where you need to enter a name for the project file. The file names of the module (pas-file) and the project (dpr-file) are different. The name of the file that is generated by the compiler matches the name of the project. This project file should be assigned the same name, because, in your opinion, the mother file of the program that is being compiled is responsible, and the module file should be assigned another name, for example, the way to add the serial number of the module to the project file name. Since the project is a collection of files, each project needs to create a folder.

27

Slide 27: Compilation

Compilation is the process of converting output programs into a package. The compilation process has two stages. The first stage involves checking the text of the program for the presence of amendments, and the second stage involves generating a finalized program (exe file). After entering the text processing functions and saving the project, you can select the Compile command from the Project menu and exit compilation. The process and result of compilation are displayed in the Compiling dialog box. This compiler is capable of outputting errors (Errors), warnings (warnings) and hints (Hints). Notifications about corrections, advance warnings and hints are displayed at the bottom of the code editor window.

28

Slide 28: Compilation window

Compiler notification about the detection of a compiler If the Compiling window is not visible on the screen at the time of compilation, you need to select the options Environment command from the Tools menu and on the Preferences tab set the switching station to Show compiler progr ess.

29

Slide 29: Amusements

The compiler generates a program that is compiled, especially since the output text does not contain syntactic changes. In most cases, the program has been dialed carefully. The programmer can remove them. To go to the fragment of code that will apply the correction, you need to place the cursor next to the notifications about the correction and select the Edit source command from the contextual one. The process of approving approvals is iterative in nature. First of all, the most obvious amends are made, for example, unvoiced changes are declared. After the final changes are made to the text, the program compiles again. Make sure that any compiler can always localize the error accurately. Therefore, when analyzing a fragment of a program that the compiler thinks is correct, you need to focus not only on the fragment of code on which the compiler has placed the cursor, but also on the one that is in the front row.

30

Slide 30: Amusements

If the compiler detects a lot of bugs, you need to look at all the messages, remove the most obvious bugs, and then recompile. It is quite certain that after this, the number of favors will significantly change. This is explained by the peculiarities of the syntax of the language, since one insignificant error can “pull” on itself many others. Since the program does not contain any syntactic changes, the compiler creates a program file that is compiled. The name of the file that is connected is the same as that of the project file, and the extension is exe. Delphi places the concatenation file in the directory where the project file is located. If inaccuracies, such as mistakes, are detected in the program, the compiler displays hints and warnings. For example, the most common clue is the information about the deafened, but not defamed, change: Variable... is declared but never used in... Is it possible to deafen the change and not discredited it?

31

Slide 31: Launching programs

A trial run of the program can be done directly from Delphi, without completing the work from the core of the development. To do this, select the Run command from the Run menu or click on the Debug toolbar button.

32

Remaining slide of the presentation: DELPHI Programming Middle: Pardons for the hour of conquest

Under the hour, robot programs may have errors, which are called run-time errors or exceptions. The most common cause of errors is incorrect output data. For example, if you select a dot to see the fractional part of a number from the whole part, then as a result of pressing the Calculate button, a window with notifications about the calculation will appear on the screen. The reason for the viniknennya pardon axis y choma. In the text of the program, the shot part of the whole is reinforced with a dot. When entering the output data in the editing field, you can (if you do not report the necessary additional data) add the fractional part of the number to the whole point or com. Which of these two characters is acceptable is subject to Windows setup. After pressing the OK button, the programmer can continue running the program (to do this, select the Step Over command from the Run menu) or interrupt the running of the program. You may need to select the Program Reset command from the Run menu. When developing programs, the programmer is responsible for trying to identify all possible options for incorrect actions of the user that could lead to termination, and provide ways to protect against them.

Block width px

Copy this code and paste it onto your website

Captions before slides:
  • A series of presentations “OOP in Delphi” dedicated to object-oriented programming using components of one of the most advanced software development systems – Delphi
  • With this beginner's course, you can independently learn the basics of object-oriented programming in Delphi. To expand your knowledge, a number of basic aids and guides from Delphi have been added to the course
  • Cycle of 13 presentations:
  • OOP in Delphi – 1: Familiarity with the Borland Delphi programming system. Objects (components) and their powers and methods
  • OOP in Delphi – 2: First program in Delphi, saving and compilation
  • OOP on Delphi – 3: Program for changing the authorities of objects
  • OOP in Delphi – 4: Learn Delphi. Creation of a simple test
  • OOP in Delphi – 5: Elements of entering and displaying information. Trial of blame
  • OOP in Delphi - 6: Screensaver program element timer
  • OOP in Delphi - 7: Programming your own game
  • OOP in Delphi - 8: Program menu, dialogs
  • OOP in Delphi - 9: Creating a text editor
  • OOP in Delphi - 10: Database in Delphi
  • OOP in Delphi - 11: Calculator in Delphi. Sample of blame situations
  • OOP on Delphi - 12: Creating a testing system
  • OOP in Delphi - 13: Graphics in Delphi
  • Delphi is a substitute for programming the Pascal object, so it’s better to learn the original Pascal from the beginning and work it out in Turbo Pascal, and then move on to Delphi – the transition will be even simpler, since the syntax of the language is no longer unchanged.
  • OOP training in Delphi should be carried out in senior classes - the number of years spent on computer science is sufficient to master the basics of OOP in Delphi
  • Object-oriented programming
  • DELPHI - 1
  • @ Krasnopolyansk school No. 1 Domnin Kostyantin Mikhailovich born in 2006
  • On this lesson:
  • Familiarity with the Borland Delphi programming system. Objects (components) and their powers
  • Feeding:
  • Enter
  • Work program
  • Delphi components
  • Objects and their powers
  • DELPHI - 1
  • 1. Introduction
  • Enter
  • Delphi is a modern and object-oriented system that allows you to create both simple (beginner, game programs) and complex database programs and business management
  • Programming in Delphi is a tedious process that can be accomplished by assembling a mosaic, children's cubes, a constructor, where the role of these cubes will be played by objects (buttons, texts, Edit - and other components)
  • As a designer, we place these elements on our form, and the skin element (object) has its own power, which we can apply
  • In addition, objects have their own methods - they specifically respond to song cues (pressing a button, key...), in which those that we have written in the processing code for this cue will be terminated
  • In this lesson we will get to know the Delphi - 7 working window and some of its frequently used components (objects) and their powers
  • Object-oriented programming in DELPHI.
  • 2. Delphi work window
  • This is our form, on which we place the objects
  • Tse vikno, in which we write the program code
  • Object inspector (here we change the power and behavior of objects)
  • Delphi work window
  • The system opens menus and component panels
  • Delphi work window
  • The menu system, which is revealed,
  • place functions for working with files, projects, customizing programs, etc.
  • (like MS OFFICE)
  • Delphi work window
  • A standard toolbar that allows you to work with frequently accessed projects, files, projects, forms
  • Let's see from the menu and component panel:
  • Delphi work window
  • The component panel of our program, where you can locate the tabs of grouped objects
  • Tab of standard elements that are most often vikorized
  • The tab of additional elements, which is now open, below the main elements, which is located in this tab
  • Dialogues tab, as well as vikoristuvatimemo
  • In the course of work, we select components from other panels
  • Let's see from the menu and component panel:
  • Object-oriented programming in DELPHI.
  • 3. Delphi components
  • Delphi components
  • 1. STANDARDS tab
  • Frame - frame. Use the form to serve as a container for other components. In the form view, you can place blank components on the component panel
  • MainMenu – the main program menu. The building component creates and maintains foldable hierarchical menus, such as, for example, in MS Word and other office programs, which has become a standard for program design.
  • Delphi components
  • Let's take a look at the report components on the panel tabs (of course, at first they are not the main ones and are often stacked)
  • 1. STANDARDS tab
  • PopupMenu – additional or local menu. Make sure this menu appears in the next window after pressing the right mouse button.
  • Label – mark. This component is selected for placement in the writing window.
  • Delphi components
  • Let's take a look at the report components on the panel tabs (of course, at first they are not the main ones and are often stacked)
  • 1. STANDARDS tab
  • Edit – row of entries. Intended for entering, displaying or editing a text series.
  • Memo - rich text editor. Vikorist is used to enter and display a wide variety of text.
  • Delphi components
  • Let's take a look at the report components on the panel tabs (of course, at first they are not the main ones and are often stacked)
  • 1. STANDARDS tab
  • Button – command button. The sampler for the OnClick function of this component will be used to implement the singing command.
  • CheckBox – independent remixer. Clicking the mouse on this component in the current program changes its logical power Checked.
  • Delphi components
  • Let's take a look at the report components on the panel tabs (of course, at first they are not the main ones and are often stacked)
  • 1. STANDARDS tab
  • RadioButton is a stale remix pump. Make sure you join at least one more of the same component in the group. The pressure of the remixer leads to automatic replacement before the selected remixer in the same group
  • ListBox – selectable list. Display a list of options (options) and allow you to control the current selection. .
  • Delphi components
  • Let's take a look at the report components on the panel tabs (of course, at first they are not the main ones and are often stacked)
  • 1. STANDARDS tab
  • ComboBox – combination list to choose from. Is a combination of the list of choice and text editor
  • ScrollBar – control management. This is vertical or horizontal, which is indicated by the color of scrolling from the sides of the Windows window.
  • Delphi components
  • Let's take a look at the report components on the panel tabs (of course, at first they are not the main ones and are often stacked)
  • 1. STANDARDS tab
  • GroupBox – group of elements. This component is used to group together many related components.
  • RadioGroup is a group of long-term remixers. Replace special authorities with the maintenance of several tied up stale remixers.
  • Delphi components
  • Let's take a look at the report components on the panel tabs (of course, at first they are not the main ones and are often stacked)
  • 1. STANDARDS tab
  • Panel – panel. This component, like the GroupBox, serves as a subset of many components. Move the inner and outer edges, which allows you to create the effects of “depression” and “convexity”.
  • Actiontist – list of actions. Serve for a centralized response of programs to user actions related to the selection of one of the groups of similar elements to control such as menu options, pictographic buttons, etc.
  • Delphi components
  • 1. DODATKOVO tab
  • BitBtn is a command button with a text and an icon.
  • StringGrid - table of rows. This component is highly capable of presenting textual information in a tabular form.
  • DrawGrid is a nice table. When subsumed under the StringGrid, the middle of this component can contain sufficient information, in a small way.
  • Delphi components
  • 1. DODATKOVO tab
  • (Let’s take a look at the steps we need)
  • ColorBox - a special ComboBox option for selecting one of the system colors
  • Chart – diagram. This component is made easier by the creation of special panels for graphical presentation of data.
  • Image – little one. This component is used for the reproduction of babies
  • Delphi components
  • In addition, we need several components from the tabs
  • Win32, Dialogues, System, Access to data
  • Looking at the lack of components, it is clear from their point of view that when further working with Delphi, you will definitely need advisers and electronic guides from Delphi, which are added to this course
  • Object-oriented programming in DELPHI.
  • 4. Objects and their powers
  • Objects and their powers
  • Let's start with the main object, be it any program - form
  • Let's fire up Delphi and take a look at the power of the form in the Object Inspector
  • The Object Inspector has two tabs:
  • Parameters (here we change the power of the object)
  • Subjects (here we mean, if any subdivision is present, our code will be entered)
  •  Authority and power for objects, protection for form, even more. As part of our course, we will look at both simple and widely used
  • Objects and their powers
  • Align - power, which indicates the position of the form on the screen. For example, if we select this power equal to the value of alClient, the form will take over the entire screen
  •  Try setting the Align power to different values ​​and see how the appearance and position of the form on the screen changes. To do this, click the "Viscont" button on the toolbar (or press the F9 key)
  • 1. Align power (alignment of the form on the screen)
  •  When looking at the current authorities, also try changing the values, running the project (F9), to see how the change of authorities is displayed on the form (or other object)
  • Objects and their powers
  • 2. The power of AlfaBlend (the insight of the object)
  • AlfaBlend – includes and enhances the clarity of the form
  • AlfaBlendValue – allows you to set the level of insight
  •  Set the AlfaBlend power to True, and the AlfaBlendValue power to 100, run (F9), and the form becomes clear
  • 3. AutoScroll power (automatic scrolling appears)
  • When enabled (true), the form will automatically display a scrolling effect, as the dimensions of the objects will exceed the dimensions of the form
  • 4. AutoSize power (automatically setting the size of the form)
  • When enabled (true), the size of the form automatically adjusts to the size of the objects on it
  • Objects and their powers
  • 5. Power of BorderIcons (view of icons on the form header)
  • Setting these controls allows us to click or unmute the buttons for work with a window on our form
  • For example, if the biMinimize date is set to False, then in our window there will be no button to minimize the window (it will not be available)
  • 6. The power of BorderStyle determines the appearance of the border of our window
  • For example, the value of bsSingle is to break between thin lines, and the value of bsNone is to break the form in the middle without a cordon (this is often the case when creating screensavers before the program)
  • Objects and their powers
  • 7. Power Caption (means the title of the program window)
  • If you enter the word Calculator here, it will automatically fit into the title of the window
  • 8. The power of Color means the color of our shape
  • On the right side there is a set of colors that you can open and select the required one.
  • If you are not in control of this selection, please double-click the bear on the right side of power and select the required color yourself
  • Objects and their powers
  • 9. Power Enabled (object availability)
  • If the power is false, the object will be inaccessible (inactive)
  • 10. Font power (font settings)
  • Here you can change the size, color and writing of the test on objects
  • 11. Authority FormStyle (form style)
  • This means the style of the form. For example, if you assign a value to fsStayOnTop, then the size of the form cannot be changed, taking into account its boundaries
  • 12. Power Icon (program window icon)
  • This means the icon in the program window, which you can choose from or design yourself
  • Objects and their powers
  • 13. Power of VertScrollBar (means the visibility of that type of vertical scrollbar)
  • 14. Visible power (means the visibility of the object)
  • If the value of power is true, then the object is visible, and if false, the object is not visible
  • 14. VindowState power (means the status of the program window at the hour of launch)
  • Depending on the value of power, programs can be launched in full-screen (maximized), minimized (minimized) or normal view
  • Well, we looked at the actions of power of objects (in terms of form) and tried them in action. Similarly, the skin object (buttons, Edit, Memo, Timer...) has its own power, which may have a lot of power and activity
  • Objects and their powers
  • Let’s take a look at what steps can react to objects of form
  • For this purpose, let's place a BUTTON on our form. How can you earn money?
  • In the Delphi panel, go to the STANDARDS tab, on it the BUTTON element, click on it, and then click on the form - a button appears
  • Change the power of the Caption button on OUTPUT
  • Now let's go to the POI tab of the object inspector
  • The main method for many objects, and especially for the button, is clicking the mouse OnClick
  • Click on the white area for power and you will see a window with the program code:
  • Insert a close operator between the words begin and end, then run the program (F9) and press the button - the button works. When you click on the button, the code for closing the window is displayed (close)
  • close
  • Delphi components
  • In addition to the most stagnant pressure on the button, there are many others, for example, when the mouse cursor is hovering over the OnMouseMove object
  • These concepts and examples of them are learned in the process of work in our course.
  • OOP in Delphi - 2:
  • First program in Delphi, saving and compilation
  • You will learn how to save and compile a project, create your own program, and learn how to read module output code
  • In this lesson we learned about the Borland Delphi programming system, objects (components) and their powers
  • LESSON BAGS:
  • FOR YOUR DAY LESSON:

Municipal lighting mortgage

Secondary dark-illuminated school No. 1

With. Searched

DELPHI. Getting to know the programming system

Development of computer science teacher V'yacheslav Oleksandrovich Maksimov.


Delphi. The main power of the product.

Delphi- this is a combination of many important technologies:

  • Highly productive compiler for machine code
  • Object-oriented component model
  • Visual (and, therefore, Swedish) inspiration from software prototypes
  • Scaling features for individual databases

Object-oriented model of software components

The main focus of this model is Delphi work on the maximum vikoristan code. This allows developers to be able to program even quickly from the preparation of objects in advance, and also gives them the ability to create their own objects for the middle Delphi. There is no need to know the types of objects that robots can create. In truth, everything is Delphi It is written on this page, so researchers can gain access to the very objects and tools that were used for the creation of the center of development. As a result, there is no difference between the objects supplied by Borland and third parties, and the objects you can create.


Shvidka development of practical equipment from prototypes

The Rendzu gaming program was collected from ready-made items during the working day, and most of the hour was devoted to embellishment and embellishment.


Development of accessories

Screen Saver is also in preparation for Delphi in just an insignificant hour. Now this anniversary is decorating the skin of the IBM crazy machine.


Who is Delphi intended for?

In the first place Delphi applications for professional developers of corporate information systems

Delphi There are no fewer awards for professional programmers.

Zastosovaya Delphi Readers, doctors, VNZ depositors, businessmen, all those who use computers with daily applied methods.


Library of visual components

This object library includes standard objects for the backend interface, data management objects, graphics objects, multimedia objects, dialogs and file management objects, DDE management and OLE.


Delphi: customized middleware

palette component .

The components are grouped on the sides of the panel according to their functions. For example, the components that represent Windows “common dialogs” are all located on the side of the panel called “Dialogs”. .

Delphi Allows students to customize the center for maximum handiness. You can easily change the palette of components, the toolbar, and also customize the color syntax.

Dear, what in Delphi You can select your group of components and place them on the side of the panel, and if necessary, regroup components or remove uncorrected ones.

This palette

component

you can choose

components,

which ones are possible

will be a program.

Components include

at home as visually,

and logical components.

After launch Delphi

at the top window

horizontally

Rotate icons

palette of components.

What is the cursor?

focus on

one of the icons,

under her in

Zhovtii upright

a hint appears

side of the palette under the title “Dialogs”


Intelligent editor

You can edit programs such as text entries and macros, work with text blocks, key combinations that can be configured, and a color view of rows.


Object inspector

This tool is surrounded by a window where you can set the values ​​of authorities and objects (Properties & Events) during program design.


Project Manager.

Allows the developer to view all modules for a specific project and provides a manual mechanism for project management. The Project Manager shows file names, time/date of selected forms, etc. You can easily insert it into text or form by simply clicking the mouse on your name.


Object navigator

Shows

library

available objects

Active

navigation

according to you

addendum.

You can marvel

hierarchy

objects,

precompiled

modules from the librarian,

list of global

names of your code.


Development of database add-ons

Delphi allows

vikorystuvati

library of visuals

component for shvidkogo

creation of reliable additives,

which are easy to expand

to additional architecture

client-server.

In other words, you can create a program

works with a local InterBase server,

and then vikorista create an additional addition,

connecting to a remote SQL server via SQL-Links.


Delphi- here in front of us is the middle of the rozrobka, which is based

on vicoristic components.

So you can add new components

to the component palette.

You can fold the components in the middle Delphi ,

or introduce components created as core elements

VBX or OLE 2.0, or you can vikorize components,

written in C or C++ as dll.


Access to hardware and software features

Windows 3.1 is even better

27 Mb of disk space for minimal configuration

50 Mb of disk space for normal configuration

processor 80386, or better 80486


  • . There are already a lot of retailers in the world who are firmly oriented towards Delphi as a tool that allows you to create highly efficient client-server programs. Moreover, the list of ready-made professional desktop software is large, which makes it impossible to list them all in this presentation. Range of extensions for help Delphi software products also affect – from gaming programs to the most advanced banking systems.

  • DELPHI. Subtle programming. Vasil Kucherenko. - M: "Piznavalna kniga plus", 2000, -192 p.
  • Vivchaemo DELPHI. O. Zhukov. PETER. 2002.