This is a big pain-in-the-bum:
-
-
But with some sort of scaling being able to happen things could get considerably better:
-
-
keyBoardActivated being made available on LC Desktop would be a great boon.
Send the Stack to the Center of the screen.
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
- Posts: 9444
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
-
- VIP Livecode Opensource Backer
- Posts: 4016
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Send the Stack to the Center of the screen.
Here is a stack that simplifies setting the loc of a scaled stack. I has a handler 'setLocation' that is generic enough to be used in other projects (button 'setLoc')
After Stam's very useful explanation and sample stack at the beginning of this topic I figured that a simple way to handle moving scaled stacks would be useful.
It boils down to this
That is it and it works.
I added the case that you want to move a scaled paletted stack. I turns out that LC apparently thinks for the top that the title bar of a stack is always the title bar of a topLevel stack which does not quite work for paletted stacks (or I did not find out how).
I resorted to a stunt that creates an invisibe stack on the fly and calculates the difference of the height of the title bar between a toplevel version and a paletted version and added that difference to the coordinates.
Kind regards
Bernd
After Stam's very useful explanation and sample stack at the beginning of this topic I figured that a simple way to handle moving scaled stacks would be useful.
It boils down to this
Code: Select all
put "number", "number" into tTargetLoc
put the scaleFactor of stack "myStack" into tScale
put item 1 of targetLoc / tScale into item 1 of tTargetLoc
put item 2 of targetLoc / tScale into item 2 of tTargetLoc
set the topLeft of stack "myStack" to tTargetLoc
I added the case that you want to move a scaled paletted stack. I turns out that LC apparently thinks for the top that the title bar of a stack is always the title bar of a topLevel stack which does not quite work for paletted stacks (or I did not find out how).
I resorted to a stunt that creates an invisibe stack on the fly and calculates the difference of the height of the title bar between a toplevel version and a paletted version and added that difference to the coordinates.
Kind regards
Bernd
- Attachments
-
- settingLocOfScaledStack.livecode.zip
- (2.26 KiB) Downloaded 74 times
-
- Livecode Opensource Backer
- Posts: 9444
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Send the Stack to the Center of the screen.
Whose revMenuBar would you be referring to? Your comment is a bit decontextualised.I'm a little puzzled by the slippage of your revMenuBar though
----------
Oh, and as this is you first postage, welcome to these forums.
How long have you been working with LiveCode?