Canvas widgets: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 10: Line 10:
Using canvas widgets, it will be possible to create your own GUI styles and even completely new, fully interactive, GUI controls (buttons, text boxes, list views, tree views etc) just by using Nasal, without touching any C++ code and without rebuilding FlightGear. The Canvas system supports loading SVG files and raster images, so that canvas elements and GUI widgets can be assembled from SVG elements, meaning that you'll  be able to use a conventional SVG editor like Inkscape to create/edit FlightGear GUI widgets.
Using canvas widgets, it will be possible to create your own GUI styles and even completely new, fully interactive, GUI controls (buttons, text boxes, list views, tree views etc) just by using Nasal, without touching any C++ code and without rebuilding FlightGear. The Canvas system supports loading SVG files and raster images, so that canvas elements and GUI widgets can be assembled from SVG elements, meaning that you'll  be able to use a conventional SVG editor like Inkscape to create/edit FlightGear GUI widgets.


{{FGCquote
  |It should be possible to create any type of widget/layouting. Currently there are two possiblities:<br/>
<br/>
1. Fixed layouting: define the position and size of any element on your own. Eg. load an SVG representing your widget and modify text, icons, etc. according to windspeed, etc.<br/>
2. Automatic layouting: create different widgets and layouts, and let the layout engine distribute the available space according to some policies. It works nearly the same as [http://qt-project.org/doc/qt-5/layout.html layouts in Qt]. Currently vertical and horizontal box layouts, stretch factor, spacers and some basic widgets (buttons, label/image, checkbox, scroll area) are supported.<br/>
<br/>
If you don't know how to implement a certain type of widget/gui/dialog just tell me what you want to achieve and I will tell you what you need to too, or I will implement what is missing. Now it's a good point helping to shape the API
  |{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=213591#p213591
    |title=<nowiki>Re: Using Canvas  to create a weather editor ? (split)</nowiki>
    |author=<nowiki>TheTom</nowiki>
    |date=<nowiki>Fri Jun 27</nowiki>
  }}
}}


== The Idea ==
== The Idea ==

Navigation menu