popup button losing focus after Ask dialog
Posted: Fri Oct 29, 2021 11:31 am
I have a group that acts as a Popup button, both for desktop and mobile. It is invisible and acts only if the button is kept down for 4 seconds.
I use it in order to access a secret debug card that the users should not be allowed in.
The group is transparent and it is made with 2 buttons, "BtnDebug" and a invisible "DebugPop".
It works fine. Below, find the code.
I decided to add a password check (ask password) and I noticed that now on desktop it trows an error on the line "popup tLongPop", but only if i move the mouse to the Ask dialog.
Somehow the "Ask" dialog interfere with the process.
Focusing on the button doesn't change a thing.
Can someone share a light on this? Thanks
I use it in order to access a secret debug card that the users should not be allowed in.
The group is transparent and it is made with 2 buttons, "BtnDebug" and a invisible "DebugPop".
It works fine. Below, find the code.
I decided to add a password check (ask password) and I noticed that now on desktop it trows an error on the line "popup tLongPop", but only if i move the mouse to the Ask dialog.
Somehow the "Ask" dialog interfere with the process.
Focusing on the button doesn't change a thing.
Can someone share a light on this? Thanks
Code: Select all
On MouseDown
---for debug show the test button
ask "Password?"
if it <> "SomePassword" then exit MouseDown
send "CheckForDebug" to me in 4 seconds
end MouseDown
Command CheckForDebug
if the mouse is down then
put the long name of button "DebugPop" of the owner of me into tLongPop
put the cList of button id 1235 of stack "SegnaPunto" into tList
if environment() = "mobile" then
mobilePick tList, 1, "cancelDone"
put the result into tResult
put line tResult of tList into tResult
send "menuPick tResult" to tLongPop --btn "DebugPop" of the owner of me
else
focus on tLongPop
get flushEvents("Mouseup")
set the text of tLongPop to tList --btn "DebugPop" of the owner of me to tList
popup tLongPop
end if
end if
end CheckForDebug