Table of Contents
What are four types of dialogs?
What are four types of dialogs? In the last article i discussed about the following types of dialog boxes:
- The Open Dialog
- The Save Dialog
- The Save Directory Dialog
- The Color Dialog
All of these were the basic few dialog boxes we discussed in the last post. But keep this in mind:
“Almost all components of Lazarus and Delphi are just empty shells. They will not execute any action untill we code them to so.”
The sentence above applies to dialogs too. All dialogs will only work if you add the code to make them work. Dialogs cannot function alone. Because if you put a dialog in the Form. And then run the code. All you will see is a empty form. Nothing more.
That is because the Dialog Box has been placed within the Form. But it does not know what to do or how to even show it’s face. To make it show it’s face we have to use other components. Like TButtons with it but thats for a later post!.
For now we discuss 4 more types of dialog boxes to continue our series on this. This is part 2 of our series on dialog boxes. Let’s begin!
Where we left off
In the last post i discussed the usage of the 4 basic dialog boxes. There are 12 dialog boxes in the Lazarus IDE. So i splitted the contents of the article in 4 parts. This is part 2 of the dialog boxes. Let’s begin!
New Dialogs To Learn Below!
The Font Dialog – To Bring Spice To Barren Text!
The font dialog if double clicked on without running the code. Will open up the font menu. Here you can change to font of the text. However, just like all other dialogs. It will not change the font of the text even if you use the dialog to do it. It will only change the font if we first write the code to make it do so.
Here is how it looks like without being double clicked on:
And here is how it looks like when double clicked on without running the code:
It’s a simple dialog and it is also what we can use to make a copy of notepad! Onwards to the next dialog!
The Find Dialog – Our Text Finder!
The Find Dialog is what we can use in softwares such as Notepad to find a specific piece of text. It is incredibly simple and easy to use. But like all other dialogs. This will not work either for the time being. Again we have to first write down the code for it and then it will work. But for now, keep it’s function in mind.
Here is how the Find Dialog looks like when we drag and drop it onto the form. And neither double click it or run the code:
and here is a picture of how it looks like when put on the form, and double clicked without running the code:
For those of you worried on how to use it. Do not worry once the general concept of dialogs is completed in these articles. I’ll move on to their usage. And even to the code we can use to make them work. For now onwards to the next dialog!
The Replace Dialog – Replacements For All!
The Replace Dialog is also another dialog used within the notepad application. It is an important feature of notepad. Used to find and then replace specific pieces of text. It has a simple and basic but important function. But as repeated before, it won’t work just yet. We first need to write the code to make it work, but we do that stuff later. Here is how it looks like without being ran or double clicked on:
And here is how it will look like after double clicking:
Now off we go to the final dialog for this part of the related article.
The Open Image Dialog – Picture Viewing!
This is a simple to use dialog. As it’s name suggests, once activated this dialog will open a screen to select a Image file. This file is then used by a software of sorts. Here is how it looks like without being ran or double clicked on:
And here is how it looks like after being double clicked on but not run as code:
That about concludes this part 2 of my article on dialog boxes of Lazarus. The next few dialog boxes might be a tad bit complicated for some. But i’ll explain it so no need to panic just yet. Stay tuned for more posts, See you next post! and thanks for reading.