SlideShare a Scribd company logo
Intro to Event-driven Programming
and Forms with Delphi
L02 – Controls P1

Mohammad Shaker
mohammadshakergtr.wordpress.com
Intro to Event-driven Programming and Forms with Delphi
@ZGTRShaker
2010, 2011, 2012
What’s for today?
•
•
•
•
•
•
•
•

Label
Edit
ComboBox
CheckBox
GroupBox
RadioButton
RadioGroup
ListBox
Tips
General ‘Info’s & Tips
• Don’t forget the CTRL+Space auto-completion
– CTRL+Space: code in-sightauto-completion.

• You can’t write in Arabic in a component’s “NAME”.
• Delphi is a not a “Case Sensitive ” language.
• dpr *: when saving, the project you have will be saved as a
‘dpr’ termination.

*dpr: Delphi Project
Runtime
• Form the upper bar > Run > Run.
• Form the button in the upper bar.
• Or F9
Sth to Remember
• Differentiate between Visible & Enabled in Component’s
properties.
• Differentiate between Name & Caption in Component’s
properties.
• F9: RUN.
• F9+CTRL: Compile.
Changing your “.exe” icon
• “.ico” files extension
• Project > Options > Application > Load Icon
• It appears in the upper left corner of the application form
Chase the button
Exercise Do it & enjoy catching it :D
Label
Example
• Design this
Label
• Is an Info
• It can be used as an output as a “String”
• “caption” manipulating.

Label1.caption:= ‘Hello World’;

String & only String
Edit
Example
• Design this
Pre-Made String Functions
• StrAlloc
– Allocates a character buffer of a given size on the heap.

• StrBufSize
– Returns the size of a character buffer allocated using StrAlloc or
StrNew.

• StrCat
– Concatenates two strings.

• StrComp
– Compares two strings.

• StrCopy
– Copies a string.
Pre-Made String Functions
• StrDispose
– Disposes a character buffer allocated using StrAlloc or StrNew.

• StrECopy
– Copies a string and returns a pointer to the end of the string.

• StrEnd
– Returns a pointer to the end of a string.

• StrFmt
– Formats one or more values into a string.

• StrIComp
– Compares two strings without case sensitivity.

• StrLCat
– Concatenates two strings with a given maximum length of the resulting
string.
Pre-Made String Functions
• StrLComp
– Compares two strings for a given maximum length.

• StrLCopy
– Copies a string up to a given maximum length.

• StrLen
– Returns the length of a string.

• StrLFmt
– Formats one or more values into a string with a given maximum length.

• StrLIComp
– Compares two strings for a given maximum length without case sensitivity.

• StrLower
– Converts a string to lowercase.

• StrMove
– Moves a block of characters from one string to another.
Pre-Made String Functions
• StrNew
– Allocates a string on the heap.

• StrPCopy
– Copies a Pascal string to a null-terminated string.

• StrPLCopy
– Copies a Pascal string to a null-terminated string with a given maximum length.

• StrPos
– Returns a pointer to the first occurrence of a given substring within a string.

• StrRScan
– Returns a pointer to the last occurrence of a given character within a string.

• StrScan
– Returns a pointer to the first occurrence of a given character within a string.

• StrUpper
– Converts a string to uppercase.
Pre-Made String Functions
• What we need the most:
– String to integer
– Integer to string

: StrToInt()
: IntToStr()
Edit Prop.
•
•
•
•
•

No “Caption” Prop., “Text”.
PassWord
Visible, Enabled
Hint, ShowHint
Top, Left
Edit
• Text:“String” inner valued.
• Can be used as an input & output.
Var temp:integer;
Edit1.Text:= temp;
temp:= Edit1.Text;

// output
// input

• Have a supposition value (text Prop.).
– Can be changed.

• ReadOnly Prop.
Edit
• Can be used to contain other variables types.
• Input:
Var temp:integer;
temp:= StrToInt(Edit1.Text);

• Output:
Var temp:String;
Edit1.Text:= IntToStr(temp); //no need for -IntToStr-
CheckBox
a “boolean”
CheckBox Properties
•
•
•
•
•

Caption
“true OR false”
Can be used as a “boolean” input
“Checked” Prop.
Can be referenced to other “boolean” variable.
Crack the code
If (CheckBox1.Checked=true) then
Begin
// code
End
Else
if (CheckBox2.checked=true) then
Begin
// code
End
else
Begin
// code
End
x:=5;
If (CheckBox1.Checked=true) then
CheckBox1: Not Checked
Begin
CheckBox2: Checked
x:=10;
End
Else
if ((CheckBox1.Checked=false) and (CheckBox2.checked=false))
then
Begin
x:=11;
End;
x:=5;
If (CheckBox1.Checked=true) then
CheckBox1: Checked
Begin
CheckBox2: Checked
x:=10;
End
Else
if ((CheckBox1.Checked=true) and (CheckBox2.checked=true))
then
Begin
x:=11;
End;
x:=5;
CheckBox1: Checked
If (CheckBox1.Checked=true) then
CheckBox2: Not Checked
Begin
x:=10;
End
if ((CheckBox1.Checked=false) Or (CheckBox2.checked=false)) then
Begin
x:=11;
End;

x:=5;
CheckBox1: Not Checked
If (CheckBox1.Checked=false) then
CheckBox2: Checked
Begin
x:=10;
End
Else
if ((CheckBox1.Checked=true) Or (CheckBox2.checked=true)) then
Begin
x:=11;
End;
x:=5;
If (CheckBox1.Checked=true) then
CheckBox1: Not Checked
Begin
CheckBox2: Checked
x:=10;
End
Else
if ((CheckBox1.Checked=false) or (CheckBox2.checked=false))
then
Begin
x:=11;
End;

x:=5;
If (CheckBox1.Checked=true) then
Begin
x:=10;
End
Else
if

CheckBox1: Not Checked
CheckBox2: Not Checked

((CheckBox1.Checked=true)or(CheckBox2.checked=not(CheckBox1.Checked)))
then
Begin
x:=11;
End;
Crack the code
x:=5;
If (CheckBox1.Checked=true) then
Begin
x:=10;
End;
Else
if (CheckBox2.Checked=true) then
Begin
x:=11;
End;

CheckBox1: Not Checked
CheckBox2: Not Checked
Var Bool1,Bool2: boolean;
Begin
Bool1: = CheckBox1.Checked; Bool2:-=false;
If (Bool1=true) then
Begin
// your code
End
Else
if (Bool2=not(true)) then
Begin
//your code
End
else
Begin
//your code
End
End;
Var Bool1,Bool2: boolean; x:integer;
Begin
CheckBox1: Not Checked
x:=5;
Bool1: = CheckBox1.Checked; Bool2:-=false;
If (Bool1=true) then
Begin
x:=3;
End
Else
if (Bool2=not(true)) then
Begin
x:=x+1;
End
End;

Var Bool1,Bool2: boolean; x:integer;
Begin
x:=5;
Bool1: = CheckBox1.Checked; Bool2:-=true;
If (Bool1=Bool2) then
Begin
x:=3;
End
if (Bool2=not(not(Bool1)) then
Begin
x:=x+1;
End
End;

CheckBox1: Checked
ListBox
ListBox
ListBox Prop.
• Properties:
– Sorted:
• If “true”, sorted in ascending order, default false

– Items:
• Items.add > (String)
• Items.string > [index] > (String)

– ItemIndex:
• ItemIndex > Return selected index [] > (Integer)
• No “ItemIndex” change at Design time

– Columns:
• Multiple “column”s in ListBox if greater than Zero “0”.

– MultiSelect:
• Enables “multiselect” to be “selected” if “true”, default “false”.

– “Auto” ScrollBar
ListBox example
procedure TForm2.Button1Click(Sender: TObject);
var x:integer; s:string;
begin
//Items
ListBox1.Items.Add('hehe');
//String
s:=ListBox1.Items.Strings[0];
Label1.caption:=s;

//ItemIndex
x:=ListBox1.ItemIndex;
Label2.caption:=inttostr(x);
end;
ComboBox
ComboBox
• Look like “ListBox”, but it’s a one “Choice at a time” one.
– No “MultiSelect” Prop.
ComboBox Prop.
• Properties:
– Text
• Text > (string) like a “caption” for “ComboBox”

– Items
• The available “option”s for user.
• Items.add > (String)
• Items.string > [index] > (String)

// func. Runtime
// func. Runtime

– ItemIndex
• ItemIndex > Return selected index [] > (Integer)
• “ItemIndex” changable at Design time , in contrary to “ListBox”

– Sorted:
• If “true”, sorted in ascending order, default false
ComboBox Event
• Most important: Onchange
• Code: let’s “just” change the option “3” times.
ComboBox – Code example
procedure TForm2.ComboBox1Change(Sender: TObject);
begin
memo1.lines.add('krkrkrkr');
end;
//Now let us add this new block of code on Button1Click
procedure TForm2.Button1Click(Sender: TObject);
var x:integer; s:string;
begin
if ComboBox1.ItemIndex=0 then
memo1.Lines.Add('You chose English')
else
begin
if ComboBox1.ItemIndex=1 then
memo1.Lines.Add('You chose Arabic')
else
begin
if ComboBox1.ItemIndex=2 then
memo1.Lines.Add('You chose German')
else
if ComboBox1.ItemIndex=3 then
memo1.Lines.Add('You chose French');
end;
end;
end;
ComboBox – Code example
• Now, what is the output on “Memo1” (Just Think it as if it’s a
Multi-Lines “Edit”) that can show just 5 lines, without a
scrollbar, when we choose 3 options (Arabic, German, French)
in row, and clicking the button after each choice?
• Think Think Think.
RadioButton
RadioButton
• What it looks like?
• It’s like when we choose the ages, languages,
– example
– It’s represent “constant values” for one “variables”

• So it’s like CheckBox that we learned but with a key
difference.
Components

Radio Button
RadioButton - Differences
• Let’s have 3 CheckBox & 3 Radio buttons.
CheckBox

RadioButton

We can select all 3
(one or more)

We can’t select all 3
(just one of them)

Not connected with each other

Connected with each other
RadioButton - Example
•

Remember that only one option can be chosen at a time

Block of code
Block of code
Block of code
Block of code
Many ways to “CRACK” the restriction
• GroupBox
• RadioGroup
• Panel
RadioGroup
simplifies the task of grouping radio buttons
RadioGroup Prop.
• Item:
– Numbers of option in the “RadioGroup” depends on “item” Prop.
– each string in “item” makes a radio button appears in the group box
with string as its “caption”.

• ItemIndex:
– determines which “RadioButton” is currently selected.
• It’s which we’ll deal with in code in “Runtime”.

• Column:
– Display the radio buttons in a single column or in multiple columns.
RadioGroup Prop.
No “Checked” Prop., It’s “ItemIndex”
Live example.
RadioGroup Prop.
procedure TForm1.NextClick(Sender: TObject);
begin
ShowMessage(RadioGroup1.Items.Strings[RadioGroup1.ItemIndex]
+ ' with Index '
+ IntToStr(RadioGroup1.ItemIndex));
end;
GroupBox
GroupBox
• What it looks like?
• Its main function is to arrange all the related “control”s in
the “form”.
• The most known related “control” is “RadioGroup” as we have
seen.
• “Caption” Prop. Labels the GroupBox
• Remember “cut & paste” method.
Adding component to GroupBox
• Tool Pallete > Choose what you want to add
– Place it in the “GroupBox”

• Now you can deal with your GroupBox as a complete block
that contains related “control”s
See you!

More Related Content

What's hot

Python Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard WayPython Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard Way
Utkarsh Sengar
 
Intro to Functions Python
Intro to Functions PythonIntro to Functions Python
Intro to Functions Python
primeteacher32
 
Python for Beginners(v1)
Python for Beginners(v1)Python for Beginners(v1)
Python for Beginners(v1)
Panimalar Engineering College
 
Programming in Computational Biology
Programming in Computational BiologyProgramming in Computational Biology
Programming in Computational BiologyAtreyiB
 
Introduction to Kotlin for Android developers
Introduction to Kotlin for Android developersIntroduction to Kotlin for Android developers
Introduction to Kotlin for Android developers
Mohamed Wael
 
Elixir
ElixirElixir
Strings in python
Strings in pythonStrings in python
Strings in python
Prabhakaran V M
 
Python1
Python1Python1
2016 bioinformatics i_python_part_1_wim_vancriekinge
2016 bioinformatics i_python_part_1_wim_vancriekinge2016 bioinformatics i_python_part_1_wim_vancriekinge
2016 bioinformatics i_python_part_1_wim_vancriekinge
Prof. Wim Van Criekinge
 
Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An Introduction
Eueung Mulyana
 
Learn 90% of Python in 90 Minutes
Learn 90% of Python in 90 MinutesLearn 90% of Python in 90 Minutes
Learn 90% of Python in 90 Minutes
Matt Harrison
 
Introduction to the basics of Python programming (part 3)
Introduction to the basics of Python programming (part 3)Introduction to the basics of Python programming (part 3)
Introduction to the basics of Python programming (part 3)
Pedro Rodrigues
 
4 b file-io-if-then-else
4 b file-io-if-then-else4 b file-io-if-then-else
4 b file-io-if-then-elseMalik Alig
 
Python 101++: Let's Get Down to Business!
Python 101++: Let's Get Down to Business!Python 101++: Let's Get Down to Business!
Python 101++: Let's Get Down to Business!
Paige Bailey
 
4. python functions
4. python   functions4. python   functions
4. python functions
in4400
 
Python Workshop
Python WorkshopPython Workshop
Python Workshop
Saket Choudhary
 
An Intro to Python in 30 minutes
An Intro to Python in 30 minutesAn Intro to Python in 30 minutes
An Intro to Python in 30 minutes
Sumit Raj
 
Memory Management In Python The Basics
Memory Management In Python The BasicsMemory Management In Python The Basics
Memory Management In Python The Basics
Nina Zakharenko
 
Introduction to advanced python
Introduction to advanced pythonIntroduction to advanced python
Introduction to advanced python
Charles-Axel Dein
 

What's hot (20)

Python Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard WayPython Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard Way
 
Intro to Functions Python
Intro to Functions PythonIntro to Functions Python
Intro to Functions Python
 
Python for Beginners(v1)
Python for Beginners(v1)Python for Beginners(v1)
Python for Beginners(v1)
 
Programming in Computational Biology
Programming in Computational BiologyProgramming in Computational Biology
Programming in Computational Biology
 
Introduction to Kotlin for Android developers
Introduction to Kotlin for Android developersIntroduction to Kotlin for Android developers
Introduction to Kotlin for Android developers
 
Elixir
ElixirElixir
Elixir
 
Strings in python
Strings in pythonStrings in python
Strings in python
 
Python1
Python1Python1
Python1
 
2016 bioinformatics i_python_part_1_wim_vancriekinge
2016 bioinformatics i_python_part_1_wim_vancriekinge2016 bioinformatics i_python_part_1_wim_vancriekinge
2016 bioinformatics i_python_part_1_wim_vancriekinge
 
Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An Introduction
 
Learn 90% of Python in 90 Minutes
Learn 90% of Python in 90 MinutesLearn 90% of Python in 90 Minutes
Learn 90% of Python in 90 Minutes
 
Introduction to the basics of Python programming (part 3)
Introduction to the basics of Python programming (part 3)Introduction to the basics of Python programming (part 3)
Introduction to the basics of Python programming (part 3)
 
4 b file-io-if-then-else
4 b file-io-if-then-else4 b file-io-if-then-else
4 b file-io-if-then-else
 
Python 101++: Let's Get Down to Business!
Python 101++: Let's Get Down to Business!Python 101++: Let's Get Down to Business!
Python 101++: Let's Get Down to Business!
 
4. python functions
4. python   functions4. python   functions
4. python functions
 
Python Workshop
Python WorkshopPython Workshop
Python Workshop
 
python.ppt
python.pptpython.ppt
python.ppt
 
An Intro to Python in 30 minutes
An Intro to Python in 30 minutesAn Intro to Python in 30 minutes
An Intro to Python in 30 minutes
 
Memory Management In Python The Basics
Memory Management In Python The BasicsMemory Management In Python The Basics
Memory Management In Python The Basics
 
Introduction to advanced python
Introduction to advanced pythonIntroduction to advanced python
Introduction to advanced python
 

Viewers also liked

C# Starter L07-Objects Cloning
C# Starter L07-Objects CloningC# Starter L07-Objects Cloning
C# Starter L07-Objects Cloning
Mohammad Shaker
 
C# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASPC# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASP
Mohammad Shaker
 
Utilizing Kinect Control for a More Immersive Interaction with 3D Environment
Utilizing Kinect Control for a More Immersive Interaction with 3D EnvironmentUtilizing Kinect Control for a More Immersive Interaction with 3D Environment
Utilizing Kinect Control for a More Immersive Interaction with 3D Environment
Mohammad Shaker
 
XNA L10–Shaders Part 1
XNA L10–Shaders Part 1XNA L10–Shaders Part 1
XNA L10–Shaders Part 1Mohammad Shaker
 
XNA L11–Shaders Part 2
XNA L11–Shaders Part 2XNA L11–Shaders Part 2
XNA L11–Shaders Part 2Mohammad Shaker
 
Indie Series 03: Becoming an Indie
Indie Series 03: Becoming an IndieIndie Series 03: Becoming an Indie
Indie Series 03: Becoming an Indie
Mohammad Shaker
 
WPF L03-3D Rendering and 3D Animation
WPF L03-3D Rendering and 3D AnimationWPF L03-3D Rendering and 3D Animation
WPF L03-3D Rendering and 3D AnimationMohammad Shaker
 
Android L01 - Warm Up
Android L01 - Warm UpAndroid L01 - Warm Up
Android L01 - Warm Up
Mohammad Shaker
 
C# Advanced L10-Workflow Foundation
C# Advanced L10-Workflow FoundationC# Advanced L10-Workflow Foundation
C# Advanced L10-Workflow Foundation
Mohammad Shaker
 
WPF L01-Layouts, Controls, Styles and Templates
WPF L01-Layouts, Controls, Styles and TemplatesWPF L01-Layouts, Controls, Styles and Templates
WPF L01-Layouts, Controls, Styles and TemplatesMohammad Shaker
 
Interaction Design L06 - Tricks with Psychology
Interaction Design L06 - Tricks with PsychologyInteraction Design L06 - Tricks with Psychology
Interaction Design L06 - Tricks with Psychology
Mohammad Shaker
 
C# Advanced L08-Networking+WCF
C# Advanced L08-Networking+WCFC# Advanced L08-Networking+WCF
C# Advanced L08-Networking+WCF
Mohammad Shaker
 
Short, Matters, Love - Passioneers Event 2015
Short, Matters, Love -  Passioneers Event 2015Short, Matters, Love -  Passioneers Event 2015
Short, Matters, Love - Passioneers Event 2015
Mohammad Shaker
 
C# Starter L06-Delegates, Event Handling and Extension Methods
C# Starter L06-Delegates, Event Handling and Extension MethodsC# Starter L06-Delegates, Event Handling and Extension Methods
C# Starter L06-Delegates, Event Handling and Extension Methods
Mohammad Shaker
 
Car Dynamics with ABS, ESP and GPS Systems
Car Dynamics with ABS, ESP and GPS SystemsCar Dynamics with ABS, ESP and GPS Systems
Car Dynamics with ABS, ESP and GPS Systems
Mohammad Shaker
 
OpenGL Starter L02
OpenGL Starter L02OpenGL Starter L02
OpenGL Starter L02
Mohammad Shaker
 
XNA L02–Basic Matrices and Transformations
XNA L02–Basic Matrices and TransformationsXNA L02–Basic Matrices and Transformations
XNA L02–Basic Matrices and TransformationsMohammad Shaker
 
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]
Mohammad Shaker
 

Viewers also liked (18)

C# Starter L07-Objects Cloning
C# Starter L07-Objects CloningC# Starter L07-Objects Cloning
C# Starter L07-Objects Cloning
 
C# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASPC# Advanced L09-HTML5+ASP
C# Advanced L09-HTML5+ASP
 
Utilizing Kinect Control for a More Immersive Interaction with 3D Environment
Utilizing Kinect Control for a More Immersive Interaction with 3D EnvironmentUtilizing Kinect Control for a More Immersive Interaction with 3D Environment
Utilizing Kinect Control for a More Immersive Interaction with 3D Environment
 
XNA L10–Shaders Part 1
XNA L10–Shaders Part 1XNA L10–Shaders Part 1
XNA L10–Shaders Part 1
 
XNA L11–Shaders Part 2
XNA L11–Shaders Part 2XNA L11–Shaders Part 2
XNA L11–Shaders Part 2
 
Indie Series 03: Becoming an Indie
Indie Series 03: Becoming an IndieIndie Series 03: Becoming an Indie
Indie Series 03: Becoming an Indie
 
WPF L03-3D Rendering and 3D Animation
WPF L03-3D Rendering and 3D AnimationWPF L03-3D Rendering and 3D Animation
WPF L03-3D Rendering and 3D Animation
 
Android L01 - Warm Up
Android L01 - Warm UpAndroid L01 - Warm Up
Android L01 - Warm Up
 
C# Advanced L10-Workflow Foundation
C# Advanced L10-Workflow FoundationC# Advanced L10-Workflow Foundation
C# Advanced L10-Workflow Foundation
 
WPF L01-Layouts, Controls, Styles and Templates
WPF L01-Layouts, Controls, Styles and TemplatesWPF L01-Layouts, Controls, Styles and Templates
WPF L01-Layouts, Controls, Styles and Templates
 
Interaction Design L06 - Tricks with Psychology
Interaction Design L06 - Tricks with PsychologyInteraction Design L06 - Tricks with Psychology
Interaction Design L06 - Tricks with Psychology
 
C# Advanced L08-Networking+WCF
C# Advanced L08-Networking+WCFC# Advanced L08-Networking+WCF
C# Advanced L08-Networking+WCF
 
Short, Matters, Love - Passioneers Event 2015
Short, Matters, Love -  Passioneers Event 2015Short, Matters, Love -  Passioneers Event 2015
Short, Matters, Love - Passioneers Event 2015
 
C# Starter L06-Delegates, Event Handling and Extension Methods
C# Starter L06-Delegates, Event Handling and Extension MethodsC# Starter L06-Delegates, Event Handling and Extension Methods
C# Starter L06-Delegates, Event Handling and Extension Methods
 
Car Dynamics with ABS, ESP and GPS Systems
Car Dynamics with ABS, ESP and GPS SystemsCar Dynamics with ABS, ESP and GPS Systems
Car Dynamics with ABS, ESP and GPS Systems
 
OpenGL Starter L02
OpenGL Starter L02OpenGL Starter L02
OpenGL Starter L02
 
XNA L02–Basic Matrices and Transformations
XNA L02–Basic Matrices and TransformationsXNA L02–Basic Matrices and Transformations
XNA L02–Basic Matrices and Transformations
 
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]
 

Similar to Delphi L02 Controls P1

Python first day
Python first dayPython first day
Python first day
MARISSTELLA2
 
Python first day
Python first dayPython first day
Python first day
farkhand
 
Q-Step_WS_02102019_Practical_introduction_to_Python.pdf
Q-Step_WS_02102019_Practical_introduction_to_Python.pdfQ-Step_WS_02102019_Practical_introduction_to_Python.pdf
Q-Step_WS_02102019_Practical_introduction_to_Python.pdf
Michpice
 
Acm aleppo cpc training ninth session
Acm aleppo cpc training ninth sessionAcm aleppo cpc training ninth session
Acm aleppo cpc training ninth session
Ahmad Bashar Eter
 
IoT-Week1-Day1-Lab.pptx
IoT-Week1-Day1-Lab.pptxIoT-Week1-Day1-Lab.pptx
IoT-Week1-Day1-Lab.pptx
afsheenfaiq2
 
python1.ppt
python1.pptpython1.ppt
python1.ppt
ALOK52916
 
python1.ppt
python1.pptpython1.ppt
python1.ppt
VishwasKumar58
 
Python Basics
Python BasicsPython Basics
Python Basics
MobeenAhmed25
 
python1.ppt
python1.pptpython1.ppt
python1.ppt
RajPurohit33
 
Lenguaje Python
Lenguaje PythonLenguaje Python
Lenguaje Python
RalAnteloJurado
 
Learn Python in Three Hours - Presentation
Learn Python in Three Hours - PresentationLearn Python in Three Hours - Presentation
Learn Python in Three Hours - Presentation
Naseer-ul-Hassan Rehman
 
pysdasdasdsadsadsadsadsadsadasdasdthon1.ppt
pysdasdasdsadsadsadsadsadsadasdasdthon1.pptpysdasdasdsadsadsadsadsadsadasdasdthon1.ppt
pysdasdasdsadsadsadsadsadsadasdasdthon1.ppt
kashifmajeedjanjua
 
coolstuff.ppt
coolstuff.pptcoolstuff.ppt
coolstuff.ppt
GeorgePama1
 
python1.ppt
python1.pptpython1.ppt
python1.ppt
SATHYANARAYANAKB
 
Introductio_to_python_progamming_ppt.ppt
Introductio_to_python_progamming_ppt.pptIntroductio_to_python_progamming_ppt.ppt
Introductio_to_python_progamming_ppt.ppt
HiralPatel798996
 
python1.ppt
python1.pptpython1.ppt
python1.ppt
RedenOriola
 
python1.ppt
python1.pptpython1.ppt
python1.ppt
AshokRachapalli1
 
python1.ppt
python1.pptpython1.ppt
python1.ppt
JemuelPinongcos1
 
Introduction to Python for Bioinformatics
Introduction to Python for BioinformaticsIntroduction to Python for Bioinformatics
Introduction to Python for Bioinformatics
José Héctor Gálvez
 

Similar to Delphi L02 Controls P1 (20)

Python first day
Python first dayPython first day
Python first day
 
Python first day
Python first dayPython first day
Python first day
 
Q-Step_WS_02102019_Practical_introduction_to_Python.pdf
Q-Step_WS_02102019_Practical_introduction_to_Python.pdfQ-Step_WS_02102019_Practical_introduction_to_Python.pdf
Q-Step_WS_02102019_Practical_introduction_to_Python.pdf
 
Acm aleppo cpc training ninth session
Acm aleppo cpc training ninth sessionAcm aleppo cpc training ninth session
Acm aleppo cpc training ninth session
 
IoT-Week1-Day1-Lab.pptx
IoT-Week1-Day1-Lab.pptxIoT-Week1-Day1-Lab.pptx
IoT-Week1-Day1-Lab.pptx
 
python1.ppt
python1.pptpython1.ppt
python1.ppt
 
python1.ppt
python1.pptpython1.ppt
python1.ppt
 
Python Basics
Python BasicsPython Basics
Python Basics
 
python1.ppt
python1.pptpython1.ppt
python1.ppt
 
Lenguaje Python
Lenguaje PythonLenguaje Python
Lenguaje Python
 
Learn Python in Three Hours - Presentation
Learn Python in Three Hours - PresentationLearn Python in Three Hours - Presentation
Learn Python in Three Hours - Presentation
 
pysdasdasdsadsadsadsadsadsadasdasdthon1.ppt
pysdasdasdsadsadsadsadsadsadasdasdthon1.pptpysdasdasdsadsadsadsadsadsadasdasdthon1.ppt
pysdasdasdsadsadsadsadsadsadasdasdthon1.ppt
 
coolstuff.ppt
coolstuff.pptcoolstuff.ppt
coolstuff.ppt
 
python1.ppt
python1.pptpython1.ppt
python1.ppt
 
Introductio_to_python_progamming_ppt.ppt
Introductio_to_python_progamming_ppt.pptIntroductio_to_python_progamming_ppt.ppt
Introductio_to_python_progamming_ppt.ppt
 
python1.ppt
python1.pptpython1.ppt
python1.ppt
 
python1.ppt
python1.pptpython1.ppt
python1.ppt
 
python1.ppt
python1.pptpython1.ppt
python1.ppt
 
Introduction to Python for Bioinformatics
Introduction to Python for BioinformaticsIntroduction to Python for Bioinformatics
Introduction to Python for Bioinformatics
 
ENGLISH PYTHON.ppt
ENGLISH PYTHON.pptENGLISH PYTHON.ppt
ENGLISH PYTHON.ppt
 

More from Mohammad Shaker

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
Mohammad Shaker
 
Unity L01 - Game Development
Unity L01 - Game DevelopmentUnity L01 - Game Development
Unity L01 - Game Development
Mohammad Shaker
 
Android L07 - Touch, Screen and Wearables
Android L07 - Touch, Screen and WearablesAndroid L07 - Touch, Screen and Wearables
Android L07 - Touch, Screen and Wearables
Mohammad Shaker
 
Interaction Design L03 - Color
Interaction Design L03 - ColorInteraction Design L03 - Color
Interaction Design L03 - Color
Mohammad Shaker
 
Interaction Design L05 - Typography
Interaction Design L05 - TypographyInteraction Design L05 - Typography
Interaction Design L05 - Typography
Mohammad Shaker
 
Interaction Design L04 - Materialise and Coupling
Interaction Design L04 - Materialise and CouplingInteraction Design L04 - Materialise and Coupling
Interaction Design L04 - Materialise and Coupling
Mohammad Shaker
 
Android L05 - Storage
Android L05 - StorageAndroid L05 - Storage
Android L05 - Storage
Mohammad Shaker
 
Android L04 - Notifications and Threading
Android L04 - Notifications and ThreadingAndroid L04 - Notifications and Threading
Android L04 - Notifications and Threading
Mohammad Shaker
 
Android L09 - Windows Phone and iOS
Android L09 - Windows Phone and iOSAndroid L09 - Windows Phone and iOS
Android L09 - Windows Phone and iOS
Mohammad Shaker
 
Interaction Design L01 - Mobile Constraints
Interaction Design L01 - Mobile ConstraintsInteraction Design L01 - Mobile Constraints
Interaction Design L01 - Mobile Constraints
Mohammad Shaker
 
Interaction Design L02 - Pragnanz and Grids
Interaction Design L02 - Pragnanz and GridsInteraction Design L02 - Pragnanz and Grids
Interaction Design L02 - Pragnanz and Grids
Mohammad Shaker
 
Android L10 - Stores and Gaming
Android L10 - Stores and GamingAndroid L10 - Stores and Gaming
Android L10 - Stores and Gaming
Mohammad Shaker
 
Android L06 - Cloud / Parse
Android L06 - Cloud / ParseAndroid L06 - Cloud / Parse
Android L06 - Cloud / Parse
Mohammad Shaker
 
Android L08 - Google Maps and Utilities
Android L08 - Google Maps and UtilitiesAndroid L08 - Google Maps and Utilities
Android L08 - Google Maps and Utilities
Mohammad Shaker
 
Android L03 - Styles and Themes
Android L03 - Styles and Themes Android L03 - Styles and Themes
Android L03 - Styles and Themes
Mohammad Shaker
 
Android L02 - Activities and Adapters
Android L02 - Activities and AdaptersAndroid L02 - Activities and Adapters
Android L02 - Activities and Adapters
Mohammad Shaker
 
Indie Series 01: Intro to Games
Indie Series 01: Intro to GamesIndie Series 01: Intro to Games
Indie Series 01: Intro to Games
Mohammad Shaker
 
Indie Series 04: The Making of SyncSeven
Indie Series 04: The Making of SyncSevenIndie Series 04: The Making of SyncSeven
Indie Series 04: The Making of SyncSeven
Mohammad Shaker
 
Indie Series 02: AI and Recent Advances in Games
Indie Series 02: AI and Recent Advances in GamesIndie Series 02: AI and Recent Advances in Games
Indie Series 02: AI and Recent Advances in Games
Mohammad Shaker
 
Roboconf DSL Advanced Software Engineering
Roboconf DSL Advanced Software EngineeringRoboconf DSL Advanced Software Engineering
Roboconf DSL Advanced Software Engineering
Mohammad Shaker
 

More from 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
 
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
 
Indie Series 01: Intro to Games
Indie Series 01: Intro to GamesIndie Series 01: Intro to Games
Indie Series 01: Intro to Games
 
Indie Series 04: The Making of SyncSeven
Indie Series 04: The Making of SyncSevenIndie Series 04: The Making of SyncSeven
Indie Series 04: The Making of SyncSeven
 
Indie Series 02: AI and Recent Advances in Games
Indie Series 02: AI and Recent Advances in GamesIndie Series 02: AI and Recent Advances in Games
Indie Series 02: AI and Recent Advances in Games
 
Roboconf DSL Advanced Software Engineering
Roboconf DSL Advanced Software EngineeringRoboconf DSL Advanced Software Engineering
Roboconf DSL Advanced Software Engineering
 

Recently uploaded

PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 

Recently uploaded (20)

PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 

Delphi L02 Controls P1

  • 1. Intro to Event-driven Programming and Forms with Delphi L02 – Controls P1 Mohammad Shaker mohammadshakergtr.wordpress.com Intro to Event-driven Programming and Forms with Delphi @ZGTRShaker 2010, 2011, 2012
  • 2.
  • 5. General ‘Info’s & Tips • Don’t forget the CTRL+Space auto-completion – CTRL+Space: code in-sightauto-completion. • You can’t write in Arabic in a component’s “NAME”. • Delphi is a not a “Case Sensitive ” language. • dpr *: when saving, the project you have will be saved as a ‘dpr’ termination. *dpr: Delphi Project
  • 6. Runtime • Form the upper bar > Run > Run. • Form the button in the upper bar. • Or F9
  • 7. Sth to Remember • Differentiate between Visible & Enabled in Component’s properties. • Differentiate between Name & Caption in Component’s properties. • F9: RUN. • F9+CTRL: Compile.
  • 8. Changing your “.exe” icon • “.ico” files extension • Project > Options > Application > Load Icon • It appears in the upper left corner of the application form
  • 9. Chase the button Exercise Do it & enjoy catching it :D
  • 10. Label
  • 12. Label • Is an Info • It can be used as an output as a “String” • “caption” manipulating. Label1.caption:= ‘Hello World’; String & only String
  • 13. Edit
  • 15. Pre-Made String Functions • StrAlloc – Allocates a character buffer of a given size on the heap. • StrBufSize – Returns the size of a character buffer allocated using StrAlloc or StrNew. • StrCat – Concatenates two strings. • StrComp – Compares two strings. • StrCopy – Copies a string.
  • 16. Pre-Made String Functions • StrDispose – Disposes a character buffer allocated using StrAlloc or StrNew. • StrECopy – Copies a string and returns a pointer to the end of the string. • StrEnd – Returns a pointer to the end of a string. • StrFmt – Formats one or more values into a string. • StrIComp – Compares two strings without case sensitivity. • StrLCat – Concatenates two strings with a given maximum length of the resulting string.
  • 17. Pre-Made String Functions • StrLComp – Compares two strings for a given maximum length. • StrLCopy – Copies a string up to a given maximum length. • StrLen – Returns the length of a string. • StrLFmt – Formats one or more values into a string with a given maximum length. • StrLIComp – Compares two strings for a given maximum length without case sensitivity. • StrLower – Converts a string to lowercase. • StrMove – Moves a block of characters from one string to another.
  • 18. Pre-Made String Functions • StrNew – Allocates a string on the heap. • StrPCopy – Copies a Pascal string to a null-terminated string. • StrPLCopy – Copies a Pascal string to a null-terminated string with a given maximum length. • StrPos – Returns a pointer to the first occurrence of a given substring within a string. • StrRScan – Returns a pointer to the last occurrence of a given character within a string. • StrScan – Returns a pointer to the first occurrence of a given character within a string. • StrUpper – Converts a string to uppercase.
  • 19. Pre-Made String Functions • What we need the most: – String to integer – Integer to string : StrToInt() : IntToStr()
  • 20. Edit Prop. • • • • • No “Caption” Prop., “Text”. PassWord Visible, Enabled Hint, ShowHint Top, Left
  • 21. Edit • Text:“String” inner valued. • Can be used as an input & output. Var temp:integer; Edit1.Text:= temp; temp:= Edit1.Text; // output // input • Have a supposition value (text Prop.). – Can be changed. • ReadOnly Prop.
  • 22. Edit • Can be used to contain other variables types. • Input: Var temp:integer; temp:= StrToInt(Edit1.Text); • Output: Var temp:String; Edit1.Text:= IntToStr(temp); //no need for -IntToStr-
  • 24. CheckBox Properties • • • • • Caption “true OR false” Can be used as a “boolean” input “Checked” Prop. Can be referenced to other “boolean” variable.
  • 25. Crack the code If (CheckBox1.Checked=true) then Begin // code End Else if (CheckBox2.checked=true) then Begin // code End else Begin // code End
  • 26. x:=5; If (CheckBox1.Checked=true) then CheckBox1: Not Checked Begin CheckBox2: Checked x:=10; End Else if ((CheckBox1.Checked=false) and (CheckBox2.checked=false)) then Begin x:=11; End; x:=5; If (CheckBox1.Checked=true) then CheckBox1: Checked Begin CheckBox2: Checked x:=10; End Else if ((CheckBox1.Checked=true) and (CheckBox2.checked=true)) then Begin x:=11; End;
  • 27. x:=5; CheckBox1: Checked If (CheckBox1.Checked=true) then CheckBox2: Not Checked Begin x:=10; End if ((CheckBox1.Checked=false) Or (CheckBox2.checked=false)) then Begin x:=11; End; x:=5; CheckBox1: Not Checked If (CheckBox1.Checked=false) then CheckBox2: Checked Begin x:=10; End Else if ((CheckBox1.Checked=true) Or (CheckBox2.checked=true)) then Begin x:=11; End;
  • 28. x:=5; If (CheckBox1.Checked=true) then CheckBox1: Not Checked Begin CheckBox2: Checked x:=10; End Else if ((CheckBox1.Checked=false) or (CheckBox2.checked=false)) then Begin x:=11; End; x:=5; If (CheckBox1.Checked=true) then Begin x:=10; End Else if CheckBox1: Not Checked CheckBox2: Not Checked ((CheckBox1.Checked=true)or(CheckBox2.checked=not(CheckBox1.Checked))) then Begin x:=11; End;
  • 29. Crack the code x:=5; If (CheckBox1.Checked=true) then Begin x:=10; End; Else if (CheckBox2.Checked=true) then Begin x:=11; End; CheckBox1: Not Checked CheckBox2: Not Checked
  • 30. Var Bool1,Bool2: boolean; Begin Bool1: = CheckBox1.Checked; Bool2:-=false; If (Bool1=true) then Begin // your code End Else if (Bool2=not(true)) then Begin //your code End else Begin //your code End End;
  • 31. Var Bool1,Bool2: boolean; x:integer; Begin CheckBox1: Not Checked x:=5; Bool1: = CheckBox1.Checked; Bool2:-=false; If (Bool1=true) then Begin x:=3; End Else if (Bool2=not(true)) then Begin x:=x+1; End End; Var Bool1,Bool2: boolean; x:integer; Begin x:=5; Bool1: = CheckBox1.Checked; Bool2:-=true; If (Bool1=Bool2) then Begin x:=3; End if (Bool2=not(not(Bool1)) then Begin x:=x+1; End End; CheckBox1: Checked
  • 34. ListBox Prop. • Properties: – Sorted: • If “true”, sorted in ascending order, default false – Items: • Items.add > (String) • Items.string > [index] > (String) – ItemIndex: • ItemIndex > Return selected index [] > (Integer) • No “ItemIndex” change at Design time – Columns: • Multiple “column”s in ListBox if greater than Zero “0”. – MultiSelect: • Enables “multiselect” to be “selected” if “true”, default “false”. – “Auto” ScrollBar
  • 35. ListBox example procedure TForm2.Button1Click(Sender: TObject); var x:integer; s:string; begin //Items ListBox1.Items.Add('hehe'); //String s:=ListBox1.Items.Strings[0]; Label1.caption:=s; //ItemIndex x:=ListBox1.ItemIndex; Label2.caption:=inttostr(x); end;
  • 37. ComboBox • Look like “ListBox”, but it’s a one “Choice at a time” one. – No “MultiSelect” Prop.
  • 38. ComboBox Prop. • Properties: – Text • Text > (string) like a “caption” for “ComboBox” – Items • The available “option”s for user. • Items.add > (String) • Items.string > [index] > (String) // func. Runtime // func. Runtime – ItemIndex • ItemIndex > Return selected index [] > (Integer) • “ItemIndex” changable at Design time , in contrary to “ListBox” – Sorted: • If “true”, sorted in ascending order, default false
  • 39. ComboBox Event • Most important: Onchange • Code: let’s “just” change the option “3” times.
  • 40. ComboBox – Code example procedure TForm2.ComboBox1Change(Sender: TObject); begin memo1.lines.add('krkrkrkr'); end;
  • 41. //Now let us add this new block of code on Button1Click procedure TForm2.Button1Click(Sender: TObject); var x:integer; s:string; begin if ComboBox1.ItemIndex=0 then memo1.Lines.Add('You chose English') else begin if ComboBox1.ItemIndex=1 then memo1.Lines.Add('You chose Arabic') else begin if ComboBox1.ItemIndex=2 then memo1.Lines.Add('You chose German') else if ComboBox1.ItemIndex=3 then memo1.Lines.Add('You chose French'); end; end; end;
  • 42. ComboBox – Code example • Now, what is the output on “Memo1” (Just Think it as if it’s a Multi-Lines “Edit”) that can show just 5 lines, without a scrollbar, when we choose 3 options (Arabic, German, French) in row, and clicking the button after each choice? • Think Think Think.
  • 44. RadioButton • What it looks like? • It’s like when we choose the ages, languages, – example – It’s represent “constant values” for one “variables” • So it’s like CheckBox that we learned but with a key difference.
  • 46. RadioButton - Differences • Let’s have 3 CheckBox & 3 Radio buttons. CheckBox RadioButton We can select all 3 (one or more) We can’t select all 3 (just one of them) Not connected with each other Connected with each other
  • 47. RadioButton - Example • Remember that only one option can be chosen at a time Block of code Block of code Block of code Block of code
  • 48. Many ways to “CRACK” the restriction • GroupBox • RadioGroup • Panel
  • 49. RadioGroup simplifies the task of grouping radio buttons
  • 50. RadioGroup Prop. • Item: – Numbers of option in the “RadioGroup” depends on “item” Prop. – each string in “item” makes a radio button appears in the group box with string as its “caption”. • ItemIndex: – determines which “RadioButton” is currently selected. • It’s which we’ll deal with in code in “Runtime”. • Column: – Display the radio buttons in a single column or in multiple columns.
  • 51. RadioGroup Prop. No “Checked” Prop., It’s “ItemIndex” Live example.
  • 52. RadioGroup Prop. procedure TForm1.NextClick(Sender: TObject); begin ShowMessage(RadioGroup1.Items.Strings[RadioGroup1.ItemIndex] + ' with Index ' + IntToStr(RadioGroup1.ItemIndex)); end;
  • 54. GroupBox • What it looks like? • Its main function is to arrange all the related “control”s in the “form”. • The most known related “control” is “RadioGroup” as we have seen. • “Caption” Prop. Labels the GroupBox • Remember “cut & paste” method.
  • 55. Adding component to GroupBox • Tool Pallete > Choose what you want to add – Place it in the “GroupBox” • Now you can deal with your GroupBox as a complete block that contains related “control”s