I have the following challenge.
I made a popup field that removes itself after a few seconds without user intervention.
However, I also want to prevent the user from clicking on any of the buttons during the presentation of the popup field.
I thought to solve this by creating a graphical layer below the popup field but this does not block a user's click on a button below.
What solution can I use to prevent users to click on buttons during the presentation of the popup field?
Here is the test code I made.
Code: Select all
//====================================================================================
// Show PopUp Message (by creating a temporary field and removing it)
//====================================================================================
command MessagePopUp tMessage, tShowTime, tBackgroundcolor, tTextColor
--- Checks ---
if tMessage = "" then put "No message!" into tMessage
if tShowTime = "" then put 3 into tShowTime
if tBackgroundcolor = "" then put "White" into tBackgroundcolor
if tTextColor = "" then put "White" into tTextColor
---
//lock screen
put "AutoPopUp" into tFieldName
if exists (field tFieldName) // Just to make sure it does not exist due to testing .
then
delete field tFieldName
end if
if exists (graphic tFieldName) // Just to make sure it does not exist due to testing .
then
delete graphic tFieldName
end if
----
create field tFieldName
create graphic tFieldName
set the visible of field tFieldName to false
---- Set Graphic criteria
set the rect of graphic tFieldName to the rect of this stack
set the opaque of graphic tFieldName to true
set blendLevel of graphic tFieldName to 50
set ink of graphic tFieldName to "blendSrcOver"
set the antialiased of graphic tFieldName to true
set the layer of graphic tFieldName to top
set the disabled of graphic tFieldName to true
---- Set Field criteria
put cr&tMessage&cr into field tFieldName
set the lockText of field tFieldName to true
set the opaque of field tFieldName to true
set borderwidth of field tFieldName to 2
set traversalon of field tFieldName to false
set showfocusborder of field tFieldName to true
set autotab of field tFieldName to false
set threeD of field tFieldName to true
set showborder of field tFieldName to true
set autohilite of field tFieldName to true
set listBehavior of field tFieldName to false
set multipleHilites of field tFieldName to false
set nonContiguousHilites of field tFieldName to false
set toggleHilites of field tFieldName to false
set the layer of field tFieldName to top
set the loc of field tFieldName to the loc of this card
set the backgroundColor of field tFieldName to tBackgroundcolor
set the foregroundColor of field tFieldName to tTextColor
//set textstyle of field tFieldName to "Bold" // Messesup the formattedWidth command
set the height of field tFieldName to the formattedHeight of field tFieldName
set the Width of field tFieldName to the formattedWidth of field tFieldName
-- Activate graphic and show field (PopUp)
//unlock screen
set the visible of graphic tFieldName to true
set the visible of field tFieldName to true
--
wait tShowTime seconds
set the visible of field tFieldName to false
--
delete field tFieldName
delete graphic tFieldName
--
end MessagePopUp
//====================================================================================