This event is triggered each time the DesiredClientSize property of the Smartframe Newlook Control changes.
object.OnDesiredClientSizeChanged = [eventHandler]
Where object is the Smartframe Newlook Control, and eventHandler is the code to execute.
Introduced in Version 11.1.0.
The OnDesiredClientSizeChanged event is triggered each time the DesiredClientSize property of the Smartframe Newlook Control changes.
This event (and the related DesiredClientSize property) are useful for solutions that use fixed scaling - to provide a mechanism for preventing the display of horizontal and vertical scrollbars in the Newlook Control at runtime.
This DesiredClientSize property returns a structure containing a width and height property. These properties represent the size that the client should be rendered at, in order to avoid scrollbars. To prevent scrollbars, the Smartframe developer can add an event handler for the OnDesiredClientSizeChanged event to their Smartframe template, to query the control for its current size, relative to the DesiredClientSize, and adjust the Smartframe Newlook Control size if necessary.
It is recommended that you apply a tolerance when handling the OnDesiredClientSizeChanged event to avoid introducing a feedback loop. Refer to the example below.
// The following function (triggered by the OnDesiredClientSizeChanged event) compares the current height and width of the Smartframe Newlook Control to the height and width values returned by the DesiredClientSize property, and adjusts the control's height and width if there is a difference greater than the specified 5 pixel tolerance.
newlook1.OnDesiredClientSizeChanged = function (desiredClientSize) {
if (Math.abs($(newlook1).width() - desiredClientSize.Width) > 5
|| Math.abs($(newlook1).height() - desiredClientSize.Height) > 5) {
$(newlook1).width(desiredClientSize.Width);
$(newlook1).height(desiredClientSize.Height);
}
}
DesiredClientSize
Property | Customizing Smartframe templates | Smartframe Newlook Control API | OnFunctionKeyChanged event | OnOpened event | OnReceived event | OnRefreshed event | OnSent event | OnStatusChanged event | OnTitleChanged event
© 2004-2021 looksoftware. All rights reserved.