Page 1 of 1

[Solved] Imperfect results of #pB_Event_SizeDesktop resizing

Posted: Sat Feb 24, 2018 5:58 pm
by es_91
Please note: This has been solved and is no more a wish/feature request.

Dear Fred,

the common way to place controls on #pB_Window_Background-created frames shows an imperfect handling of resizing notifications when the #pB_Event_SizeDesktop message is used as indicator for browser sizing.

Please see and check the code below:

Code: Select all

enableExplicit



define appTitle$ = "size behaviour"

global background, frame_Main


declare sizeHandler ()


background = openWindow (#pB_Any, #pB_Ignore, #pB_Ignore, #pB_Ignore, #pB_Ignore, appTitle$, #pB_Window_Background )

frame_Main = frameGadget (#pB_Any, 20, 20, windowWidth (background ) - 40, windowHeight (background ) - 40, "frame" )

bindEvent (#pB_Event_SizeDesktop, @ sizeHandler () )



procedure sizeHandler ()
	
	
	resizeGadget (frame_Main, 20, 20, windowWidth (background ) - 40, windowHeight (background ) - 40 )
	
	
endProcedure
Image


The controls do resize, but not every change in browser area size seems to be communicated, as the controls visibly "stuck" in approximate sizes, too lare or too small for the logical measurement imperative.

Workaround/fix ?


----
Test browsers: Opera 50, Chrome, Firefox, iexplore.exe

Re: Imperfect results of #pB_Event_SizeDesktop resizing meth

Posted: Sat Feb 24, 2018 7:55 pm
by es_91
Hoppla!, i found workaround by myself.

The trick is not to use windowWidth and windowHeight for examining the desktop's (browser client size's) measurements but to have examineDesktops and the corresponding size getters do the job.

Easy.

The background window's functions so far return outdated sizes at the moment of obseration (see example above).