Posted on

What are four types of dialog boxes? Simple!

What are four types of dialog boxes?

What are four types of dialog boxes? There are many types of dialog boxes. While writing this article, there are 12 dialog related components within Lazarus. To make sure this article does not go too big so you die of boredom. Im splitting this into 4 parts. 4 dialogs per part! Now for a question to answer below….

What are Dialog Boxes? What are four types of dialog boxes? Explained below!

Lazarus and Delphi both have a whole lot of components that we can piece together to make software. There are many types of components that we will have to talk about. But the simplest of them are Dialog boxes. Dialog boxes are the menus that show up when you say save a file in note pad. When you save a file in notepad it will ask you to choose a place to put the file in.

That menu which helps you choose the place where you want to save a file is a Save Dialog. As such there are many dialogs in existence of Lazarus and Delphi. Combining some code, buttons and dialog boxes we can even make a copy of notepad!

What are four types of dialog boxes? Details Below!

There are quite a few types of Dialog Boxes. This might need me to split the contents of this article into 2 or 3 parts. But regardless, here are a few basic dialog boxes listed below.

The Open Dialog – Literal Opener Of Files

All components may or may not show how they look like when dragged and dropped on a Form. Some show their faces other do not. But they will show their face if you double click on them. Or use the Object Inspector to select them. In the case of dialogs, they do not show how they look like on first glance. Here is how a Open dialog looks like at first glance:

Open Dialog When Not Double Clicked On

and here is how it looks like when double clicked on:

The Open Dialog When Double Clicked On


So as you can see it looks different as compared to it’s other form. But like i told earlier with the TButton example, this won’t work or do anything. Think of it as putting down a empty box. It’s there but won’t do anything or have any use. Until you put some stuff inside it or lift it to carry more than 1 object at once.

Almost all components do not function as they seem so. For such we need to have to write code to tell it what to do. Same goes with all other dialogs. And that’s the one thing they share in common.

Off to the 2nd type of Dialogs!

The Save Dialog – Savior Of Many Files!

As i mentioned above, dialogs share one thing in common. That is that they do not show their face. Unless double clicked on after we drop them on a form.

So like that the Save Dialog also works the same way. Once dragged and dropped onto the form. It won’t do anything yet but once we write the code to bring it to life it’ll do it’s work fine.

Here is a image of the Save Dialog without double clicking it:

Save Dialog Without Double Clicking

And here is the Save Dialog when double clicked on like the Open dialog:

Save Dialog When Opened By Double Clicking

Their name should suggest their function. So i don’t need to go into much details on their function yet. But don’t worry if needed i’ll explain what they do in a future post. (That is if it’s already not clear for you, leave a comment to let me know i’ll help if i can!).

Onwards!

The Select Directory Dialog – Selector Of Files!

The joke at the start of these headlines is getting old ok. But anyways the next dialog we talk about is the Select Directory Dialog. As it’s name suggests “We use The Select Directory Dialog to select a folder for usage within a software.”

Here is how it looks like without getting double clicked on:

What are four 4 types of dialog boxes?
Select Directory Dialog Without Getting Clicked On

And here is how it looks like when double clicked on within the Lazarus form:

What are four 4 types of dialog boxes?
Select Directory Dialog When Double Clicked On

Onwards to the final dialog type for this post!

The Color Dialog – Bringing Color To Blank Pages!

The color dialog is a very common dialog. It’s found in MS paint. Or even other paint softwares. “We can use the color dialog to select a specific color via the color wheel, color boxes. Or color codes”.

Here is how it looks like without getting double clicked on:

What are four 4 types of dialog boxes?
The Color Dialog Without Getting Double Clicked On

and here is what it looks like when double clicked on:

What are four 4 types of dialog boxes?
The color dialog when double clicked on

I will discuss more dialogs in further parts of this article. Stay tuned for more memes- i mean coding content. And see you in the next post! Thanks a lot for reading!