Tooltips: Difference between revisions

Jump to navigation Jump to search
1,231 bytes added ,  10 March 2013
no edit summary
(Created page with "'''Tooltips''' are a work-in-progress usability enhancement. They provide a way for a cockpit to be partially self-documenting, when a user explores, and can also provide a po...")
 
No edit summary
Line 4: Line 4:


The tooltip-id is important to distinguish when the mouse moves over different scene objects (with potentially the same tooltip), or crosses between different objects without an intervening hit on an area with no tooltip assigned. In both cases, the ID is necessary to give correct updating.
The tooltip-id is important to distinguish when the mouse moves over different scene objects (with potentially the same tooltip), or crosses between different objects without an intervening hit on an area with no tooltip assigned. In both cases, the ID is necessary to give correct updating.
== Syntax ==
* Label is a printf-style format string (which need not contain expansions)
* Property is a property value to display
* Measure-text is a string used to size the tooltip, i.e the largest possible string. This configuration allows adjusting the tooltip font-size in the future without tooltip data changing (which would not be the case if an explicit width was specific)
* Mapping defines of a (growing) set of standard mappings of the property value
=== Mappings ===
* percent - maps a 0.0 ... 1.0 property to an integer percentage
* heading - maps a double or int value to a 0...359 heading/bearing
* arm-disarm, on-off, up-down and down-up - map a boolean value to a text string
== Examples ==
Basic usage:
<syntaxhighlight lang="xml">
<?xml version="1.0" encoding="utf8"?>
<PropertyList>
  <animation>
      <type>slider</type>
      <hovered>
      <binding>
        <command>set-tooltip</command>
        <label>Mixture: %3d%%</label>
        <measure-text>Mixture: 100%</measure-text>
        <tooltip-id>mixture</tooltip-id>
        <mapping>percent</mapping>
        <property>controls/engines/engine[0]/mixture</property>
    </binding>
    </hovered>
</animation>
</PropertyList>
</syntaxhighlight>
580

edits

Navigation menu