Compile Time Changes

The following changes were made to support development efforts for the New UI.

SlimDoubleScrollBar has been deprecated. Set the slim parameter in DoubleScrollBar to true instead.

The following changes were made to cm/win/cardWindow.cm:

Removed: public bool delayToolboxPaint;
Removed: public taskStatus cardWindowDrawFrameCB(Task task, timespan slot, Object arg) {}
Removed: public taskStatus cardWindowDrawFlapsCB(Task task, timespan slot, Object arg) {}

FrameWindow resizing has been split into 2 separate methods.

The first method resizing0 determines the frame borders and resizing1 should perform actual re-layout logic.

Deprecated: extend public rectI resizing(rectI r, bool left, bool right, bool top, bool bottom)
Added: extend public rectI resizing0(rectI r, bool left, bool right, bool top, bool bottom)
Added: extend public void resizing1(sizeI s)

CardWindow has had the following changes:

Removed: public bool rebuildingInProgress;
Added: public int rebuildNesting;
Added: final public bool rebuildingInProgress() {}

Removed: extend public bool drawFrame(WindowPixelDevice c, bool enqueue=true) {}
Added: extend public bool drawFrame(WindowPixelDevice c) {}

Removed: extend public void drawFlaps(WindowPixelDevice c, bool dragging=false, bool enqueue=true) {}
Added: extend public void drawFlaps(WindowPixelDevice c, bool dragging=false) {}

FormattedTextArea has the following methods removed:

Removed: final public void setText(null n) {}

All predefined LegacyFrames in cm/win/legacyFrame.cm have been removed due to performance issues:

Removed: public FrameStyle redButtonFrame -> Migrate to redPenFrame
Removed: public FrameStyle greenButtonFrame -> Migrate to greenPenFrame
Removed: public FrameStyle blueButtonFrame -> Migrate to bluePenFrame
Removed: public FrameStyle grayFrame -> Migrate to stdLightFrame
Removed: public FrameStyle mediumGrayFrame -> Migrate to stdGrayFrame
Removed: public FrameStyle darkGrayFrame -> Migrate to darkGrayPenFrame
Removed: public FrameStyle unknownFrame -> Migrate to null

The fields in SubMenuInfo have been changed:

Removed: public bool visible;

The following change in cm/win/distanceLabel.cm was made to support adding yardage as a unit of measure.

Added: public str yardsS(double meters, bool showUnit=true, int decimals=2, bool decimalZeroes=false, lcid locale=lcid(-1), unitMagnitude magnitude=unitMagnitude.dist) {}

Runtime/Behavior Changes

The following changes were made to support development efforts of new UI.

Origin fixes

The origin of parent Windows will now be respected when doing operations like extendRight, extendBottom, extendBottomRight, and any other positioning functions, which may affect the layout of your dialogs.

Font changes

The new UI comes with a different larger font, which may affect the layout of your windows. This typically shows up in the various forms:

  • clipped font descent texts (i.e. letters g, j, p, q, y getting clipped)
  • Input text fields getting cropped off

Some common classes that are affected:

  • GridCell used in GridWindow
  • SectionedLabel

Improvements for Card

Hidden cards no longer get size updates from their parent parent CardWindow. This is to improve resizing performance. Instead, CardWindow will call parentClientBoundChanged before your card is shown.

To handle custom layout logic, you may can override Card's parentClientBoundChanged:

    /**
     * Parent client bound changed.
     */
    public void parentClientBoundChanged() {
        sizeI prevSize = size();
        super();
        if (size() != prevSize) updateLayout();
    }

Card are no longer constructed with a hardcoded size of (100, 100) to improve performance.

MenuBar size and margins

Upon constructing a MenuBar, you need to perform a finalize() method call.

    CoolMenuBar menu(parent);
    buildFileMenu(menu);
    buildEditMenu(menu);
    buildManufacturersMenu(menu);
    menuBar.finalize();

The finalize method call performs the following:

Call finalizeSubMenu to ensure sub menu margins consistent.

Perform an autoSize to calculates appropriate width and height.

Resize and reposition xControls as required during parentClientBoundChanged

Changes to repaintFrame

The following classes no longer paint frames in repaintFrame.

  • ShrinkBox
  • ShrinkWindow
  • SubGroupBox

Subclasses of the above classes should migrate their repaintFrame overrides to repaint. In most cases a rename of the method signature would suffice.

Removed: public bool repaintFrame(mdc hdc, rectI r)
Replace: public bool repaint(mdc hdc, rectI r)

If you have code that used to call repaintFrame(), you should replace it with refreshFrame()

Old: repaintFrame();
New: refreshFrame();

In future releases, we will try to remove repaintFrame in more places.