Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0"?>
- <!--
- This file is part of FlightGear, the free flight simulator
- http://www.flightgear.org/
- Copyright (C) 2009 Torsten Dreyer, Torsten (at) t3r _dot_ de
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
- -->
- <PropertyList>
- <name>about</name>
- <modal>false</modal>
- <layout>vbox</layout>
- <resizable>false</resizable>
- <default-padding>3</default-padding>
- <group>
- <layout>hbox</layout>
- <default-padding>1</default-padding>
- <empty>
- <stretch>true</stretch>
- </empty>
- <text>
- <label>About FlightGear</label>
- </text>
- <empty>
- <stretch>true</stretch>
- </empty>
- <button>
- <legend/>
- <key>Esc</key>
- <pref-width>16</pref-width>
- <pref-height>16</pref-height>
- <border>2</border>
- <binding>
- <command>dialog-close</command>
- </binding>
- </button>
- </group>
- <hrule/>
- <group>
- <layout>vbox</layout>
- <default-padding>5</default-padding>
- <group>
- <layout>hbox</layout>
- <empty>
- <stretch>true</stretch>
- </empty>
- <text>
- <label>FlightGear Flight Simulator VX.X.X</label>
- </text>
- <empty>
- <stretch>true</stretch>
- </empty>
- </group>
- <text>
- <label>(c) 1996-2013, the FlightGear Contributors</label>
- </text>
- <group>
- <layout>vbox</layout>
- <border>10</border>
- <halign>center</halign>
- <default-padding>2</default-padding>
- <text>
- <halign>left</halign>
- <label>FlightGear is free and open source software, licensed</label>
- </text>
- <text>
- <halign>left</halign>
- <label>under the GNU General Public License Version 2.</label>
- </text>
- <text>
- <halign>left</halign>
- <label>Get new versions, add-ons, forum, wiki and more</label>
- </text>
- <text>
- <halign>left</halign>
- <label>from the web-site at http://www.flightgear.org/ for free.</label>
- </text>
- <text>
- <halign>left</halign>
- <label>Have a nice flight!</label>
- </text>
- </group>
- <empty>
- <stretch>true</stretch>
- </empty>
- <hrule/>
- <text>
- <halign>center</halign>
- <label>Version Information</label>
- </text>
- <group>
- <layout>vbox</layout>
- <border>10</border>
- <halign>center</halign>
- <default-padding>2</default-padding>
- <text>
- <halign>left</halign>
- <label>MMMMMMMMMM</label>
- <format>FlightGear Version: %s</format>
- <property>/sim/version/flightgear</property>
- </text>
- <text>
- <halign>left</halign>
- <label>MMMMMMMMMM</label>
- <format>SimGear Version: %s</format>
- <property>/sim/version/simgear</property>
- </text>
- <text>
- <halign>left</halign>
- <label>MMMMMMMMMMMMMMMMMM</label>
- <format>OpenSceneGraph Version: %s</format>
- <property>/sim/version/openscenegraph</property>
- </text>
- <text>
- <halign>left</halign>
- <label>MMMMMMMMMMMMMMMMMM</label>
- <format>Build Id: %s</format>
- <property>/sim/version/build-id</property>
- </text>
- <text>
- <halign>left</halign>
- <label>MMMMMM</label>
- <format>Build Number: %d</format>
- <property>/sim/version/build-number</property>
- </text>
- <text>
- <halign>left</halign>
- <label>MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM</label>
- <format>Revision: %s</format>
- <property>/sim/version/revision</property>
- </text>
- </group>
- <empty>
- <stretch>true</stretch>
- </empty>
- <hrule/>
- <text>
- <halign>center</halign>
- <label>Graphics/OpenGL Information</label>
- </text>
- <group>
- <layout>vbox</layout>
- <border>10</border>
- <halign>center</halign>
- <default-padding>2</default-padding>
- <text>
- <halign>left</halign>
- <label>MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM</label>
- <format>OpenGL Vendor: %s</format>
- <property>/sim/rendering/gl-vendor</property>
- </text>
- <text>
- <halign>left</halign>
- <label>MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM</label>
- <format>OpenGL Renderer: %s</format>
- <property>/sim/rendering/gl-renderer</property>
- </text>
- <text>
- <halign>left</halign>
- <label>MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM</label>
- <format>OpenGL Version: %s</format>
- <property>/sim/rendering/gl-version</property>
- </text>
- <text>
- <halign>left</halign>
- <label>MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM</label>
- <format>GLSL Version: %s</format>
- <property>/sim/rendering/gl-shading-language-version</property>
- </text>
- <text>
- <halign>left</halign>
- <label>MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM</label>
- <format>Max Texture Size: %s</format>
- <property>/sim/rendering/max-texture-size</property>
- </text>
- <text>
- <halign>left</halign>
- <label>MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM</label>
- <format>Depth Buffer Bits: %s</format>
- <property>/sim/rendering/depth-buffer-bits</property>
- </text>
- </group>
- </group>
- <hrule/>
- <group>
- <layout>hbox</layout>
- <halign>fill</halign>
- <empty><stretch>true</stretch></empty>
- <button>
- <legend>ChgBg</legend>
- <equal>true</equal>
- <default>true</default>
- <key>Esc</key>
- <binding>
- <command>nasal</command>
- <script>MyApp.chgbg('#0000FF00');</script>
- </binding>
- </button>
- <button>
- <legend>Test</legend>
- <equal>true</equal>
- <default>false</default>
- <binding>
- <command>nasal</command>
- <script>MyApp.create();</script>
- </binding>
- </button>
- <button>
- <legend>MyApp.del</legend>
- <equal>true</equal>
- <default>false</default>
- <binding>
- <command>nasal</command>
- <script>MyApp.delete();</script>
- </binding>
- </button>
- <button>
- <legend>Copy to Clipboard</legend>
- <equal>true</equal>
- <default>false</default>
- <binding>
- <command>nasal</command>
- <script><![CDATA[
- var properties = ["gl-vendor","gl-version","gl-renderer", "gl-shading-language-version"];
- var data = "";
- var path = "/sim/rendering/";
- foreach(var p; properties)
- data ~= p ~":"~getprop(path~p) ~"\n";
- clipboard.setText(data);
- gui.popupTip("Copied version information to clipboard!");
- ]]></script>
- </binding>
- </button>
- <empty><stretch>true</stretch></empty>
- </group>
- <nasal>
- <open><![CDATA[
- # Replace version in Nasal, as using the <format> code upsets layout
- var ver = cmdarg().getNode("group[1]/group/text/label");
- ver.setValue("FlightGear Flight Simulator V" ~ getprop("/sim/version/flightgear"));
- # below is a piece of test code.
- var dum = {} ;
- var menubar = {};
- var sidebar = {};
- var plot = {};
- var Button = {
- Me: 0,
- B1: 0,
- new: func {
- me.Me = { parents: [Button] };
- return me.Me;
- },
- create: func (bar,x,y,w,h) {
- me.B1 = bar.createChild("path")
- .moveTo(x, y)
- .vertTo(y + h)
- .horizTo(x + w)
- .vertTo(y)
- .horizTo(x)
- .close()
- .setColor(0,0,0)
- .setColorFill(0.8,0.8,0.8)
- .setStrokeLineWidth(1);
- print("Button created.");
- return me.Me;
- },
- color: func (cl) {
- me.B1.setColorFill(cl);
- print("ButtonColor set");
- return me.Me;
- },
- addhandler: func (Ev,Act) {
- me.B1.addEventListener(Ev, Act );
- return me.Me;
- },
- };
- var Box = {
- trp: 0,
- Me: 0,
- B1: 0,
- T1: 0,
- W: 0,
- H: 0,
- new: func {
- me.Me = { parents: [Box] };
- return me.Me;
- },
- create: func(root,bar,x,y,w,h) {
- me.H = h;
- me.W = w;
- me.B1 = bar.createChild("path")
- .moveTo(x, y)
- .vertTo(y + h)
- .horizTo(x + w)
- .vertTo(y)
- .horizTo(x)
- .close()
- .setColorFill(0.5,0.5,0.5,1)
- .setStrokeLineWidth(1);
- # This is going to be the resizer.
- # Maby much more code is needed.
- # Resizing the graph area , but not thicken the menubars.
- # me.B1.addEventListener("drag", func(e) {
- # root.set(size[0],me.W+e.deltaX); # size[] x, y , w , h ?
- # root.set(size[1],me.H+e.deltaX);
- # });
- print("Box created.");
- return me.Me;
- },
- color: func (t) {
- me.B1.setColorFill(t);
- print("SetColor done.");
- return me.Me;
- },
- settitle: func (bar,t) {
- me.T1 = bar.createChild("text", "box-caption")
- .setText( t )
- .setTranslation(4,24)
- .setAlignment("left-top")
- .setFontSize(14)
- .setFont("LiberationFonts/LiberationSans-Bold.ttf")
- .setColor(0,1,0);
- print("Settitle done.");
- return me.Me;
- },
- settext: func (t) {
- me.T1.setText(t);
- print("Settext done.");
- return me.Me;
- },
- transparency: func () {
- if(me.trp) {
- me.B1.setColorFill(0.5,0.5,0.5,1);
- me.trp = 0;
- }else{
- me.B1.setColorFill(0.5,0.5,0.5,0.5);
- me.trp = 1;
- }
- print("Transparency done.");
- return me.Me;
- },
- addhandler: func (Ev,Act) {
- me.B1.addEventListener(Ev, Act );
- return me.Me;
- },
- };
- var Menubar = {
- B: 0,
- T: 0,
- Me: 0,
- new: func {
- me.Me = { parents: [Menubar] };
- return me.Me;
- },
- create: func(root,bar,x,y,w,h) {
- var rx = 8;
- var ry = 8;
- me.B = bar.createChild("path")
- .moveTo(x + w - rx, y)
- .arcSmallCWTo(rx, ry, 0, x + w, y + ry)
- .vertTo(y + h)
- .horizTo(x)
- .vertTo(y + ry)
- .arcSmallCWTo(rx, ry, 0, x + rx, y)
- .close()
- .setColorFill(0.8,0.8,0.8)
- .setStrokeLineWidth(1);
- me.B.addEventListener("drag", func(e) {
- root.move(e.deltaX, e.deltaY);
- });
- print("Menubar created.");
- return me.Me;
- },
- createtitle: func (bar,t) {
- me.T = bar.createChild("text", "dialog-caption")
- .setText(t)
- .setTranslation(4,4)
- .setAlignment("left-top")
- .setFontSize(14)
- .setFont("LiberationFonts/LiberationSans-Bold.ttf")
- .setColor(0,0,0);
- print("Createtitle done.");
- return me.Me;
- },
- settitle: func (t) {
- me.T.setText(t);
- print("Settitle done.");
- return me.Me;
- },
- addbutton: func (bar,graph,x,y,w,h) {
- var Child = Button.new();
- Child.create(bar,graph,x,y,w,h);
- print("AddButton done.");
- return Child;
- },
- };
- var Xline = {
- Me: 0,
- new: func () {
- me.Me = { parents: [Xline] };
- return me.Me;
- },
- start: func (bar,x,w,h,Th) {
- bar.createChild("path")
- .moveTo(0,0)
- .lineTo(w,0)
- .setColor(0,0,0)
- .setTranslation(x,Th-h/2);
- return me.Me;
- },
- };
- var _plot = {
- Me: 0,
- lines: 0,
- running: 0,
- new: func () {
- me.Me = { parents: [_plot] };
- return me.Me;
- },
- do_plot: func () {
- return me.Me;
- },
- add: func () {
- print("adding property to plot.");
- return me.Me;
- },
- run: func () {
- me.do_Plot();
- return me.Me;
- },
- start: func () {
- me.running=1;
- print("graph running.");
- return me.Me;
- },
- stop: func () {
- me.running=0;
- print("graph paused.");
- return me.Me;
- },
- };
- var _App = {
- x: 200,
- y: 200,
- width:400,
- height:300,
- mbwidth:400,
- mbheight: 20,
- sbwidth: 20,
- sbheight:280,
- pwidth: 380,
- pheight: 280,
- bg: '#00000000',
- hello: func {print("Hello world"); },
- info: func {
- print("x:",me.x, " y:", me.y, " width:", me.width, " height:", me.height);
- },
- create: func {
- var x = me.x;
- var y = me.y;
- var dlg = canvas.Window.new([me.width, me.height+me.mbheight]);
- var cnv = dlg.createCanvas()
- .setColorBackground(me.bg);
- cnv.addEventListener('wheel', func () { dlg.del();} );
- var root = cnv.createGroup();
- var mbr = root.createChild("group"); # All about menubar
- var grphB = root.createChild("group"); # The background of All,maby unneeded.
- var grph = root.createChild("group"); # All about plot
- plot["canvas"] = Box.new();
- plot["canvas"].create(dlg,grphB,
- me.sbwidth,me.mbheight,me.pwidth,me.pheight);
- plot["xline"] = Xline.new();
- plot["xline"].start(grph,me.sbwidth,me.pwidth,me.pheight,me.height);
- plot["line"] = _plot.new();
- print ( "type plot[0] : "~typeof(plot[0]));
- sidebar["side"] = Menubar.new();
- sidebar["side"].create(dlg,mbr,0,me.mbheight,me.sbwidth,me.sbheight);
- sidebar["start"] = Button.new();
- sidebar["start"].create(mbr,0,20,20,25);
- sidebar["start"].color("#0000FF");
- sidebar["start"].addhandler('click', dum[0] = func plot["line"].start());
- sidebar["stop"] = Button.new();
- sidebar["stop"].create(mbr,0,45,20,25);
- sidebar["stop"].color("#00FFFF");
- sidebar["stop"].addhandler('click', dum[0] = func plot["line"].stop());
- menubar["bar"] = Menubar.new();
- menubar["bar"].create(dlg,mbr,0,0,me.mbwidth,me.mbheight);
- menubar["title"] = menubar["bar"].createtitle(mbr,"Dyn.FgPlot");
- menubar["title"].settitle("My.FgPlot");
- menubar["chgtxt"] = Button.new();
- menubar["chgtxt"].create(mbr,80,0,25,me.mbheight);
- menubar["chgtxt"].addhandler('click', dum[0] = func menubar["title"].settitle("My.Oh.My"));
- menubar["chgtxt"].color('#00FF00');
- menubar["trnsp"] = Button.new();
- menubar["trnsp"].create(mbr,105,0,25,me.mbheight);
- print("after create : "~typeof(menubar["trnsp"]));
- menubar["trnsp"].addhandler('click', dum[0] = func plot["canvas"].transparency());
- menubar["trnsp"].color('#0000FF');
- menubar["addline"] = Button.new();
- menubar["addline"].create(mbr,130,0,25,me.mbheight);
- print("after create : "~typeof(menubar["addline"]));
- menubar["addline"].addhandler('click', dum[0] = func plot["line"].add());
- menubar["addline"].color('#880088');
- menubar["quit"] = Button.new();
- menubar["quit"].create(mbr,155,0,25,me.mbheight);
- print("after create : "~typeof(menubar["quit"]));
- menubar["quit"].addhandler('click', dum[0] = func dlg.del());
- menubar["quit"].color('#880000');
- print(typeof(menubar["quit"]));
- },
- chgbg: func (e) {
- me.bg = e ; cnv.setColorBackground(me.bg);
- },
- delete: func () {
- MyApp.del();
- },
- };
- var MyApp = { parents:[_App] };
- MyApp.hello();
- MyApp.info();
- #var listener_id = _setlistener("/sim/test/start", MyApp.hello(); );
- ]]></open>
- <close><![CDATA[
- ]]></close>
- </nasal>
- </PropertyList>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement