2,733
edits
m (→PUI Widgets: PUI widgets in FlightGear are still being maintained apparently ...) |
Red Leader (talk | contribs) (→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"); | |||
</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 | 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}}: | ||
* | * {{flightgear file|src/GUI/MapWidget.cxx|t=map widget}} (see [[MapStructure]]) | ||
** | ** {{flightgear commit|433af2}} (expose the flight recorder/replay buffers via cppbind) | ||
** | ** {{flightgear commit|11c00a}} (add support for helipads from apt.dat 850+) | ||
** | ** {{flightgear commit|6bf47c}} (MapWidget: make use of the new POI system and display cities on the map. This is meant as a preview.) | ||
** | ** {{flightgear commit|658bda}} (MapWidget: Show counties and towns as well, depending on the zoom. Some colors added.) | ||
** | ** {{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.) | ||
* | * {{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 | ||
* | * {{flightgear file|src/GUI/WaypointList.cxx|l=169|t=waypoint list}} | ||
** | ** {{flightgear commit|7afedb}} | ||
* | ** {{flightgear commit|846fd2}} | ||
* {{flightgear file|src/GUI/AirportList.cxx|t=airport list}} | |||
** Required APIs: extended NasalPositioned API | ** Required APIs: extended NasalPositioned API | ||
* | * {{flightgear file|src/GUI/WaypointList.cxx|t=waypoint list}} | ||
** Required APIs: extended NasalPositioned API | ** Required APIs: extended NasalPositioned API | ||
* | * {{flightgear file|src/GUI/property_list.cxx|t=property list}} | ||
* | * {{flightgear file|src/GUI/PUIFileDialog.cxx|t=file dialog}} | ||
* | * {{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. |