Retrieve All #PB_Event_SizeWindow Events during Resize

Just starting out? Need help? Post your questions and find answers here.
Dr Soong
User
User
Posts: 14
Joined: Tue Nov 17, 2015 11:20 pm

Retrieve All #PB_Event_SizeWindow Events during Resize

Post by Dr Soong »

I realize that #PB_Event_SizeWindow was corrected via viewtopic.php?f=24&t=66074 to only send a single event upon completion of the window resize (at least on the Windows side).

But, is there a parameter or technique that can be used to send all resize events immediately (as long as the mouse button is pressed) as the user performs the resize?

I am attempting to dynamically reformat my window contents as the user drags the mouse. But as it currently functions, I have been unable to find a technique to easily accomplish this.

Is there something I am missing? It seems like this would be a useful behavior for some users.
PB: 6.00 LTS (x86) OS: Windows 10
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4955
Joined: Sun Apr 12, 2009 6:27 am

Re: Retrieve All #PB_Event_SizeWindow Events during Resize

Post by RASHAD »

Code: Select all

Procedure sizeCB()
  Static number
  number + 1: Debug "resize event number " + Str(number)
  Debug "------------------"
EndProcedure

OpenWindow(0, 0, 0, 600, 100, "resize window please", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_SizeGadget)

BindEvent(#PB_Event_SizeWindow,@sizeCB())
Repeat
  Event = WaitWindowEvent(10)
  
Until Event = #PB_Event_CloseWindow
Egypt my love
Dr Soong
User
User
Posts: 14
Joined: Tue Nov 17, 2015 11:20 pm

Re: Retrieve All #PB_Event_SizeWindow Events during Resize

Post by Dr Soong »

Thanks for your reply, Rashad. But on my system (Windows 10) using your code, the resize behaves as defined - not as I want.

That is, I recieve a single event notification upon Mouse Button Up after the resize - not many events during the Mouse-Button-Down-Drag-Resize operation. Those are the events I am trying to capture.

On your system, are you seeing many dozens of events generated for a resize, or just a single event? I'm trying to get the many dozens of events.
PB: 6.00 LTS (x86) OS: Windows 10
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4955
Joined: Sun Apr 12, 2009 6:27 am

Re: Retrieve All #PB_Event_SizeWindow Events during Resize

Post by RASHAD »

PB 6.xx x86 Windows 11 x64
Many events while mouse is down and resizing

Just tested it with VMware Windows 10 x64 PB 6.xx x86 and the results is the same as before
Egypt my love
Dr Soong
User
User
Posts: 14
Joined: Tue Nov 17, 2015 11:20 pm

Re: Retrieve All #PB_Event_SizeWindow Events during Resize

Post by Dr Soong »

Interesting... We're seeing different results.

Here's what I see after I have resized the initial box to musch smaller.

Image

By making the box much smaller, I would have expected many events. But I only get one.

I wonder if there is a setting I have turned on somewhere in my system.
PB: 6.00 LTS (x86) OS: Windows 10
Dr Soong
User
User
Posts: 14
Joined: Tue Nov 17, 2015 11:20 pm

Re: Retrieve All #PB_Event_SizeWindow Events during Resize

Post by Dr Soong »

Looks like the Image did not come across. Myabe a raw link will https://drive.google.com/file/d/1dfnVvI ... share_link
PB: 6.00 LTS (x86) OS: Windows 10
AZJIO
Addict
Addict
Posts: 2192
Joined: Sun May 14, 2017 1:48 am

Re: Retrieve All #PB_Event_SizeWindow Events during Resize

Post by AZJIO »

Dr Soong
User
User
Posts: 14
Joined: Tue Nov 17, 2015 11:20 pm

Re: Retrieve All #PB_Event_SizeWindow Events during Resize

Post by Dr Soong »

Thanks AZJIO, but I'm seeing the same behavior. The window reformat only takes place upon mouse-up. During the drag, I see an outline of the expanding window-box perimeter, but none of the interior content is reconfigured until I release the mouse button.
PB: 6.00 LTS (x86) OS: Windows 10
AZJIO
Addict
Addict
Posts: 2192
Joined: Sun May 14, 2017 1:48 am

Re: Retrieve All #PB_Event_SizeWindow Events during Resize

Post by AZJIO »

System Properties -> Performance Options -> "Show window contents while dragging"
I don't know if you can guess from the screenshot
found
Dr Soong
User
User
Posts: 14
Joined: Tue Nov 17, 2015 11:20 pm

Re: Retrieve All #PB_Event_SizeWindow Events during Resize

Post by Dr Soong »

That was it, AZJIO!!!

I had no idea that setting even existed on Windows. But I will definitley write down the process to find it.

After setting the checkbox, I went back to both your program, and the one given to me by Rashad, and they all performed as I would want them to. Now I just have to see if I can get my own program to work.

Thank you both for your help!
PB: 6.00 LTS (x86) OS: Windows 10
Dr Soong
User
User
Posts: 14
Joined: Tue Nov 17, 2015 11:20 pm

Re: Retrieve All #PB_Event_SizeWindow Events during Resize [Solved]

Post by Dr Soong »

For future referencers of this question, here is the path to find the "Show window contents while dragging" checkbox on Windows:

1. Open the Start menu;
2. Right-click Computer (or "This PC") → Properties;
3. Click Advanced system settings;
4. Click Performance → Settings;
5. Enable "Show window contents while dragging" and press OK:
PB: 6.00 LTS (x86) OS: Windows 10
Post Reply