Canvas widgets: Difference between revisions

Jump to navigation Jump to search
m
m (→‎Picking & Widget Callbacks {{Pending}}: http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg37907.html)
Line 19: Line 19:


== The Plan ==
== The Plan ==
Currently (07/2012) only drawing inside an existing (PUI) dialog is possible, but
* <del> Currently (07/2012) only drawing inside an existing (PUI) dialog is possible, but the idea is to slowly implement the current functionally in Nasal and get rid of the hardcoded PUI widgets. Only some code for mouse/keyboard interaction with Nasal will be needed.</del> {{Done}}
the idea is to slowly implement the current functionally in Nasal and
get rid of the hardcoded PUI widgets. Only some code for mouse/keyboard
interaction with Nasal will be needed.


In contrary to using some hardcoded GUI system (PUI, osgWidget, etc.)
In contrary to using some hardcoded GUI system (PUI, osgWidget, etc.) this approach would give much more flexibility and also the means of modifying and creating new widgets without the need to touch any core code.
this approach would give much more flexibility and also the means of
modifying and creating new widgets without the need to touch any core code.


With the Canvas system every type of widget would be possible, so that
With the Canvas system every type of widget would be possible, so that also things like submenus can be realized.
also things like submenus can be realized.


Another advantage of the Canvas approach is that it is heavily using the
Another advantage of the Canvas approach is that it is heavily using the property tree and therefore is already fully accessible from Nasal code and also configurable with the existing xml formats. [http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg37861.html]
property tree and therefore is already fully accessible from Nasal code
and also configurable with the existing xml formats. [http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg37861.html]


The point of the canvas widget demo is to demonstrate how powerful and flexible the new canvas system really is, i.e. it cannot just be used for aircraft scripting (instruments, MFDs), but also for GUI scripting - which means that using the canvas system would unify the 2D rendering backend (all 2D rendering can be handled via canvas), while reducing the amount of C++ code we have doing these things, which would mean that the GUI system could be entirely maintained in scripting space, i.e. as part of the base package, by people who don't need to know C++ - some basic Nasal knowledge will do.
The point of the canvas widget demo is to demonstrate how powerful and flexible the new canvas system really is, i.e. it cannot just be used for aircraft scripting (instruments, MFDs), but also for GUI scripting - which means that using the canvas system would unify the 2D rendering backend (all 2D rendering can be handled via canvas), while reducing the amount of C++ code we have doing these things, which would mean that the GUI system could be entirely maintained in scripting space, i.e. as part of the base package, by people who don't need to know C++ - some basic Nasal knowledge will do.

Navigation menu