SlideShare une entreprise Scribd logo
1  sur  46
Télécharger pour lire hors ligne
Intro to Event-driven Programming
and Forms with Delphi
L01 - Introduction

Mohammad Shaker
mohammadshakergtr.wordpress.com
Intro to Event-driven Programming and Forms with Delphi
@ZGTRShaker
2010, 2011, 2012
About the Course
•
•
•
•

Delphi 2007-2009
How to think like a programmer
Test Questions
You need to try your self, otherwise it won’t work out with
you (practice, practice, practice)
Course plan
•
•
•
•
•
•
•
•
•
•

Introduction to Delphi
Introduction to IDE & Event Driven Programming
StartSaveOpen a project
Form design (designruntime )
Delphi Components
Input Handling
Event handling
Files
Drawing (Canvas, Timer, etc.)
Instantiate Controls at Runtime
Delphi History
•
•
•
•
•
•

‘ALGOL’* the first high-level language
‘ALGOL’* > Pascal ‘Niklaus Wirth’**
the original definition of Pascal was published in 1971.
Pascal becomes the ‘FORMAL’ programming language.
Turbo Pascal 1.0 (November 1983)
Delphi in 1995 Was introduced for ‘Visual Programming’

• *ALGOL: Algorithmic language
• ** Niklaus Wirth: (b. February 15, 1934) is a Swiss computer scientist, best
known for designing Pascal programming language, and for pioneering
several classic topics in software engineering. In 1984 he won the Turing
Award for developing a sequence of innovative computer languages.
Delphi History
• Pascal > Delphi
• Borland > Pascal > Compiler > Delphi
Differences
• Interface: from “Console” to “Visual”.
• All Applications need Visual Interaction.
• IDE: (Integrated Development Environment)
Delphi Preferences & features
•
•
•
•
•

OOP (Object Oriented Programming)
Applications: are build in the form of ‘forms’.
Components
Api functions ‘in Windows’.
10 times faster compiler in comparison to other programming
languages.
– Executive building files (exe) forms.
– No DLL libraries like other programming languages (Dynamic Link
Library)
– Database compatibility.
Now, let’s sneak peek
Install
CodeGear Delphi
What’s for today?
•
•
•
•
•

Design timeExecution time (runtime)
Event-Driven Programming
Your first Project
Forms, Buttons
ShowMessage
Design timeExecuting time
Programs executing
• Procedural Programming:
– Sequential

• “Event-Driven” Programming:
– Event
File Menu
• New > VCL forms Applications
• open
• Save
OpenSave a Project
• When saved.
– first, “UNIT” is being saved
– Then, the “PROJECT”

• File > Save as
(Pas file is saved)
• File > Save project as
(dpr is saved)
• “exe.” file is formed in running time.
Object inspector
Object inspector
• Properties: like width, color, etc.
• Events: like pressing buttons, moving mouse, etc.
Properties
Events
Common Properties for all components
•
•
•
•
•
•
•

Width, Height.
Top, left.
‘Hint’ adding & showhint.
Visible.
Enabled.
Font.
Color.
Common Events for all components
•
•
•
•
•
•
•

Onclick
OnDoubleClick
OnMouseMove
OnDragDrop
OnCreate
OnClose
Rest of them
Note that
• All the above properties & events can be modified at design
time or runtime.
Event Handling
Live Example
Tool palette.. components
Tabs
Forms
Windows Applications  forms
Every “form” has a corresponding “unit”
Forms properties
• All the following properties are ‘boolean’s:
– BiSystemMenu:
• All three buttons disappear.

– BiMinimize:
• to taskbar minimization.

– BiMaximize:
• resize button.

– BiHelp:
• ’?’ button.

• Position: the place the form will appear on the screen.
• Icon: the style of the form’s icon.
– You can browse it from your PC images & pics.
Forms events
•
•
•
•
•
•

OnClose
OnMouseClick
OnHold
OnCreate
OnResize
OnMouseWheelUp
Buttons
• Adding a button to our project
Button properties
• Name: the one we use in code (we can’t write in Arabic here.)
• Caption: the “Visual” name that will appear to the client. (we can
write in Arabic here) *
• Topleft: parametric variables indicate the position of the
component in the form.
• Fonts: colorvolume & type of the written “Caption” design.
• Hint: showing a ‘hint’ when the cursor (mouse) stop on the ‘button’.
• Show Hint: shows the written hint above.
• Visible  Enabled
• Tab Order
• etc.
_________________________________
*Delphi is Arabic compatible
Button Events
•
•
•
•

OnClick
OnMouseMove
OnKeyPress
etc.
Button Events
•
•
•
•
•
•

Let’s have a quick sneak on the code
Create a new form
Place a “Button” named “KeKe” in it.:D
Double click on the button
See where you are now
Test it
ShowMessage
Ctrl + Space
Button Events

Events + Properties
Test it

Before Clicking

After Clicking
ShowMessage
• The name of the application's executable file appears as the
“caption” of the message box.
• Msg parameter is the message string that appears in the
message box.
• Code example:
Var worked:boolean;
If (not(Worked)) then
ShowMessage (‘Cmon

Work ’);
ShowMessage
procedure TForm1.Button1Click(Sender: TObject);
var b: boolean;
begin
b:= false;
if (not(b)) then
begin
ShowMessage('Hi There ');
end;
end;
ShowMessage

After clicking the button
References
• ‘Delphi’ Help
• Delphibasics.co.uk
• Delphi Books
See you!

Contenu connexe

Tendances

East Coast DevCon 2014: Extensibility in UE4 - Customizing Your Games and the...
East Coast DevCon 2014: Extensibility in UE4 - Customizing Your Games and the...East Coast DevCon 2014: Extensibility in UE4 - Customizing Your Games and the...
East Coast DevCon 2014: Extensibility in UE4 - Customizing Your Games and the...
Gerke Max Preussner
 

Tendances (20)

East Coast DevCon 2014: Extensibility in UE4 - Customizing Your Games and the...
East Coast DevCon 2014: Extensibility in UE4 - Customizing Your Games and the...East Coast DevCon 2014: Extensibility in UE4 - Customizing Your Games and the...
East Coast DevCon 2014: Extensibility in UE4 - Customizing Your Games and the...
 
SP24S053 Introduction to PowerShell for SharePoint Developers and Administrators
SP24S053 Introduction to PowerShell for SharePoint Developers and AdministratorsSP24S053 Introduction to PowerShell for SharePoint Developers and Administrators
SP24S053 Introduction to PowerShell for SharePoint Developers and Administrators
 
Getting Started With PowerShell Scripting
Getting Started With PowerShell ScriptingGetting Started With PowerShell Scripting
Getting Started With PowerShell Scripting
 
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides:  Let's build macOS CLI Utilities using SwiftMobileConf 2021 Slides:  Let's build macOS CLI Utilities using Swift
MobileConf 2021 Slides: Let's build macOS CLI Utilities using Swift
 
Sup
SupSup
Sup
 
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
GDC Europe 2014: Unreal Engine 4 for Programmers - Lessons Learned & Things t...
 
Etiene Dalcol - Web development with Lua Programming Language - code.talks 2015
Etiene Dalcol - Web development with Lua Programming Language - code.talks 2015Etiene Dalcol - Web development with Lua Programming Language - code.talks 2015
Etiene Dalcol - Web development with Lua Programming Language - code.talks 2015
 
Manage your infrastructure with PowerShell
Manage your infrastructure with PowerShellManage your infrastructure with PowerShell
Manage your infrastructure with PowerShell
 
West Coast DevCon 2014: The Slate UI Framework (Part 2) - Game UI & Unreal Mo...
West Coast DevCon 2014: The Slate UI Framework (Part 2) - Game UI & Unreal Mo...West Coast DevCon 2014: The Slate UI Framework (Part 2) - Game UI & Unreal Mo...
West Coast DevCon 2014: The Slate UI Framework (Part 2) - Game UI & Unreal Mo...
 
Introduction to Phoenix Framework (Elixir) 2016-01-07
Introduction to Phoenix Framework (Elixir) 2016-01-07Introduction to Phoenix Framework (Elixir) 2016-01-07
Introduction to Phoenix Framework (Elixir) 2016-01-07
 
Functional Programming for Busy Object Oriented Programmers
Functional Programming for Busy Object Oriented ProgrammersFunctional Programming for Busy Object Oriented Programmers
Functional Programming for Busy Object Oriented Programmers
 
Deliver Python Apps with Docker
Deliver Python Apps with DockerDeliver Python Apps with Docker
Deliver Python Apps with Docker
 
Ndc2017
Ndc2017Ndc2017
Ndc2017
 
Obfuscating The Empire
Obfuscating The EmpireObfuscating The Empire
Obfuscating The Empire
 
Code in the cloud with Eclipse Che and Docker
Code in the cloud with Eclipse Che and DockerCode in the cloud with Eclipse Che and Docker
Code in the cloud with Eclipse Che and Docker
 
Top 10 PowerShell Features in Server 2012
Top 10 PowerShell Features in Server 2012Top 10 PowerShell Features in Server 2012
Top 10 PowerShell Features in Server 2012
 
UNM Tech Day 2018 - Ansible: 
Server and Network Device Automation
UNM Tech Day 2018 - Ansible: 
Server and Network Device AutomationUNM Tech Day 2018 - Ansible: 
Server and Network Device Automation
UNM Tech Day 2018 - Ansible: 
Server and Network Device Automation
 
Paint it blue with PowerShell
Paint it blue with PowerShellPaint it blue with PowerShell
Paint it blue with PowerShell
 
Working Well Together: How to Keep High-end Game Development Teams Productive
Working Well Together: How to Keep High-end Game Development Teams ProductiveWorking Well Together: How to Keep High-end Game Development Teams Productive
Working Well Together: How to Keep High-end Game Development Teams Productive
 
Confrontation Pipeline and SCons
Confrontation Pipeline and SConsConfrontation Pipeline and SCons
Confrontation Pipeline and SCons
 

Similaire à Delphi L01 Intro

Xcode, Basics and Beyond
Xcode, Basics and BeyondXcode, Basics and Beyond
Xcode, Basics and Beyond
rsebbe
 
Computer and multimedia Week 1 Windows Architecture.pptx
Computer and multimedia Week 1 Windows Architecture.pptxComputer and multimedia Week 1 Windows Architecture.pptx
Computer and multimedia Week 1 Windows Architecture.pptx
fatahozil
 
Introduction to visual basic
Introduction to visual basicIntroduction to visual basic
Introduction to visual basic
Manav Khandelwal
 
ASP.NET Session 4
ASP.NET Session 4ASP.NET Session 4
ASP.NET Session 4
Sisir Ghosh
 

Similaire à Delphi L01 Intro (20)

IBM Domino Designer: Tips and tricks for maximum productivity
IBM Domino Designer: Tips and tricks for maximum productivityIBM Domino Designer: Tips and tricks for maximum productivity
IBM Domino Designer: Tips and tricks for maximum productivity
 
Xcode, Basics and Beyond
Xcode, Basics and BeyondXcode, Basics and Beyond
Xcode, Basics and Beyond
 
Introduct To C Language Programming
Introduct To C Language ProgrammingIntroduct To C Language Programming
Introduct To C Language Programming
 
Ios-training-institute-in-mumbai
Ios-training-institute-in-mumbaiIos-training-institute-in-mumbai
Ios-training-institute-in-mumbai
 
Ios-training-institute-in-mumbai
Ios-training-institute-in-mumbaiIos-training-institute-in-mumbai
Ios-training-institute-in-mumbai
 
Computer and multimedia Week 1 Windows Architecture.pptx
Computer and multimedia Week 1 Windows Architecture.pptxComputer and multimedia Week 1 Windows Architecture.pptx
Computer and multimedia Week 1 Windows Architecture.pptx
 
C++ l 1
C++ l 1C++ l 1
C++ l 1
 
Does The Delphi IDE Narrow You? Extend It! - ITDevConX European Delphi Confer...
Does The Delphi IDE Narrow You? Extend It! - ITDevConX European Delphi Confer...Does The Delphi IDE Narrow You? Extend It! - ITDevConX European Delphi Confer...
Does The Delphi IDE Narrow You? Extend It! - ITDevConX European Delphi Confer...
 
Ios training-cum-course-in-mumbai-
Ios training-cum-course-in-mumbai-Ios training-cum-course-in-mumbai-
Ios training-cum-course-in-mumbai-
 
Introduction to visual basic
Introduction to visual basicIntroduction to visual basic
Introduction to visual basic
 
Lecture 12
Lecture 12Lecture 12
Lecture 12
 
W1.pptx
W1.pptxW1.pptx
W1.pptx
 
Samsung Indonesia: Tizen Native App
Samsung Indonesia: Tizen Native AppSamsung Indonesia: Tizen Native App
Samsung Indonesia: Tizen Native App
 
Chapter i(flash basic)
Chapter i(flash basic)Chapter i(flash basic)
Chapter i(flash basic)
 
Ios - Intorduction to view controller
Ios - Intorduction to view controllerIos - Intorduction to view controller
Ios - Intorduction to view controller
 
React nativebeginner1
React nativebeginner1React nativebeginner1
React nativebeginner1
 
Let's create a multilingual site in WordPress
Let's create a multilingual site in WordPressLet's create a multilingual site in WordPress
Let's create a multilingual site in WordPress
 
Desktop apps with node webkit
Desktop apps with node webkitDesktop apps with node webkit
Desktop apps with node webkit
 
Csharp introduction
Csharp introductionCsharp introduction
Csharp introduction
 
ASP.NET Session 4
ASP.NET Session 4ASP.NET Session 4
ASP.NET Session 4
 

Plus de Mohammad Shaker

Plus de Mohammad Shaker (20)

12 Rules You Should to Know as a Syrian Graduate
12 Rules You Should to Know as a Syrian Graduate12 Rules You Should to Know as a Syrian Graduate
12 Rules You Should to Know as a Syrian Graduate
 
Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]
Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]
Ultra Fast, Cross Genre, Procedural Content Generation in Games [Master Thesis]
 
Interaction Design L06 - Tricks with Psychology
Interaction Design L06 - Tricks with PsychologyInteraction Design L06 - Tricks with Psychology
Interaction Design L06 - Tricks with Psychology
 
Short, Matters, Love - Passioneers Event 2015
Short, Matters, Love -  Passioneers Event 2015Short, Matters, Love -  Passioneers Event 2015
Short, Matters, Love - Passioneers Event 2015
 
Unity L01 - Game Development
Unity L01 - Game DevelopmentUnity L01 - Game Development
Unity L01 - Game Development
 
Android L07 - Touch, Screen and Wearables
Android L07 - Touch, Screen and WearablesAndroid L07 - Touch, Screen and Wearables
Android L07 - Touch, Screen and Wearables
 
Interaction Design L03 - Color
Interaction Design L03 - ColorInteraction Design L03 - Color
Interaction Design L03 - Color
 
Interaction Design L05 - Typography
Interaction Design L05 - TypographyInteraction Design L05 - Typography
Interaction Design L05 - Typography
 
Interaction Design L04 - Materialise and Coupling
Interaction Design L04 - Materialise and CouplingInteraction Design L04 - Materialise and Coupling
Interaction Design L04 - Materialise and Coupling
 
Android L05 - Storage
Android L05 - StorageAndroid L05 - Storage
Android L05 - Storage
 
Android L04 - Notifications and Threading
Android L04 - Notifications and ThreadingAndroid L04 - Notifications and Threading
Android L04 - Notifications and Threading
 
Android L09 - Windows Phone and iOS
Android L09 - Windows Phone and iOSAndroid L09 - Windows Phone and iOS
Android L09 - Windows Phone and iOS
 
Interaction Design L01 - Mobile Constraints
Interaction Design L01 - Mobile ConstraintsInteraction Design L01 - Mobile Constraints
Interaction Design L01 - Mobile Constraints
 
Interaction Design L02 - Pragnanz and Grids
Interaction Design L02 - Pragnanz and GridsInteraction Design L02 - Pragnanz and Grids
Interaction Design L02 - Pragnanz and Grids
 
Android L10 - Stores and Gaming
Android L10 - Stores and GamingAndroid L10 - Stores and Gaming
Android L10 - Stores and Gaming
 
Android L06 - Cloud / Parse
Android L06 - Cloud / ParseAndroid L06 - Cloud / Parse
Android L06 - Cloud / Parse
 
Android L08 - Google Maps and Utilities
Android L08 - Google Maps and UtilitiesAndroid L08 - Google Maps and Utilities
Android L08 - Google Maps and Utilities
 
Android L03 - Styles and Themes
Android L03 - Styles and Themes Android L03 - Styles and Themes
Android L03 - Styles and Themes
 
Android L02 - Activities and Adapters
Android L02 - Activities and AdaptersAndroid L02 - Activities and Adapters
Android L02 - Activities and Adapters
 
Android L01 - Warm Up
Android L01 - Warm UpAndroid L01 - Warm Up
Android L01 - Warm Up
 

Dernier

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

Delphi L01 Intro