Page 1 of 1
ResizeWindow() - a known issue with Windows 10?
Posted: Thu Jun 04, 2020 11:15 am
by StarWarsFan
Hey friends!
Hope you are all doing fine and C19 does not bite you!
Got this issue: I found out that some code that I wrote which resizes a window depending on how much dynamic data (a list) is shown
- works well on Windows 7
- but totally screws up the display on Windows 10
I have melted down the issue to be related to the command "ResizeWindow()". Everything else works well.
Before I begin the discussion I wish to ask: Is this a known bug?
Re: ResizeWindow() - a known issue with Windows 10?
Posted: Thu Jun 04, 2020 11:51 am
by BarryG
StarWarsFan wrote:Is this a known bug?
Short: No.
Long: We need to see some code.
Re: ResizeWindow() - a known issue with Windows 10?
Posted: Thu Jun 04, 2020 11:57 am
by StarWarsFan
Hey Barry! Nice to see you again!
Okay, then let me get home and post some code (Got that code at home on laptop).
Re: ResizeWindow() - a known issue with Windows 10?
Posted: Thu Jun 04, 2020 12:11 pm
by Kiffi
StarWarsFan wrote:Okay, then let me get home and post some code
Please only post executable code that is as short as possible and with which we can reproduce your problem.
Re: ResizeWindow() - a known issue with Windows 10?
Posted: Fri Jun 05, 2020 1:19 pm
by StarWarsFan
I was experimenting with ResizeWindow() to display a little "window-animation". Enlarging the window to show more data.
This works fine under Win7, it does not on Win10.
The code that I use on Win7 is:
Code: Select all
scrollREIN: ;- scrollREIN
summe=0
For x= 1 To 5 : ResizeWindow(#main,WindowX(#main)-1,#PB_Ignore,WindowWidth(#main)+1,#PB_Ignore) : Mydelay(10) : Next : summe +x*1
For x= 1 To 6 : ResizeWindow(#main,WindowX(#main)-2,#PB_Ignore,WindowWidth(#main)+2,#PB_Ignore) : Mydelay(10) : Next : summe +x*2
For x= 1 To 8 : ResizeWindow(#main,WindowX(#main)-4,#PB_Ignore,WindowWidth(#main)+4,#PB_Ignore) : Mydelay(10) : Next : summe +x*4
For x= 1 To 25: ResizeWindow(#main,WindowX(#main)-5,#PB_Ignore,WindowWidth(#main)+5,#PB_Ignore) : Mydelay(10) : Next : summe +x*5
For x= 1 To 8 : ResizeWindow(#main,WindowX(#main)-4,#PB_Ignore,WindowWidth(#main)+4,#PB_Ignore) : Mydelay(10) : Next : summe +x*4
For x= 1 To 6 : ResizeWindow(#main,WindowX(#main)-2,#PB_Ignore,WindowWidth(#main)+2,#PB_Ignore) : Mydelay(10) : Next : summe +x*2
For x= 1 To 5 : ResizeWindow(#main,WindowX(#main)-1,#PB_Ignore,WindowWidth(#main)+1,#PB_Ignore) : Mydelay(10) : Next : summe +x*1
Return
scrollRAUS: ;- scrollRAUS
summe=0
For x= 1 To 5 : ResizeWindow(#main,WindowX(#main)+1,#PB_Ignore,WindowWidth(#main)-1,#PB_Ignore) : Mydelay(10) : Next : summe +x*1
For x= 1 To 6 : ResizeWindow(#main,WindowX(#main)+2,#PB_Ignore,WindowWidth(#main)-2,#PB_Ignore) : Mydelay(10) : Next : summe +x*2
For x= 1 To 8 : ResizeWindow(#main,WindowX(#main)+4,#PB_Ignore,WindowWidth(#main)-4,#PB_Ignore) : Mydelay(10) : Next : summe +x*4
For x= 1 To 25: ResizeWindow(#main,WindowX(#main)+5,#PB_Ignore,WindowWidth(#main)-5,#PB_Ignore) : Mydelay(10) : Next : summe +x*5
For x= 1 To 8 : ResizeWindow(#main,WindowX(#main)+4,#PB_Ignore,WindowWidth(#main)-4,#PB_Ignore) : Mydelay(10) : Next : summe +x*4
For x= 1 To 6 : ResizeWindow(#main,WindowX(#main)+2,#PB_Ignore,WindowWidth(#main)-2,#PB_Ignore) : Mydelay(10) : Next : summe +x*2
For x= 1 To 5 : ResizeWindow(#main,WindowX(#main)+1,#PB_Ignore,WindowWidth(#main)-1,#PB_Ignore) : Mydelay(10) : Next : summe +x*1
Return
Again: The astonishing thing is that this little "animation" works as desired on Win7, but on Win10 it just won't.
Re: ResizeWindow() - a known issue with Windows 10?
Posted: Mon Jun 08, 2020 7:24 pm
by netmaestro
Seems to work here on Windows 10:
Code: Select all
Procedure MyDelay(val.i)
While WindowEvent():Wend
Delay(val)
EndProcedure
#main=0
OpenWindow(0,0,0,640,480,"",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
Gosub scrollrein
Repeat:Until WaitWindowEvent()=#PB_Event_CloseWindow
End
scrollREIN: ;- scrollREIN
summe=0
For x= 1 To 5 : ResizeWindow(#main,WindowX(#main)-1,#PB_Ignore,WindowWidth(#main)+1,#PB_Ignore) : MyDelay(10) : Next : summe +x*1
For x= 1 To 6 : ResizeWindow(#main,WindowX(#main)-2,#PB_Ignore,WindowWidth(#main)+2,#PB_Ignore) : MyDelay(10) : Next : summe +x*2
For x= 1 To 8 : ResizeWindow(#main,WindowX(#main)-4,#PB_Ignore,WindowWidth(#main)+4,#PB_Ignore) : MyDelay(10) : Next : summe +x*4
For x= 1 To 25: ResizeWindow(#main,WindowX(#main)-5,#PB_Ignore,WindowWidth(#main)+5,#PB_Ignore) : MyDelay(10) : Next : summe +x*5
For x= 1 To 8 : ResizeWindow(#main,WindowX(#main)-4,#PB_Ignore,WindowWidth(#main)+4,#PB_Ignore) : MyDelay(10) : Next : summe +x*4
For x= 1 To 6 : ResizeWindow(#main,WindowX(#main)-2,#PB_Ignore,WindowWidth(#main)+2,#PB_Ignore) : MyDelay(10) : Next : summe +x*2
For x= 1 To 5 : ResizeWindow(#main,WindowX(#main)-1,#PB_Ignore,WindowWidth(#main)+1,#PB_Ignore) : MyDelay(10) : Next : summe +x*1
Return
Re: ResizeWindow() - a known issue with Windows 10?
Posted: Sat Jul 10, 2021 2:19 pm
by StarWarsFan
That is very astonishing, if not surprising.
The only difference appers to be the delay procedure, I used
Procedure MyDelay(Delay)
Timer= ElapsedMilliseconds() : Repeat : WaitWindowEvent(1) : Until ElapsedMilliseconds()-Timer >= Delay
EndProcedure
=> Did NOT work on Win10 properly
You used:
Procedure MyDelay(val.i)
While WindowEvent():Wend
Delay(val)
EndProcedure
=> Will now test on my second PC
But can anyone explain in detail where exactly I went wrong with my routine? I want to learn!
Re: ResizeWindow() - a known issue with Windows 10?
Posted: Sat Jul 10, 2021 6:01 pm
by mk-soft