#PB_Event_MoveWindow

Got an idea for enhancing SpiderBasic? New command(s) you'd like to see?
pf shadoko
Posts: 74
Joined: Thu May 26, 2016 11:09 am

#PB_Event_MoveWindow

Post 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
User avatar
MrTAToad
Posts: 291
Joined: Sun Apr 20, 2014 11:43 am
Location: Chichester, England
Contact:

Re: #PB_Event_MoveWindow

Post by MrTAToad »

It appears that ResizeWindow cant be used in that procedure. Using it in, say an event timer, and all is okay...
Fred
Site Admin
Posts: 1506
Joined: Mon Feb 24, 2014 10:51 am

Re: #PB_Event_MoveWindow

Post 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.
Post Reply