It always seems like I’ve run out of ways to get confused about variables, tokens, conditions, actions, text, and calculations, but I have just run aground again and need some help.
What I want to do is call macro “Resize Window” with parameter width, height. Then, I want to resize the front window according to the parameter, but making sure that the window edges are:
- at least 15 pixels from the left edge of the screen
- 15 pixels from the right
- 25 from the top, and
- 80 from the bottom. I don’t care what happens if the window is too big to meet those constraints.
So I have steps like the following, a mix of real KM “code” and “abstract code”. I need instructions supplying the right %s, %Calculation%%, etc.
If all of the following are true:
The calculation:
Left of Front Window + TriggerValue[1] < SCREEN(0, Right) - 15
returns true
execute the following actions:
Set the Variable 'New Left' to Text
MAX(15, Left of Front Window)
otherwise execute the following actions:
Set the Variable 'New Left' to Text
SCREEN(0, Right) - TriggerValue[1] - 15
. . .
I do something similar for New Top. Then at the end I want to Move Front Window to Position New Left, New Top. What should go in the Move to lines? New Left and New Top appear in orange.