UI Autolayout

From cxwiki

Revision as of 05:29, 5 March 2018 by Windwalkr (talk | contribs)

The cxsource framework provides automatic layout facilities, allowing user interface layouts to be built with runtime-evaluated rules rather than hardcoded values. This offers a number of immediate benefits:

  • The underlying fonts and control appearances can be swapped out, leading to changes in the user interface layout requirements, without having to manually update every single UI.
    • This is especially useful when developing cross-platform interface layouts where the native appearance and even font rendering may require subtle changes to the layout.
  • Localised versions of the UI can reflow correctly without running out of space and without leaving ugly gaps.
  • A lot of manual coding, or manual calculations, can be skipped in favor of automated placement.
  • Layouts can adjust as windows are resized, including controlled collapse of elements when the window is too small to fit the full user interface.
  • Layouts can be hot-reloaded during development.
  • Window sizes and size limitations are calculated automatically, and can automatically adapt as the UI changes.
  • Layouts can be animated easily.

There are also some downsides:

  • Calculating the layout at runtime is slower than simply loading some predefined values.
  • Debugging problems in the user interface layout is sometimes more time-consuming.

 

UX Files

TBD.

Alignment Containers

TBD.

Alignment Methods

TBD.