FoxInCloud
Scaling in the browser
Gravatar is a globally recognized avatar based on your email address. Scaling in the browser
  Paul
  All
  Feb 14, 2019 @ 12:51pm

Hi,

I have a form that is resized to full screen (_screen.width & height) in its Init, but in the browser the form appears in the top left of the page and only about a quarter of the area.
The controls are resized too (not using .Anchor, but a 3rd-party resize control) and the controls have resized correctly* to match this scale.

.

In classic mode :
What options do I have to scale the size of the form in the page?
Also, options to centre the form in the page ? .
.

.* = except for the grid, which expands (the sliding animation) at runtime to be too large. I haven't worked out why yet.

Thanks
Paul

Gravatar is a globally recognized avatar based on your email address. re: Scaling in the browser
  FoxInCloud Support - Thierry N.
  Paul
  Feb 15, 2019 @ 02:08am

Hi Paul,

Maybe seeing the generated HTML and XHR requests would help elaborate a better advice, however:

  1. in form code, replace _Screen.Width/Height by thisForm.wViewPortWidth/Height, working in both desktop and web modes
  2. to center the form, set form.AutoCenter = .T.
  3. When and where do you trigger the resize by your third-party control?
Gravatar is a globally recognized avatar based on your email address. re: Scaling in the browser
  Paul
  FoxInCloud Support - Thierry N.
  Apr 1, 2019 @ 03:36pm

Hi,

thisform.wViewPortWidth and thisform.wViewPortHeight are always zero when I debug, so I have changed back to _screen.Width and _Screen.Height.

Init() code in the form's parent class :

thisform.Move(0, 0, _screen.Width, _screen.Height)  
thisform.resize  && this triggers the 3rd party resize system

My observations :

  1. if that code is in the this.wlInitFirst section it does not resize the form
  1. the form is centred in the browser page and remains its original size, looks ok but I would like it to scale
  1. if that code is after the this.wlInitFirst section then the form does resize
  2. the same behaviour is observed in forms opened with wform() and wformMaster()

I have emailed you the HTML of the form, but it doesn't matter now as I have discovered the reason why the controls were not resizing properly - I didn't have height, width, top and left in wcPropSave.
So the two remaining questions are :

  1. why doesn't the resizing work in the wlInitFirst section? Not a big deal, but it seems like it should.
  2. is there a way to tell the form to resize to the dimensions of the browser page? (wViewPortWidth and wViewPortHeight don't seem to work)

Thanks
Paul

Gravatar is a globally recognized avatar based on your email address. re: Scaling in the browser
  FoxInCloud Support - Thierry N.
  Paul
  Apr 3, 2019 @ 04:13am

Hi Paul,

thisform.wViewPortWidth and thisform.wViewPortHeight are always zero when I debug

should be set with wForm(), and 0 with wFormMaster()

reason: currently these form properties are set through AJAX requests and are not persisted as an environment setting (which should be); when wFormMaster() rebuilds the page, oAJAX.nViewPort* are empty.

why doesn't the resizing work in the wlInitFirst section? Not a big deal, but it seems like it should.

the wlInitFirst section execute once for all users while each user has her/his own .wViewPort*; so it must execute specifically for each user, in the 'common' section of form.Init()

is there a way to tell the form to resize to the dimensions of the browser page? (wViewPortWidth and wViewPortHeight don't seem to work)

Next release (V 2.28.1-beta.6) will set _Screen.Width and _Screen.Height as browser's view port width and height, save and restore as environment parameters; your code using _Screen.Width and _Screen.Height should work after the user has made her/his first action (eg. opened the home page)

© 1996-2024