Computer Science Canada

Jumping windows?

Author:  Mackie [ Sat Apr 26, 2008 11:37 pm ]
Post subject:  Jumping windows?

I'm working on a window resizor, it's still pretty young, and it's not in it's final position or style, I figured I'd get the technique down first though. So, I've got a small glitch left, which seems to be pretty random, when my window is at certain positions on the screen it will jump around the screen to a completely insane, uncalled for location. Anyone know why this is happening?

Turing:
class Resizer

    import Window
    export Initialize, Run

    var windowHeight, windowWidth : int2
    var windowX, windowY : int
    var width, height : nat1
    var resize : boolean := false

    procedure Initialize (width_, height_ : nat1)
        width := width_
        height := height_
        windowHeight := maxy
        windowWidth := maxx
    end Initialize

    procedure Run (mouseX, mouseY, mouseB : int2)

        Draw.FillBox (maxx - width, maxy - height, maxx, maxy, white)
        Draw.FillBox (maxx - width, maxy - height, maxx - (width div 5), maxy - (height div 5), black)
        Draw.FillBox (maxx - width, maxy - height, maxx - (width div 3), maxy - (height div 3), white)
        Draw.Box (maxx - width, maxy - height, maxx, maxy, black)

        if mouseX >= maxx - width and mouseX <= maxx and
                mouseY >= maxy - height and mouseY <= maxy and
                mouseB = 1 then
            resize := true
            Window.GetPosition (-1, windowX, windowY)
        end if

        if resize then
            windowWidth := mouseX + width div 2
            windowHeight := mouseY + height div 2
            Window.Set (Window.GetSelect, "graphics:" + intstr (windowWidth) + ";" + intstr (windowHeight) +
                ",position:" + intstr (windowX) + ";" + intstr (windowY))
            if mouseB = 0 then
                resize := false
            end if
        end if

    end Run
end Resizer

View.Set ("offscreenonly,position:center;center")

var mouseX, mouseY, mouseB : int
var sizor : ^Resizer

new sizor

sizor -> Initialize (20, 20)


loop
    Mouse.Where (mouseX, mouseY, mouseB)
    sizor -> Run (mouseX, mouseY, mouseB)

    View.Update
    Time.Delay (3)
    Draw.Cls
end loop


Ignore any useless code, just messing around.

Author:  gitoxa [ Sun Apr 27, 2008 2:48 pm ]
Post subject:  Re: Jumping windows?

This is rather neat, but I do not see the problem, nor could I re-create what you described.

Author:  Mackie [ Sun Apr 27, 2008 3:19 pm ]
Post subject:  RE:Jumping windows?

I hear that form a lot of people as well.... I have a higher screen resolution than most people which could be a factor.

1680 * 1080

Could anyone else confirm this?

Also, try putting a corner off screen to see what happens.

Author:  Sean [ Sun Apr 27, 2008 5:15 pm ]
Post subject:  RE:Jumping windows?

No problem here Mackie, might be just you?

Author:  Nick [ Sun Apr 27, 2008 5:20 pm ]
Post subject:  RE:Jumping windows?

I had the same problem Mackie, but I am running through Linux...

Author:  Sean [ Sun Apr 27, 2008 5:31 pm ]
Post subject:  RE:Jumping windows?

How many applications did you have running at once tho?

Author:  lordroba [ Sun Apr 27, 2008 8:43 pm ]
Post subject:  Re: Jumping windows?

I know why it's happening, at least on my computer. I have my taskbar set on the left side of the screen instead of on the buttom. When I put it on the bottom though, the glitch is gone. I had the same problem with a window shaking program that I got off of here. I'm not sure why it does what it does, but if anyone can figure out how to fix the problem, i'd like to know.

Author:  Mackie [ Sun Apr 27, 2008 10:01 pm ]
Post subject:  RE:Jumping windows?

I'm currently running debugging stuff, I'll figure it out, It's my mission.... I have a lead.... Sort of? >.< if Anyone has an idea, even a stupid one, please speak up. If I figure it out now, someone else won't have to go through it in the future.

(Also working on reducing flashing)

Author:  Tallguy [ Mon Apr 28, 2008 7:59 am ]
Post subject:  RE:Jumping windows?

it's not glitching for me, perhaps its just ur computer?

Author:  Sean [ Mon Apr 28, 2008 4:06 pm ]
Post subject:  RE:Jumping windows?

Glitched for me this time. Seems that when you drag it bounces everywhere. Any leads to as why yet Mackie?

Author:  Mackie [ Mon Apr 28, 2008 5:12 pm ]
Post subject:  RE:Jumping windows?

I think that it may be due to that fact that Turing wasn't build for larger resolutions, it seems to bounce with in a box, if you spend enough time looking at it, you'll sse it has a pattern. It's moving to a point where it thinks the edge of the screen is. Just a thought.

Author:  [Gandalf] [ Mon Apr 28, 2008 5:29 pm ]
Post subject:  RE:Jumping windows?

I know Delos did a Turing window shake module that was quite good a few years ago. You could try looking that up for reference / inspiration.


: