Canvas widgets: Difference between revisions

Jump to navigation Jump to search
2,049 bytes removed ,  24 June 2014
no edit summary
m (→‎Dialog Parser: remove more obsolete stuff ... still surprising how this article got 35+k views ... =))
No edit summary
Line 38: Line 38:
In addition, by using the canvas system for GUI widgets, it would also be possible to render aircraft instruments, MFDs, HUDs etc WITHIN GUI dialogs, too.
In addition, by using the canvas system for GUI widgets, it would also be possible to render aircraft instruments, MFDs, HUDs etc WITHIN GUI dialogs, too.


== Status (08/2012) ==
== Status (06/2014) ==
<font color="red">'''Known feature:'''The canvas gui always handles the events first and only if no window was hit it gets forwarded to scenery picks and PUI dialogs. Which means that PUI (old) dialogs rendered on top of new canvas windows, will not receive their GUI events currently.</font>
{{warning|The canvas gui always handles events first and only if no window was hit forwards events to scenery picks and PUI dialogs. Which means that PUI (old) dialogs rendered on top of new canvas windows, will not receive their GUI events currently. With FlightGear 3.1+ this is no problem anymore, as Canvas windows are drawn on top of PUI dialogs to match the rendering order and the event handling order.}}
 
As of 08/2012, the event handling system is being worked on. Once that is completed, it should be possible to reimplement a dialog/xml parser which maps the various supported widgets ([[$FG_ROOT]]/Docs/README.gui) to new canvas widgets (button, checkbox, label, textbox etc), so that these can be implemented step by step in order to phase out PUI usage (which will also require re-implementing the current layout manager in Nasal).


* '''TheTom''' (05/2013): "I'm still not completely sure how to implement the GUI, but currently I'm thinking of something similar to most available UI toolkits with mainly using images together with 9-scale/slicing. Theming would be possible by simply exchanging the images and/or modulate them with a color. For some icons/elements also SVG could be used, and maybe I'll implement the possibility to cache rendered images of SVG elements for faster rendering of them." [http://forum.flightgear.org/viewtopic.php?f=71&t=19850#p182509]
* '''TheTom''' (05/2013): "I'm still not completely sure how to implement the GUI, but currently I'm thinking of something similar to most available UI toolkits with mainly using images together with 9-scale/slicing. Theming would be possible by simply exchanging the images and/or modulate them with a color. For some icons/elements also SVG could be used, and maybe I'll implement the possibility to cache rendered images of SVG elements for faster rendering of them." [http://forum.flightgear.org/viewtopic.php?f=71&t=19850#p182509]
* '''TheTom''': (30/07/2012) I have now pushed some updates to my branch. It is now possible to create windows (texture rectangles) with just using the property tree and place a canvas texture onto it. Mouse events are passed to the active window (=the window the cursor is hovering over, or for dragging the window where the drag gesture started) and can be handled from Nasal or anything else that has access to the property tree.
* '''TheTom''': (30/07/2012) I have now pushed some updates to my branch. It is now possible to create windows (texture rectangles) with just using the property tree and place a canvas texture onto it. Mouse events are passed to the active window (=the window the cursor is hovering over, or for dragging the window where the drag gesture started) and can be handled from Nasal or anything else that has access to the property tree.
* '''TheTom''': "As of 07/2012, most things for building a GUI should be already available."
* '''TheTom''': "Maybe with some advanced formatting possibilities even syntax highlighting will be possible."


{{#ev:youtube|1a6wtPVPWc4}}
{{#ev:youtube|1a6wtPVPWc4}}
Line 52: Line 48:
{{#ev:youtube|Qv-uEX42QZY}}
{{#ev:youtube|Qv-uEX42QZY}}
{{#ev:youtube|llVaasTEf44}}
{{#ev:youtube|llVaasTEf44}}
* '''TheTom''': "I think the canvas is now reaching a pretty usable state so maybe it's time for some more documentation, tutorials etc."
=== Completed ===
* <del>Improve PUI to allow eg. receiving mouse over events.</del> (osgGA will be used) {{Done}}
* '''[[Canvas Properties#Images: Static Textures & Cascaded Canvases  (Pending)|Support images inside Canvas]]''' (will also be needed for implementing the 2D panel wrapper): We need a new element type to also display images and other textures (eg. also the texture of another canvas) inside a canvas. Not everything can easily be represented using just vector graphics, so images will also be needed. This is going to be worked on as part of porting the 2D panel system over to Canvas {{Done}}
* '''Window Stacking''': New windows always appear on top of older windows. It would be nice to have the possibility to change stacking order (either reorder the windows or use z-buffer with different z-values) The window manager could eg. listen on a special signal property on each window (eg. /sim/gui/canvas/window[i]/raise) which moves the according window to the top of the current window stack. I'd prefer window reordering because it would make checking for a window at a given position very ease, because we'd just have to check for the first match in revers stacking order (from topmost to lowest window).{{Done}}
* '''[[#Multiplatform Clipboard Support (native Copy/Paste) |Support copy&paste]]''': Tom is working on the selection part and copy/paste support {{Done}}


=== Missing / Todo ===
=== Missing / Todo ===
166

edits

Navigation menu