Page 1 of 1
setting the location of an "ask" dialog window
Posted: Fri May 11, 2007 11:10 pm
by churchken
Hi,
Is there a way to move the "ask" window away from the main stack window so the ask window does not overlay the main stack card when the user is being asked to provide an input?
Thanks,
Posted: Mon Jun 25, 2007 4:40 pm
by oliverk
Hi Ken,
The ask dialog has been designed to set itself to the location of the current default stack. This is because the dialog is supposed to be used when urgent input is needed from the user before execution can continue.
It may be possible to trick the dialog into appearing at another location, but I wouldn't recommend doing this. Instead you should consider why you want the dialog to open at another location and whether the information should be obtained another way (for example a text field or popup group).
If you still want to hack this, the following code will allow you to open an ask dialog whever you want on the screen, however I cannot guarantee this code will continue to work in future versions of Revolution as the ask dialog code may change.
Code: Select all
on askAtLocation pQuestion, pLocation
local tDefaultStack
put the defaultStack into tDefaultStack
lock messages
local tTempStack
create invisible stack
put the long id of it into tTempStack
set the location of tTempStack to pLocation
unlock messages
local tAskResult
set the defaultStack to tTempStack
ask pQuestion
put it into tAskResult
set the defaultStack to tDefaultStack
lock messages
delete tTempStack
unlock messages
return tAskResult
end askAtLocation
I would strongly advise against using this code, but if are needing to get it working very quickly, you could use it as a temporary workaround. I think that the best solution is to devise your own method of obtaining the information from the user by showing / hiding controls on the current card.
Hope this is some help.
Regards
Oliver
Posted: Mon Jun 25, 2007 10:01 pm
by Garrett
I have just the need for this myself and for the following reason. I'm making an application launcing menu bar. It's just a menu bar that autohides at the top of the screen, or is always open at the top of the screen. It's only 24 pix in height, sits at 0 and 0 on the screen and runs the length of the screen. When a dialog box is opened, it opens at the center and absolute top of the screen which is not very professional looking or normal at all. So this is one instance where needing to have the dialog boxes open at defined location would be required.
location of an ask window
Posted: Wed Jun 27, 2007 2:38 am
by churchken
Oliver -- Thanks for the reply.
I certainly appreciate your help.
The issue in my case was that the ask dialog box was "covering up" data on the active stack card. To see that data, the dialog box must then be moved to a different location. Or, the size of the active card had to be changed first, stretching it out, so the pertinent data was no longer covered by the dialog box. Using ask "with" multiple fields was not really an efficient way to ask for the input, either.
I agree with Garrett, the ability to set the box location would be helpful.
Again, thanks for your assistance.
Re: setting the location of an "ask" dialog window
Posted: Mon Jun 07, 2010 8:06 am
by urbaud
Hi Oliver,
I'm curious, but also relatively new to Rev. I was doing a search in the forum and I came across the code you displayed on Jun 25/07 to Ken regarding "setting the location of an "ask" dialog window. I'm curious about what it will do, but I don't know how to make it work. I tried putting it in a onMouseUp handler, but nothing happened. Could you tell me how to make it work so I can ease my curiosity? Thanks.
Dan