Skip to content

Web Framework Changes in 2016r2

The web framework got some love in Xojo 2016r2…

General Changes

First, the Web Framework now has support for Retina/HiDPI in supported browsers. All controls have been updated with new graphics to allow your Web Apps to look great on any screen. All you have to do is just flip the “Supports Retina/HiDPI” switch and start using Image objects instead of Pictures and you’re off and running!

NOTE: Regardless of whether you check the “Supports Retina/HiDPI” switch, the web framework now stores all of your image assets in the Resources directory next to your app and they are only loaded momentarily when a browser requests one. This means that your app should use a lot less memory overall.

Controls

WebCanvas: HiDPI/Retina drawing out of the box! No code change required!

WebPicture: Just start using Images instead of Pictures and flip the Retina/HiDPI switch and the web framework will automatically send the correct resolution image to the browser.

WebImageView: Because it’s backed with a WebPicture, it just works!

WebToolbar: Toolbar icons now support Images as well.

Events

WebSession.ScaleFactorChanged: Fires whenever the ScaleFactor of the current session’s browser changes.

Properties

WebSession.ScaleFactor (Read-Only): Reflects the current ScaleFactor of the browser.

WebSDK

The WebSDK has been given a ScaleFactorChanged event so your control is notified when a change occurs instead of your control needing to periodically check the ScaleFactor property on the Session object.

WebControlWrapper.ScaleFactorChanged: Fires whenever the ScaleFactor of the current session’s browser changes.

Also for WebSDK, we are now enforcing unique Javascript Namespaces throughout a project at compile time. This means you’ll be able to tell ahead of time if your controls are missing a namespace or if you’ve inadvertently used the same exact namespace more than once!