Hi fellow wiki editors!

To help newly registered users get more familiar with the wiki (and maybe older users too) there is now a {{Welcome to the wiki}} template. Have a look at it and feel free to add it to new users discussion pages (and perhaps your own).

I have tried to keep the template short, but meaningful. /Johan G

Canvas PUI Mapping

From FlightGear wiki
Jump to: navigation, search
This article is a stub. You can help the wiki by expanding it.

this will become a table with the most essential PUI directives (non-widgets), such as layout/styling and common PUI widget functionality (think live properties, bindings, conditions), so that we can keep track of what's missing/needed and finished already.


The basic idea can be seen below:


tag/directive description priority progress remarks
<property>, <format> formats properties high 60}% completed working proof-of-concept
<enable>, <visible> enables/disables and hides/shows widgets dynamically high n/a still to be done
<font> toggles default font for labels/buttons etc low n/a not very difficult to do (see canvas font mapping example)
<color> allows widget-specific colors to be overridden per widget low can be done via DefaultStyle.nas not difficult, but also not very important either


We will need to come up with some kind of "adapter" class that maps common PUI functionality to arbitrary Canvas widgets, specifically:

  • <height> and <width>
  • <legend> <label>
  • <property> and <format>
  • <binding>
  • <default>
  • <enable>
  • <visible> (easy)
  • <keynum> and <key>
  • <font>
  • <color>


Currently, this is accomplished in non-generic, fairly roundabout, fashion in the applyPUIAttributes() helper function in the pui2canvas parser

https://sourceforge.net/p/flightgear/flightgear/ci/next/tree/src/GUI/FGPUIDialog.cxx#l194

# ...