2,733
edits
(→Map) |
Red Leader (talk | contribs) m (Reverted edits by Hooray (talk) to last revision by Red Leader) |
||
Line 12: | Line 12: | ||
}}</ref> | }}</ref> | ||
For the time being, this approach has a number of major advantages, i.e. it has proven to be able to deal with existing | For the time being, this approach has a number of major advantages, i.e. it has proven to be able to deal with existing resources, without the original legacy UI dialogs having to be touched/modified, so that the primary thing missing to parse/process these dialogs are a handful of missing Canvas widgets. | ||
As the integrated, and fully script-able, [[Canvas GUI]] develops, new {{wikipedia|Widget (GUI)|widgets}} need to be added <ref>{{cite web | As the integrated, and fully script-able, [[Canvas GUI]] develops, new {{wikipedia|Widget (GUI)|widgets}} need to be added <ref>{{cite web | ||
Line 36: | Line 33: | ||
For a complete list (including custom/undocumented widgets), refer to <code>FGPUIDialog::makeObject()</code> in {{flightgear file|src/GUI/FGPUIDialog.cxx|l=850}} | For a complete list (including custom/undocumented widgets), refer to <code>FGPUIDialog::makeObject()</code> in {{flightgear file|src/GUI/FGPUIDialog.cxx|l=850}} | ||
In addition, FlightGear introduces a number of custom PUI widgets implemented in C++ space, that not even PUI itself supports directly | In addition, FlightGear introduces a number of custom PUI widgets implemented in C++ space, that not even PUI itself supports directly. | ||
However, many PUI widgets can be emulated/approximated by using a combination of existing widgets, and/or functionality found in existing wigets. | |||
However, many PUI widgets can be emulated/approximated by using a combination of existing widgets, and/or functionality found in existing | |||
As of late June 2016, the following widgets are primarily needed to help getting rid of PUI (listed in ascending complexity): | As of late June 2016, the following widgets are primarily needed to help getting rid of PUI (listed in ascending complexity): | ||
* {{PUI widget|vrule}} (not critical, could be implemented OpenVG or simply by using a transparent image) | * {{PUI widget|vrule}} (not critical, could be implemented OpenVG or simply by using a transparent image) | ||
* {{PUI widget|hrule}} (not critical, could be implemented OpenVG or simply by using a transparent image) | * {{PUI widget|hrule}} (not critical, could be implemented OpenVG or simply by using a transparent image) | ||
* {{PUI widget|radio}} (Canvas images using event handling | * {{PUI widget|radio}} (Canvas images using event handling) | ||
* {{PUI widget|slider}} (basically 3 buttons with the middle button supporting dragging, see also [https://forum.flightgear.org/viewtopic.php?f=71&t=19975]) | * {{PUI widget|slider}} (basically 3 buttons with the middle button supporting dragging, see also [https://forum.flightgear.org/viewtopic.php?f=71&t=19975]) | ||
* {{PUI widget|dial}} (see also [https://forum.flightgear.org/viewtopic.php?f=71&t=19975]) | * {{PUI widget|dial}} (see also [https://forum.flightgear.org/viewtopic.php?f=71&t=19975]) | ||
Line 53: | Line 46: | ||
The key ones really being the last 4 in that list (radio, slider, dial and combo/dropdown) | The key ones really being the last 4 in that list (radio, slider, dial and combo/dropdown) | ||
Most other widgets currently missing can be implemented by using a combination of these widgets, e.g. a ScrollArea with buttons can be used to implement any type of list (airportlist, waypointlist, property-browser etc) | Most other widgets currently missing can be implemented by using a combination of these widgets, e.g. a ScrollArea with buttons can be used to implement any type of list (airportlist, waypointlist, property-browser etc) | ||
However, once these basic widgets are supported, additional FlightGear/flight simulation specific widgets may be implemented, e.g. for picking a frequency, heading/course etc (see [[UI_Unification#Widget_tags]]). | |||
A new Canvas widget will have two parts to it. | |||
The first provides the background code and the APIs for that widget. The second defines the appearance of the widget, i.e. its style. | |||
== Widget.nas == | == Widget.nas == | ||
Line 84: | Line 74: | ||
== Part one == | == Part one == | ||
The first part is a Nasal file in {{fg root file|path=Nasal/canvas/gui/widgets}}, e.g., . They must follow the basic structure of the example below, replacing | The first part is a Nasal file in {{fg root file|path=Nasal/canvas/gui/widgets}}, e.g., . They must follow the basic structure of the example below, replacing | ||
{{Canvas Widget Template|name=myWidget}} | {{Canvas Widget Template|name=myWidget}} | ||
Line 128: | Line 114: | ||
== Examples == | == Examples == | ||
=== Implementing a hrule widget === | === Implementing a hrule widget === | ||
Line 180: | Line 164: | ||
* <code>scrollTo()</code> | * <code>scrollTo()</code> | ||
* ... | * ... | ||
[[Category:Canvas GUI]] | [[Category:Canvas GUI]] |