166
edits
No edit summary |
(Canvas GUI/MessageBox) |
||
Line 32: | Line 32: | ||
{{Template:Newsletter-article-start|{{{1|Canvas GUI: Layouting, Widgets and MessageBoxes}}}|By [[User:TheTom|TheTom]]}} | {{Template:Newsletter-article-start|{{{1|Canvas GUI: Layouting, Widgets and MessageBoxes}}}|By [[User:TheTom|TheTom]]}} | ||
=== Widgets and Layouting === | |||
[[File:Canvas GUI Demo Dialog.png|300px|thumb|Screen shot showing a simple [[Canvas GUI]] dialog with a handful of [[Canvas Widgets|Button Widgets]].]] | |||
Thanks to the recent work of Tom, the [[Canvas]] system now supports basic widgets and layouting, similar to the Qt [http://qt-project.org/doc/qt-5/layout.html Layouting System]. Using vertical and horizontal box layouts widgets can be placed and sized automatically within the available space. Together with standard widgets like buttons, checkboxes, labels and scroll areas, this is a large step forward in creating a modern, new GUI for FlightGear. | |||
For an example on how to use the new system see [[Howto:Creating a Canvas GUI dialog file]]. | |||
=== MessageBoxes === | |||
Based on the new widgets and layouts, [[Canvas MessageBox|Message Boxes]] provide a simple way to report information to the user or ask him simple questions with a standardized appearance. Selecting from a predefined set of icons and buttons showing a message can be as simple as: | |||
<syntaxhighlight lang="nasal"> | <syntaxhighlight lang="nasal"> | ||
canvas.MessageBox.information("Success", "The operation has successfully completed."); | canvas.MessageBox.information("Success", "The operation has successfully completed."); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Get more information on how to [[Canvas MessageBox|create Message Boxes on your own...]] | |||
< | <gallery mode=packed> | ||
Canvas-MessageBox-demo information.png|Reporting information | |||
Canvas-MessageBox-demo warning dont-show-again.png|Showing a warning (allowing the user to not get it reported the next time) | |||
</gallery> | |||
{{Template:Newsletter-article-start|{{{1|Preview: Aircraft Center - get it on the fly}}}|By [[User:TheTom|TheTom]] and [[User:Zakalawe|Zakalawe]]}} | {{Template:Newsletter-article-start|{{{1|Preview: Aircraft Center - get it on the fly}}}|By [[User:TheTom|TheTom]] and [[User:Zakalawe|Zakalawe]]}} |
edits