How to change the position of answer Dialog
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
How to change the position of answer Dialog
How I change the position af answer Dialog. is it possible to change the position ?
--
Thanks
Kevin
Thanks
Kevin
-
- Livecode Opensource Backer
- Posts: 9375
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: How to change the position of answer Dialog
I tired this:
on mouseUp
set the lockScreen to true
set the moveSpeed to 65000
answer "Is this the correct place?" with "yes" or "no"
move the stack "Answer Dialog" to 700,700
set the lockScreen to false
end mouseUp
but it didn't work
when I tried this in the MessageBox:
move the stack "Answer Dialog" to 700,700
and, then, tried the script the answer dialog still appeared centred on the main stack.
You will probably have to make yourself a home-made answer stack.
on mouseUp
set the lockScreen to true
set the moveSpeed to 65000
answer "Is this the correct place?" with "yes" or "no"
move the stack "Answer Dialog" to 700,700
set the lockScreen to false
end mouseUp
but it didn't work
when I tried this in the MessageBox:
move the stack "Answer Dialog" to 700,700
and, then, tried the script the answer dialog still appeared centred on the main stack.
You will probably have to make yourself a home-made answer stack.
-
- Livecode Opensource Backer
- Posts: 9375
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: How to change the position of answer Dialog
Hi Richmond,
for years I have been asking myself why you always MOVE things,
when just SETting their LOC would be a more effective and instantaneous solution?
Best
Klaus
for years I have been asking myself why you always MOVE things,
when just SETting their LOC would be a more effective and instantaneous solution?
Best
Klaus
-
- Livecode Opensource Backer
- Posts: 9375
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: How to change the position of answer Dialog
Maybe because I am NOT entirely "LOCO"
However this:
on mouseUp
toplevel stack "Answer Dialog"
set the loc of stack "Answer Dialog" to 700,700
set the lockMoves to true
answer "Is this the correct place?" with "yes" or "no"
set the lockMoves to true
end mouseUp
still doesn't work.
However this:
on mouseUp
toplevel stack "Answer Dialog"
set the loc of stack "Answer Dialog" to 700,700
set the lockMoves to true
answer "Is this the correct place?" with "yes" or "no"
set the lockMoves to true
end mouseUp
still doesn't work.
Re: How to change the position of answer Dialog
Hi Richmoind,
But I think "answer xyz" will trigger the "preopenstack" script of that stack which will override all previous
loc settings and changes of the window layering (toplevel etc.)
Best
Klaus
AHA! I thought because you just "like to move it, move it!"richmond62 wrote:Maybe because I am NOT entirely "LOCO"
Sorry, never bothered to dive deeper into this mistery...richmond62 wrote:still doesn't work.Code: Select all
on mouseUp toplevel stack "Answer Dialog" set the loc of stack "Answer Dialog" to 700,700 ##set the lockMoves to true answer "Is this the correct place?" with "yes" or "no" ##set the lockMoves to true end mouseUp
But I think "answer xyz" will trigger the "preopenstack" script of that stack which will override all previous
loc settings and changes of the window layering (toplevel etc.)
Best
Klaus
-
- Livecode Opensource Backer
- Posts: 9375
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: How to change the position of answer Dialog
Yes, it does over ride everything, and that is USELESS if one wants the ANSWER window somewhere
other than plumb-dead-centre of your main stack.
other than plumb-dead-centre of your main stack.
-
- VIP Livecode Opensource Backer
- Posts: 9833
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: How to change the position of answer Dialog
Another option is to set the loc as a custom property in the Answer Dialog stack, and use a frontscript to trap preOpenCard, check if the name of the stack is "answer dialog", and if so set the loc per the prop.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: How to change the position of answer Dialog
Fun!
Two handlers and a local (or whatever)
Try this with the backdrop off.
Is it acceptable?
Two handlers and a local (or whatever)
Try this with the backdrop off.
Code: Select all
local sLoc
on mouseUp
lock screen
put the loc of this stack into sLoc
set the loc of this stack to 380,380
send "ResetLoc" to me in .1 tick
answer "Is this the correct place?" with "yes" or "no"
end mouseUp
command ResetLoc
set the loc of this stack to sLoc
end ResetLoc
-
- VIP Livecode Opensource Backer
- Posts: 4000
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: How to change the position of answer Dialog
Richmond linked to a very nice solution offered by RunRev Neil Roger
in script of stack
script of button:
I just added the setProp stuff to avoid unnecessary checking on "suspendStack"
It works well for me.
Kind regards
Bernd
in script of stack
Code: Select all
local sShiftAnswer
on suspendStack
if sShiftAnswer then
if "answer dialog" is among the lines of the openStacks then
set the topLeft of stack "answer dialog" to the topLeft of this stack -- change location to what you want here in global coordinates
end if
end if
end suspendStack
setProp shiftAnswer pBool
put pBool into sShiftAnswer
end shiftAnswer
Code: Select all
on mouseUp
set the shiftAnswer of this stack to true
answer "what time is it?" & cr & the milliseconds
set the shiftAnswer of this stack to false
end mouseUp
It works well for me.
Kind regards
Bernd