Changes that have been done:
DibImage instead of MemoryImage. For more details, check the run-time/behavior changes section.bool newSvgRenderer now defaults to true for icon loading functions.Old: public Image icon(str name, symbol key=#default, bool debug=false) Old: public Image icon(str name, symbol key=#default, bool newSvgRenderer=false, bool debug=false) New: public Image icon(str name, symbol key=#default, bool newSvgRenderer=true, bool debug=false) Old: public Image icon(str name, bool enabled, symbol key=#default) New: public Image icon(str name, bool enabled, symbol key=#default, bool newSvgRenderer=true) Old: public Image disabledIcon(str name, symbol key=#default) New: public Image disabledIcon(str name, symbol key=#default, bool newSvgRenderer=true) Old: public Image dibIcon(str name, symbol key=#default, bool debug=false) Old: public Image dibIcon(str name, symbol key=#default, bool newSvgRenderer=false, bool debug=false) New: public Image dibIcon(str name, symbol key=#default, bool newSvgRenderer=true, bool debug=false) Old: public Image disabledDibIcon(str name, symbol key=#default) New: public Image disabledDibIcon(str name, symbol key=#default, bool newSvgRenderer=true)
The following fields and methods have been removed:
public str->DibImage dibIconLookup(); final public Image getDib(str name, bool debug=false) final public Image getDib(str name, bool newSvgRenderer=false, bool debug=false) final public Image getDisabledDib(str name, bool debug=false)
The following methods have been updated:
Old: final public Image get(str name, bool debug=false) Old: final public Image get(str name, bool newSvgRenderer=false, bool debug=false) New: final public Image get(str name, bool newSvgRenderer=true, bool debug=false)
The following methods have been updated to remove bool dib=false:
Old: final public Image get(str name, symbol key, bool dib=false, bool debug=false) Old: final public Image get(str name, symbol key, bool dib=false, bool newSvgRenderer=false, bool debug=false) New: final public Image get(str name, symbol key, bool newSvgRenderer=true, bool debug=false) Old: final public Image getDisabled(str name, symbol key, bool dib=false) New: final public Image getDisabled(str name, symbol key)
Old: public constructor(Url imageFile, sizeI size=(-1, -1), SrcRef src=#:src) Old: public constructor(Url imageFile, bool newSvgRenderer, sizeI size=(-1, -1) New: public constructor(Url imageFile, bool newSvgRenderer=true, sizeI size=(-1, -1) Old: public SvgImage vectorImage(Url url, bool use=false, SrcRef src=#:src) Old: public SvgImage vectorImage(Url url, bool newSvgRenderer, bool use=false, SrcRef src=#:src) New: public SvgImage vectorImage(Url url, bool newSvgRenderer=true, bool use=false, SrcRef src=#:src)
The function showForeignWindow no longer restores the window when setting its visibility.
Use restoreForeignWindow if you want the old behavior of restoring the window.
Old: public void showForeignWindow2(mwnd hwnd) = win_showForeignWindow; New: public void showForeignWindow(mwnd hwnd) = win_showForeignWindow; Old: public void showForeignWindow(mwnd hwnd) = win_restoreForeignWindow; New: public void restoreForeignWindow(mwnd hwnd) = win_restoreForeignWindow;
The following functions have been removed.
public bool faceliftDeveloper() : deprecated { return staffan or prismDeveloper; } public bool isAlphaLegacy(char c) { return spellChecker.isAlpha(c); }
AppWindow
Old: final public pointI dropDownShow(pointI p, bool autoSize=true) New: final public pointI dropDownShow(pointI p, bool autoSize=true, bool enforceMinWidth=true)
Window
Old: extend public pointI showDropDownMenu(pointI p, bool pInScreenCoords=false, bool autoSize=true) New: extend public pointI showDropDownMenu(pointI p, bool pInScreenCoords=false, bool autoSize=true, bool enforceMinWidth=true)
We have added a new argument bool establishSocketConnection=false into the constructor.
Old: public constructor(str key, str url, int port=-1, bool launch=false, str label="CET", bool showPageTitle=false, bool showNavigation=true, bool alwaysOnTop=false, bool hideUrl=false, pointI initPos=(-1, -1), sizeI initSize=(-1, -1), bool resizable=false, sizeI minSize=(-1, -1), sizeI maxSize=(-1, -1), bool devMode=false, webViewCB msgCallback=null) New: public constructor(str key, str url, int port=-1, bool launch=false, str label="CET", bool showPageTitle=false, bool showNavigation=true, bool alwaysOnTop=false, bool hideUrl=false, pointI initPos=(-1, -1), sizeI initSize=(-1, -1), bool resizable=false, sizeI minSize=(-1, -1), sizeI maxSize=(-1, -1), bool devMode=false, webViewCB msgCallback=null, bool establishSocketConnection=false)
The sizeI size argument has been changed to int width.
Old: public constructor(Window parent, str message, Image image, str key=null, sizeI size=(0, 0), int internalMargin=7, Brush brush=ultraLightGrayBrush, FrameStyle frameStyle=lightGrayPenFrame, color textColor=black, color linkColor=primary600, color linkHoverColor=primary600, int textSize=12, str fontFace=null, function(Control button, str key):bool linkCallback=null, SrcRef src=#:src) { New: public constructor(Window parent, str message, Image image, str key=null, int width=0, int internalMargin=7, Brush brush=ultraLightGrayBrush, FrameStyle frameStyle=lightGrayPenFrame, color textColor=black, color linkColor=primary600, color linkHoverColor=primary600, int textSize=12, str fontFace=null, function(Control button, str key):bool linkCallback=null, SrcRef src=#:src) {
This MessageWindow constructor now takes in argument int width.
Old: public constructor(Window parent, str message, messageType msgType=messageType.undefined, str key=null, int internalMargin=7, function(Control button, str key):bool linkCallback=null, SrcRef src=#:src) { New: public constructor(Window parent, str message, messageType msgType=messageType.undefined, str key=null, int width=0, int internalMargin=7, function(Control button, str key):bool linkCallback=null, SrcRef src=#:src) {
In 16.5, we introduced dibIcon(..) which loads icon as DibImage instead of MemoryImage. For 17.0, we are replacing the existing icon(..) to behave exactly as dibIcon(..).
Benefits of DibImage:
For existing code that calls icon(..) and expects a MemoryImage, migration will be required.
Common symptoms are:
How to resolve this:
In core, we had 2 common scenarios.
// Previous logic only handles MemoryImage. byte beforeBlend = 255; if (image as MemoryImage) { beforeBlend = image.blend; image.blend = 100; } image.transparentDraw(c.hdc, imgPos); if (image as MemoryImage) image.blend = beforeBlend; // New logic now handles MemoryImage, DibImage and SvgImage. byte beforeBlend = image.blend; image.blend = 100; image.transparentDraw(c.hdc, imgPos); image.blend = beforeBlend;
// Previous logic only handles MemoryImage and Icon if (limb as SnapperLimb) { if (limb.image in MemoryImage or limb.image in Icon) { button = snapperImage(window, label, limb, limb.src); } } else if (limb as AnimationLimb or limb.image in Icon) { if (limb.image in MemoryImage) { button = animationImage(window, label, limb, limb.src); } } // New logic now handles MemoryImage, Icon, DibImage and SvgImage if (limb as SnapperLimb) { if (limb.image in MemoryImage or limb.image in Icon or limb.image in DibImage or limb.image in SvgImage) { button = snapperImage(window, label, limb, limb.src); } } else if (limb as AnimationLimb) { if (limb.image in MemoryImage or limb.image in Icon or limb.image in DibImage or limb.image in SvgImage) { button = animationImage(window, label, limb, limb.src); } }
In 16.5 Minor:
For 17.0 Major:
If you spot issues loading your svg icons, you can pass newSvgRenderer=false when you call icon(..)
// New svg renderer causing issues icon("myIcon", #:pkg) icon("myIcon", false, #:pkg) vectorImage(url); // Fallback to svg renderer used in CET 16.5 icon("myIcon", #:pkg, newSvgRenderer=false) icon("myIcon", false, #:pkg, newSvgRenderer=false) vectorImage(url, newSvgRenderer=false);
As we now have better SVG rendering capabilities in CET, IconFinder will search for SVG first before other suffixes.
Old: public str[] suffixSearchPriority = [".png", ".bmp", ".cmpng", ".cmbmp", ".svg"]; New: public str[] suffixSearchPriority = [".svg", ".png", ".bmp", ".cmpng", ".cmbmp"];