Howto:Prototyping a new NavDisplay Style: Difference between revisions

Jump to navigation Jump to search
Line 44: Line 44:


== Implementation ==
== Implementation ==
The long/proper answer is that the "dialog" has become more sophisticated than originally planned.
Meanwhile "dialog" has become more sophisticated than originally planned, people looking at the code/XML markup may wonder how this whole thing is working, so the following parapgraph is going to provide some additional background inforamtion:
In general, all PUI/XML dialogs should be using the markup for the widgets, and layouting directives, detailed in $FG_ROOT/Docs/README.gui and README.layout.
 
In addition to the features mentioned in those files there are some undocumented features, which can be found in the dialog building routines.
In general, all PUI/XML dialogs should be using the markup for the widgets, and layouting directives, detailed in $FG_ROOT/Docs/README.gui and README.layout
Internally, a dialog is just a property tree - it is read and loaded into the/a property tree and then further processed.
 
In addition to the features mentioned in those files there are some undocumented features, which can be found in the dialog building routines (C++ code).
 
Internally, a dialog is just a property tree - it is read and loaded into the/a property tree and then further processed (usually by C++ code).
 
This is accomplished using so called "fgcommands", which is the stuff that you'd typically add to menubar.xml to make a new dialog item known to the GUI.
This is accomplished using so called "fgcommands", which is the stuff that you'd typically add to menubar.xml to make a new dialog item known to the GUI.
Some of the more typical GUI related fgcommands are:
Some of the more typical GUI related fgcommands are:
* dialog-show
* dialog-show
* dialog-close
* dialog-close
Now, what is taking place internally is that dialogs may not only contain the known XML markup, but may also contain embedded Nasal code blocks.
Now, what is taking place internally is that dialogs may not only contain the known XML markup, but may also contain embedded Nasal code blocks.
There are really only two main ways to embed such code: at the dialog-level using nasal/open tags for code that is executed prior to showing a dialog that is already loaded from disk, and nasal/load blocks loaded per Canvas widget (the black area showing the ND texture).
There are really only two main ways to embed such code: at the dialog-level using nasal/open tags for code that is executed prior to showing a dialog that is already loaded from disk, and nasal/load blocks loaded per Canvas widget (the black area showing the ND texture).

Navigation menu