Document directory
Concise Delphi tutorial
DelphiTutorial Series of books(048)《DelphiConcise tutorial Organize netizens (state)Email:Shuaihj@163.com
:
PDF
- Edited by Zheng Hong
- Zhang Jin
Introduction
Delphi 5 is a new-generation visual program development tool developed by software giants and famous Inprise companies. It has been widely favored by computer programmers and professionals of various institutions. In order to satisfy the wishes of the readers and quickly master the Delphi programming method in the Windows environment, the editor compiled this book. The book is divided into nine chapters, mainly including the use of VCL control in Delphi 5, text, graphics and image processing, menu and dialog box design, file management skills, multimedia program production, the form design scheme and the fascinating database development and application in Delphi. The book integrates the theories and practices of developing Windows applications using Delphi 5, comprehensively and deeply introduces common methods and techniques for developing applications using Delphi 5, which is highly practical. This book is rich in materials and informative. It is easy to learn, easy to use, and concise. It is suitable for readers who have a certain understanding of Windows programming. It can also be used as a reference for many computer enthusiasts.
Preface
Delphi is a "visual" program development tool developed by software giants and famous Inprise companies. Its basic language is Pascal's programming language, and it inherits the advantages of Pascal, for example, the code structure is clear, the code is readable, and the code execution efficiency is high. Therefore, Delphi was quickly praised by users once it was launched. After years of improvement by Inprise's software designers, Delphi's program development tools have been improved to varying degrees in various aspects, for example, the database architecture, VCL control development, web applications, and secure threads make Delphi more powerful and convenient to use, this improves the development efficiency of applications. In short, Delphi is one of the most powerful tools for developing Windows applications. It is a beginner in Windows Programming and an experienced windows programmer, you can use Delphi to quickly develop applications that you are satisfied. In order to satisfy the wishes of the readers and quickly master the Delphi programming method in windows, the editor wrote the book in the context of the latest Delphi 5. The content of the book is as follows: chapter 1 describes some basic knowledge about using Delphi to compile applications and how to use Delphi to compile simple Windows applications; chapter 2 and Chapter 3 introduce the design of the dialog box and menu program in Delphi, and Chapter 4 introduce the commonly used graphic rendering and image processing techniques in Delphi; chapter 5 focuses on the development technology of various forms in Delphi and the design scheme of forms. Chapter 6 describes the development and application of commonly used VCL controls (visual controls) in Delphi, this is a very important part in the Delphi application field and a necessary Windows Programming Skill for readers. Chapter 7 describes how to process files in Delphi; chapter 8 introduces the management and development methods of attractive databases in Delphi. Chapter 9 introduces In this chapter, we also designed instance programs such as sound players and video players, which will lead readers to a higher level of Delphi. This book focuses on instance development, development experience, development skills, and Windows Advanced features development, suitable for Delphi users at all levels. For beginners, you can quickly join the ranks of advanced users of Delphi. For readers with certain experience, you can also use this book to master the in-depth development methods of Delphi, learn to develop high-level Delphi applications in a more clever way. However, limited by the editor level, errors and shortcomings in the book are inevitable. We sincerely welcome readers to criticize and suggest this book. Finally, the examples in the book contain a large number of program code, instance names, graphic images, and data information. It is a coincidence that the content is similar.
Directory
Chapter 1 Introduction to Delphi programming .................................. ........................................ ........................................ ........... 1
1.1 Introduction to the basic concepts of Delphi ................................... ........................................ ........................................ ........... 1
1.1.1 basic form of Delphi ................................... ........................................ ........................................ ...... 1
1.1.2 concepts of object-oriented programming .................................. ........................................ ........................................... 1
1.2 introduction to new features of Delphi ................................... ........................................ ........................................ .............. 2
1.2.1 extension of the Object Pascal language .................................. ........................................ ................................ 2
1.2.2 improve ide ..................................... ........................................ ........................................ ................... 2
1.2.3 enhance the VCL control .................................... ........................................ ........................................ .......... 3
1.2.4 accelerate the development of complex projects ................................. ........................................ .................................... 3
1.3 system configuration and programming environment .................................. ........................................ ........................................ ............ 3
1.3.1 Delphi system configuration .................................... ........................................ ........................................ ........ 3
1.3.2 Delphi programming environment .................................... ........................................ ........................................ ........ 4
1.4 The first example .................................... ........................................ ........................................ ........................ 6
1.5 summary ...................................... ........................................ ........................................ ............................ 11
Chapter 2 windows General dialog box ................................... ........................................ ........................................ ......... 12
2.1 Introduction to functions in the dialog box .................................... ........................................ ........................................ .............. 12
2.1.1 showmessage function ..................................... ........................................ ......................................... 12
2.1.2 messagedlg function ..................................... ........................................ ........................................ ..... 13
2.1.3 inputbox function ..................................... ........................................ ........................................ ......... 14
2.2 System dialog box call technology ................................... ........................................ ........................................ ......... 15
2.2.1 file dialog box ..................................... ........................................ ........................................ ............ 15
2.2.2 "color" dialog box ................................... ........................................ ........................................ ........ 17
2.2.3 "font" dialog box ................................... ........................................ ........................................ ........ 19
2.2.4 "Search" dialog box ................................... ........................................ ........................................ ........ 20
2.3 use of the standard dialog box ................................... ........................................ ........................................ ............ 24
2.4 Summary ...................................... ........................................ ........................................ ............................ 33
Chapter 3 Development and Design of Menu programs ................................ ........................................ ........................................ ........ 34
3.1 basic overview of the main menu .................................... ........................................ ........................................ .............. 34
3.1.1 create menu items .................................... ........................................ ........................................ ............. 34
3.1.2 set the separator ..................................... ........................................ ........................................ ............ 37
3.1.3 set the shortcut key ..................................... ........................................ ........................................ ............ 38
3.1.4 set the check mark .................................... ........................................ ........................................ .......... 40
3.1.5 set the effective status of menu items .................................. ........................................ ......................................... 41
3.2 main menu application .................................... ........................................ ........................................ .................. 42
3.3 comprehensive application of the main menu and pop-up menu ................................. ........................................ ....................................... 53
3.3.1 project and settings .................................... ........................................ ........................................ ............. 54
2 Delphi concise tutorial
3.3.2 Design of the pop-up menu ................................... ........................................ ........................................ ........ 55
3.3.3 running result and reference program .................................. ........................................ ......................................... 60
3.4 summary ...................................... ........................................ ........................................ ............................ 63
Chapter 4 graphic rendering in Delphi ................................... ........................................ ........................................ ........ 64
4.1 draw a basic graph ................................... ........................................ ........................................ ................ 64
4.1.1 draw a straight line .................................... ........................................ ........................................ .............. 64
4.1.2 draw an ellipse .................................... ........................................ ........................................ .............. 66
4.1.3 draw a polygon ..................................... ........................................ ........................................ ............. 68
4.1.4 draw a rectangle ..................................... ........................................ ........................................ ................. 70
4.1.5 draw a triangle curve .................................... ........................................ ........................................ ........... 72
4.2 design of complex graphics ................................... ........................................ ........................................ ................ 75
4.2.1 design a complex pattern .................................... ........................................ ........................................ ........... 75
4.2.2 real-time painting procedures .................................... ........................................ ........................................ ........... 81
4.3 manually draw images .................................... ........................................ ........................................ ................... 86
4.4 summary ...................................... ........................................ ........................................ .......................... 105
Chapter 5 design and use of user forms ................................ ........................................ ........................................ ....... 106
5.1 quick start using the wizard .................................... ........................................ ........................................ ................. 106
5.2 multi-page form development .................................... ........................................ ........................................ ................. 108
5.3 composite form development .................................... ........................................ ........................................ ................. 118
5.3.1 design of a child form for drawing a straight line ................................. ........................................ .................................... 118
5.3.2 design of the sub-form for drawing an elliptic ................................. ........................................ .................................... 119
5.3.3 design of the child form for polygon ................................. ........................................ ................................ 121
5.3.4 complete design of the main form ................................... ........................................ ........................................ .. 123
5.4 Development of Multi-document interface forms ................................. ........................................ ........................................ ..... 128
5.5 summary ...................................... ........................................ ........................................ .......................... 137
Chapter 6 Use of common VCL controls ................................. ........................................ ........................................ ......... 139
6.1 Edit Control and button control .................................. ........................................ ........................................... 139
6.2 ListBox control and ComboBox control .................................. ........................................ ............................... 149
6.3 memo control and dialog control .................................. ........................................ ....................................... 152
6.4 radiogroup control and checkbox control .................................. ........................................ .......................... 158
6.5 directoryoutline control and animate control .................................. ........................................ .................... 168
6.6 Summary ...................................... ........................................ ........................................ .......................... 175
Chapter 7 manage files, directories, and drives ................................ ........................................ ........................................... 176
7.1 Introduction to various controls .................................... ........................................ ........................................ ................. 176
7.1.1 drive control ..................................... ........................................ ........................................ ........... 176
7.1.2 directory control ..................................... ........................................ ........................................ ............... 178
7.1.3 file list control .................................... ........................................ ........................................ ......... 179
7.1.4 file filter control .................................... ........................................ ........................................ ..... 180
7.2 use controls to manage files ................................... ........................................ ........................................ ........... 182
7.3 manage the directory ..................................... ........................................ ........................................ ........................ 187
7.3.1 chdir function ..................................... ........................................ ........................................ ............ 187
7.3.2 mkdir function ..................................... ........................................ ........................................ ........... 187
7.3.3 rmdir function ..................................... ........................................ ........................................ .......... 188
Delphi concise tutorial 3
7.3.4 application example ..................................... ........................................ ........................................ .............. 188
7.4 manage the drive ..................................... ........................................ ........................................ ................... 193
7.4.1 disksize function ..................................... ........................................ ........................................ ........ 193
7.4.2 diskfree function ..................................... ........................................ ........................................ ........ 194
7.4.3 getdir function ..................................... ........................................ ........................................ .......... 195
7.5 summary ...................................... ........................................ ........................................ .......................... 196
Chapter 8 database development and management .................................. ........................................ ........................................ ............ 197
8.1 use the Database Wizard .................................... ........................................ ........................................ ............ 197
8.2 customize the database .................................... ........................................ ........................................ ............ 202
8.3 database management procedures .................................... ........................................ ........................................ ............ 211
8.4 design database reports .................................... ........................................ ........................................ ............ 218
8.5 summary ...................................... ........................................ ........................................ .......................... 220
Chapter 9 multimedia design and use ................................. ........................................ ........................................ ......... 221
9.1 understand the mediaplayer control .................................... ........................................ ........................................... 221
9.1.1 autoenable attributes ..................................... ........................................ ........................................... 222
9.1.2 display attributes ..................................... ........................................ ........................................ .......... 223
9.1.3 filename attributes ..................................... ........................................ ........................................ ........ 225
9.1.4 devicetype attributes ..................................... ........................................ ........................................... 226
9.1.5 enabledbuttons attributes ..................................... ........................................ ..................................... 226
9.2 audio playing program .................................... ........................................ ........................................ ................ 227
9.3 video playing program .................................... ........................................ ........................................ ................ 235
9.4 summary ...................................... ........................................ ........................................ .......................... 245