<?xml version="1.0"?>

<PropertyList>
	<name>range-dialog</name>
	<x>-1344</x>
	<y>2</y>
	<layout>hbox</layout>
	<default-padding>2</default-padding>

  <canvas>
      <name>range</name>
      <valign>fill</valign>
      <halign>fill</halign>
      <stretch>true</stretch>
      <pref-width>230</pref-width>
      <pref-height>100</pref-height>
      <nasal>      
          <load>
              <![CDATA[
              var my_canvas = canvas.get( cmdarg() );

              var root = my_canvas.createGroup();
              var text = root.createChild("text")
                  .setText("0")
                  .setTranslation(20, 20)
                  .setAlignment("left-top")
                  .setFontSize(30)
                  .setFont("LiberationFonts/LiberationSans-Regular.ttf")
                  .set("max-width", 230)
                  .setColor(1,1,1);

              var range_loop = func { 
                  text.setText("Flag One " ~ sprintf("%4.0f", getprop("/sim/models/distance-to-flag-one"))~"\n"~ 
                  "Flag Two " ~ sprintf("%4.0f", getprop("/sim/models/distance-to-flag-two")));
              }

              var range_timer = maketimer(0.25, func{range_loop()});
              range_timer.start();

              ]]>
          </load>
          <unload>
              range_timer.stop();
          </unload>
      </nasal>
  </canvas>
  </PropertyList>
