Canvas GUI: Difference between revisions

Jump to navigation Jump to search
705 bytes removed ,  4 January 2016
→‎PUI Widgets: Update to new wiki templates
m (→‎PUI Widgets: PUI widgets in FlightGear are still being maintained apparently ...)
(→‎PUI Widgets: Update to new wiki templates)
Line 74: Line 74:
<syntaxhighlight lang="nasal">
<syntaxhighlight lang="nasal">
var dlg = canvas.Window.new([400,300], "dialog")
var dlg = canvas.Window.new([400,300], "dialog")
                                    .set("title", "My Canvas Dialog...");
    .set("title", "My Canvas Dialog");
</syntaxhighlight>
</syntaxhighlight>


Line 81: Line 81:
Implementing all our existing PUI/XML-based dialogs is almost certainly going to be more work than providing a Nasal-space migration path/wrapper that reads the old dialogs and turns them into "modern" canvas windows, possibly by just overwriting the dialog-show fgcommand via the new removecommand/addcommand APIs. And phasing out canvas widget should be fairly straightforward too, because those can be directly mapped to embedded/nested canvas textures, so I wouldn't worry too much ...
Implementing all our existing PUI/XML-based dialogs is almost certainly going to be more work than providing a Nasal-space migration path/wrapper that reads the old dialogs and turns them into "modern" canvas windows, possibly by just overwriting the dialog-show fgcommand via the new removecommand/addcommand APIs. And phasing out canvas widget should be fairly straightforward too, because those can be directly mapped to embedded/nested canvas textures, so I wouldn't worry too much ...


All standard widgets (textbox, label, radio button, checkbox etc) can be provided by a Nasal parser that turns the existing GUI XML into canvas widgets - our hard-coded widgets however, need to be separately re-implemented. Here's a list of custom, hardcoded, PUI widgets which we will need to re-implement using the Canvas, based on [https://gitorious.org/fg/flightgear/trees/next/src/GUI $FG_SRC/GUI]:
All standard widgets (textbox, label, radio button, checkbox etc) can be provided by a Nasal parser that turns the existing GUI XML into canvas widgets our hard-coded widgets however, need to be separately re-implemented. Here's a list of custom, hardcoded, PUI widgets which we will need to re-implement using the Canvas, usually located in {{flightgear file|src/GUI}}:


* [https://gitorious.org/fg/flightgear/blobs/next/src/GUI/MapWidget.cxx map widget] see [[MapStructure]]) <font color="red">porting should probably be prioritized, because we keep seeing additions to the PUI/C++ widget despite the canvas:</font>
* {{flightgear file|src/GUI/MapWidget.cxx|t=map widget}} (see [[MapStructure]])
** [http://gitorious.org/fg/flightgear/commit/433af2b51a3bcec7488ac2fbf94b8edfc1e1cb43 Flight-path-history.] (expose the flight recorder/replay buffers via cppbind)
** {{flightgear commit|433af2}} (expose the flight recorder/replay buffers via cppbind)
** [http://gitorious.org/fg/flightgear/commit/11c00afaec8836a5f52bcf8832ff2d50e2f11523 Add support for helipads from apt.dat 850+]
** {{flightgear commit|11c00a}} (add support for helipads from apt.dat 850+)
** [http://gitorious.org/fg/flightgear/commit/6bf47cd248ed388e6a4dd3ffa2d00977b00b62fb MapWidget: make use of the new POI system and display cities on the map. This is meant as a preview.]
** {{flightgear commit|6bf47c}} (MapWidget: make use of the new POI system and display cities on the map. This is meant as a preview.)
** [http://gitorious.org/fg/flightgear/commit/658bda6e40da65c317fd387ed1a2fcf628e7ed1b MapWidget: Show counties and towns as well, depending on the zoom. Some colors added.]
** {{flightgear commit|658bda}} (MapWidget: Show counties and towns as well, depending on the zoom. Some colors added.)
** [http://gitorious.org/fg/flightgear/commit/38a373ba845d2bbea920cbcff90be5dc33040fe5 Display AI traffic route in map. Add some helpers so MapWidget can show the origin and destination of AIAircraft with a FlightPlan.]
** {{flightgear commit|38a373}} (Display AI traffic route in map. Add some helpers so MapWidget can show the origin and destination of AIAircraft with a FlightPlan.)
* [https://gitorious.org/fg/flightgear/blobs/next/src/GUI/FGPUIDialog.cxx#line169 loglist] {{progressbar|70}}
* {{flightgear file|src/GUI/FGPUIDialog.cxx|l=169|t=loglist}} {{progressbar|70}}
** Required APIs: logbuffer needs to be exposed to Nasal via cppbind
** Required APIs: logbuffer needs to be exposed to Nasal via cppbind
** http://sourceforge.net/p/flightgear/flightgear/ci/7afedb1702829b244fcf998391a83833efee7f01/
* {{flightgear file|src/GUI/WaypointList.cxx|l=169|t=waypoint list}}
** http://sourceforge.net/p/flightgear/flightgear/ci/846fd2169832c8938f04386139de746a06e80d4b/
** {{flightgear commit|7afedb}}
* [https://gitorious.org/fg/flightgear/blobs/next/src/GUI/AirportList.cxx airport list]
** {{flightgear commit|846fd2}}
* {{flightgear file|src/GUI/AirportList.cxx|t=airport list}}
** Required APIs: extended NasalPositioned API
** Required APIs: extended NasalPositioned API
* [https://gitorious.org/fg/flightgear/blobs/next/src/GUI/WaypointList.cxx waypoint list]
* {{flightgear file|src/GUI/WaypointList.cxx|t=waypoint list}}
** Required APIs: extended NasalPositioned API
** Required APIs: extended NasalPositioned API
* [https://gitorious.org/fg/flightgear/blobs/next/src/GUI/property_list.cxx property list]
* {{flightgear file|src/GUI/property_list.cxx|t=property list}}
* [https://gitorious.org/fg/flightgear/blobs/next/src/GUI/PUIFileDialog.cxx file dialog]
* {{flightgear file|src/GUI/PUIFileDialog.cxx|t=file dialog}}
* [https://gitorious.org/fg/flightgear/blobs/next/src/GUI/menubar.cxx menubar]
* {{flightgear file|src/GUI/menubar.cxx|t=menubar}} (see [[Howto:Making a Canvas Menubar]])
 


In order to re-implement these using the Canvas system, we need to identify Nasal APIs that are currently missing, and which need to be provided via the cppbind framework.
In order to re-implement these using the Canvas system, we need to identify Nasal APIs that are currently missing, and which need to be provided via the cppbind framework.


This way, C++ developers can concentrate on providing the missing Nasal/C++ hooks, whereas Nasal developers can provide the required widgets.
This way, C++ developers can concentrate on providing the missing Nasal/C++ hooks, whereas Nasal developers can provide the required widgets.

Navigation menu