Page 1 of 1

#PB_Event_MoveWindow

Posted: Mon Mar 20, 2017 3:25 pm
by pf shadoko
Hello,

I want to limit the movement of a window

I use this code

Code: Select all

Procedure wmoveevent()
    Protected ew=EventWindow()
    Debug WindowY(ew)
    If WindowY(ew)<100
        ResizeWindow(ew,#PB_Ignore,100,#PB_Ignore,#PB_Ignore)
    EndIf
EndProcedure

OpenWindow(0, 0, 0, 512,512, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

BindEvent(#PB_Event_MoveWindow,@ wmoveevent())
It works with PB, but not with SB

Re: #PB_Event_MoveWindow

Posted: Mon Mar 20, 2017 5:35 pm
by MrTAToad
It appears that ResizeWindow cant be used in that procedure. Using it in, say an event timer, and all is okay...

Re: #PB_Event_MoveWindow

Posted: Fri Oct 21, 2022 7:47 am
by Fred
It will probably need a new command to restrict the window move, as it can't work like this in JS. Moved to feature and request.