How to make a pop up using containers
We start by using a normal container and these parameters like this
x=0 y=0 Width=Parent.Width Height=Parent.Height this way wherever we use this popup it will take the whole container being used and will be dynamic. Set the fill color to RGBA (0, 0, 0, 0.1) this will make it a faded grey color
We start designing the popup
Since will just add the message and the close button, we will add a label for the message and a close button.
The parameters of the label are as shown below
this will make the text size dynamic related to the size of the popup
this will make the label position itself in the middle by just positioning it at 40
this way no matter what width the pop up is the label will always be in the middle
same goes for the height but we will position it at 20 since 30 px will be used by the close label
The text on the label will be set to a variable but since it is not initialized yet it will show an error which is fine
As for the close label we will position it at 20 words above the bottom line using this command
y Parent.Height-Self.Height-20 / x Parent.Width-Self.Width-40
Here is the on select event for the close label
Now we proceed to prepare the place we are going to use the popup at. we just set the container where it will appear. The container will have a visible attribute of the PopUp variable value so if the value is gonna be false it will not show the popup
as for the button here is the on select event
same is for the warning button
this event will appear the popup and add the text tot he label this approach is good cuz all we have to do later on is use the popup created and just update the label text variable such as we do in this situation
Here’s the example of the to events: