summaryrefslogtreecommitdiff
path: root/app/lib/demos
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-12-28 16:52:56 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-12-28 16:52:56 +0100
commit7b358424ebad9349421acd533c2fa1cbf6cf3e3e (patch)
tree686678532eefed525c242fd214d0cfb2914726c5 /app/lib/demos
Initial import of xtrkcad version 1:4.0.2-2
Diffstat (limited to 'app/lib/demos')
-rw-r--r--app/lib/demos/CMakeLists.txt5
-rw-r--r--app/lib/demos/dmadjend.xtr643
-rw-r--r--app/lib/demos/dmbench.xtr70
-rw-r--r--app/lib/demos/dmcancel.xtr112
-rw-r--r--app/lib/demos/dmcircle.xtr51
-rw-r--r--app/lib/demos/dmconn1.xtr230
-rw-r--r--app/lib/demos/dmconn2.xtr242
-rw-r--r--app/lib/demos/dmcrvtrk.xtr96
-rw-r--r--app/lib/demos/dmctlpnl.xtr891
-rw-r--r--app/lib/demos/dmdelund.xtr80
-rw-r--r--app/lib/demos/dmdialog.xtr36
-rw-r--r--app/lib/demos/dmdimlin.xtr165
-rw-r--r--app/lib/demos/dmease.xtr72
-rw-r--r--app/lib/demos/dmelev.xtr357
-rw-r--r--app/lib/demos/dmexcept.xtr89
-rw-r--r--app/lib/demos/dmextend.xtr69
-rw-r--r--app/lib/demos/dmflip.xtr190
-rw-r--r--app/lib/demos/dmgroup.xtr467
-rw-r--r--app/lib/demos/dmhelix.xtr193
-rw-r--r--app/lib/demos/dmhndld.xtr111
-rw-r--r--app/lib/demos/dmintro.xtr79
-rw-r--r--app/lib/demos/dmjcir.xtr240
-rw-r--r--app/lib/demos/dmjnabut.xtr59
-rw-r--r--app/lib/demos/dmjncs.xtr64
-rw-r--r--app/lib/demos/dmjnmove.xtr51
-rw-r--r--app/lib/demos/dmjnss.xtr61
-rw-r--r--app/lib/demos/dmjntt.xtr175
-rw-r--r--app/lib/demos/dmlines.xtr223
-rw-r--r--app/lib/demos/dmlines2.xtr197
-rw-r--r--app/lib/demos/dmmouse.xtr210
-rw-r--r--app/lib/demos/dmmovabt.xtr75
-rw-r--r--app/lib/demos/dmnotes.xtr43
-rw-r--r--app/lib/demos/dmparall.xtr183
-rw-r--r--app/lib/demos/dmplymod.xtr76
-rw-r--r--app/lib/demos/dmprof.xtr330
-rw-r--r--app/lib/demos/dmrescal.xtr180
-rw-r--r--app/lib/demos/dmrotate.xtr504
-rw-r--r--app/lib/demos/dmruler.xtr46
-rw-r--r--app/lib/demos/dmselect.xtr412
-rw-r--r--app/lib/demos/dmsplit.xtr100
-rw-r--r--app/lib/demos/dmstrtrk.xtr31
-rw-r--r--app/lib/demos/dmtbledg.xtr213
-rw-r--r--app/lib/demos/dmtodes.xtr52
-rw-r--r--app/lib/demos/dmtosel.xtr283
-rw-r--r--app/lib/demos/dmtotrim.xtr96
-rw-r--r--app/lib/demos/dmtoyard.xtr204
-rw-r--r--app/lib/demos/dmtrkwid.xtr136
-rw-r--r--app/lib/demos/dmtrntab.xtr26
48 files changed, 8518 insertions, 0 deletions
diff --git a/app/lib/demos/CMakeLists.txt b/app/lib/demos/CMakeLists.txt
new file mode 100644
index 0000000..712902c
--- /dev/null
+++ b/app/lib/demos/CMakeLists.txt
@@ -0,0 +1,5 @@
+FILE(GLOB DEMO_FILES *.xtr)
+INSTALL(
+ FILES ${DEMO_FILES}
+ DESTINATION ${XTRKCAD_SHARE_INSTALL_DIR}/demos
+ )
diff --git a/app/lib/demos/dmadjend.xtr b/app/lib/demos/dmadjend.xtr
new file mode 100644
index 0000000..5e918fa
--- /dev/null
+++ b/app/lib/demos/dmadjend.xtr
@@ -0,0 +1,643 @@
+VERSION 2
+DEMOINIT
+ORIG 8.000 0.000 0.000
+STRAIGHT 1 DEMO 1
+ E 16.166667 2.333333 260.498723
+ E 36.083333 5.666667 80.498723
+ END
+TURNOUT 2 DEMO 1 14.750000 9.333333 -16.389478 "Peco-55 Medium Right SL-E395F"
+ E 14.750000 9.333333 253.610522
+ E 19.935373 10.858435 73.610522
+ E 20.049085 10.347771 83.296522
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0 0.000000 0.000000 0.353000 0.000000
+ S 0 0 0.353000 0.000000 5.405000 0.000000
+ C 0 0 23.136000 0.351000 -23.136000 0.004000 9.700000
+ S 0 0 4.251000 -0.331000 5.370000 -0.522000
+ END
+CURVE 3 DEMO 1 7.500000 8.333333 6.000000
+ E 13.500000 8.333333 0.000076
+ E 7.499984 2.333333 270.000000
+ END
+REDRAW
+RESET
+MESSAGE
+The unconnected End-Points of a straight or curved track can be changed with the 'Modify Track' command.
+END
+STEP
+COMMAND Modify
+MOUSE 2 35.917 5.917
+MESSAGE
+_________________________________________
+
+The End-Point of a straight track is selected and then Left-Dragged to change its length.
+END
+BIGPAUSE
+MOUSE 3 35.833 5.917
+MOUSE 3 36.750 6.167
+PAUSE 1000
+MOUSE 3 36.750 6.167
+MOUSE 3 16.750 2.750
+BIGPAUSE
+MESSAGE
+_________________________________________
+
+Watch what happens if you try to drag the selected End-Point beyond the far End-Point.
+
+The length of the straight track is determined by the distance from the far End-Point and the cursor.
+END
+BIGPAUSE
+MOUSE 3 16.167 2.667
+MOUSE 3 10.583 1.500
+PAUSE 820
+MOUSE 3 10.583 1.500
+MOUSE 4 34.333 5.917
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
+MESSAGE
+A curved track is selected and it's new End-Point is determined by the angle to the cursor.
+END
+STEP
+MOUSE 2 13.67 8.100
+PAUSE 500
+MOUSE 3 13.67 8.100
+PAUSE 50
+MOUSE 3 13.333 8.083
+PAUSE 60
+MOUSE 3 13.333 8.000
+PAUSE 50
+MOUSE 3 13.250 7.833
+PAUSE 60
+MOUSE 3 13.167 7.667
+PAUSE 50
+MOUSE 3 13.167 7.500
+PAUSE 60
+MOUSE 3 13.000 7.333
+PAUSE 50
+MOUSE 3 13.000 7.167
+PAUSE 60
+MOUSE 3 12.833 6.917
+PAUSE 50
+MOUSE 3 12.667 6.667
+PAUSE 60
+MOUSE 3 12.667 6.417
+PAUSE 50
+MOUSE 3 12.500 6.167
+PAUSE 60
+MOUSE 3 12.333 5.833
+PAUSE 50
+MOUSE 3 12.167 5.417
+PAUSE 60
+MOUSE 3 12.000 5.333
+PAUSE 50
+MOUSE 3 12.000 5.083
+PAUSE 60
+MOUSE 3 11.833 5.000
+PAUSE 50
+MOUSE 3 11.667 4.667
+PAUSE 60
+MOUSE 3 11.500 4.500
+MOUSE 3 11.333 4.333
+PAUSE 110
+MOUSE 3 11.333 4.167
+PAUSE 380
+MOUSE 3 11.333 4.250
+PAUSE 60
+MOUSE 3 11.333 4.333
+PAUSE 50
+MOUSE 3 11.333 4.417
+PAUSE 60
+MOUSE 3 11.500 4.500
+PAUSE 50
+MOUSE 3 11.583 4.667
+PAUSE 50
+MOUSE 3 11.750 5.000
+PAUSE 60
+MOUSE 3 11.917 5.083
+PAUSE 50
+MOUSE 3 12.000 5.333
+PAUSE 60
+MOUSE 3 12.167 5.417
+PAUSE 50
+MOUSE 3 12.250 5.667
+PAUSE 60
+MOUSE 3 12.333 5.750
+MOUSE 3 12.500 6.000
+PAUSE 50
+MOUSE 3 12.583 6.167
+PAUSE 110
+MOUSE 3 12.750 6.500
+MOUSE 3 12.917 6.833
+PAUSE 60
+MOUSE 3 13.083 7.083
+PAUSE 50
+MOUSE 3 13.167 7.333
+PAUSE 60
+MOUSE 3 13.250 7.417
+PAUSE 50
+MOUSE 3 13.333 7.667
+PAUSE 60
+MOUSE 3 13.333 7.833
+PAUSE 50
+MOUSE 3 13.417 8.083
+PAUSE 60
+MOUSE 3 13.500 8.333
+PAUSE 50
+MOUSE 3 13.500 8.667
+PAUSE 60
+MOUSE 3 13.500 9.000
+PAUSE 50
+MOUSE 3 13.500 9.167
+PAUSE 60
+MOUSE 3 13.500 9.417
+PAUSE 50
+MOUSE 3 13.500 9.750
+PAUSE 60
+MOUSE 3 13.417 10.000
+PAUSE 50
+MOUSE 3 13.333 10.167
+PAUSE 60
+MOUSE 3 13.333 10.417
+PAUSE 50
+MOUSE 3 13.167 10.500
+PAUSE 60
+MOUSE 3 13.000 10.667
+PAUSE 50
+MOUSE 3 13.000 10.833
+PAUSE 60
+MOUSE 3 12.917 10.833
+PAUSE 50
+MOUSE 3 12.833 10.917
+PAUSE 60
+MOUSE 3 12.667 11.000
+PAUSE 50
+MOUSE 3 12.500 11.000
+PAUSE 60
+MOUSE 3 12.167 11.167
+PAUSE 50
+MOUSE 3 12.000 11.333
+PAUSE 110
+MOUSE 3 11.917 11.333
+PAUSE 60
+MOUSE 3 11.833 11.500
+PAUSE 50
+MOUSE 3 11.667 11.500
+PAUSE 60
+MOUSE 3 11.667 11.667
+PAUSE 50
+MOUSE 3 11.500 11.667
+PAUSE 60
+MOUSE 3 11.333 11.667
+PAUSE 50
+MOUSE 3 11.167 11.917
+PAUSE 60
+MOUSE 3 11.000 12.000
+PAUSE 110
+MOUSE 3 10.833 12.083
+PAUSE 50
+MOUSE 3 10.667 12.167
+PAUSE 60
+MOUSE 3 10.333 12.333
+MOUSE 3 10.250 12.333
+PAUSE 110
+MOUSE 3 10.000 12.500
+PAUSE 50
+MOUSE 3 9.833 12.583
+PAUSE 60
+MOUSE 3 9.667 12.667
+PAUSE 50
+MOUSE 3 9.417 12.750
+PAUSE 60
+MOUSE 3 9.333 12.833
+PAUSE 50
+MOUSE 3 9.083 13.000
+PAUSE 60
+MOUSE 3 8.917 13.000
+PAUSE 50
+MOUSE 3 8.667 13.167
+PAUSE 60
+MOUSE 3 8.500 13.333
+PAUSE 160
+MOUSE 3 8.417 13.333
+PAUSE 60
+MOUSE 3 8.167 13.333
+PAUSE 50
+MOUSE 3 7.333 13.333
+PAUSE 60
+MOUSE 3 7.000 13.250
+PAUSE 110
+MOUSE 3 7.000 13.167
+PAUSE 50
+MOUSE 3 6.750 13.000
+PAUSE 60
+MOUSE 3 6.333 12.917
+PAUSE 100
+MOUSE 3 6.333 12.833
+PAUSE 60
+MOUSE 3 6.333 12.750
+PAUSE 50
+MOUSE 3 6.000 12.667
+PAUSE 110
+MOUSE 3 5.750 12.417
+PAUSE 60
+MOUSE 3 5.667 12.333
+PAUSE 50
+MOUSE 3 5.500 12.167
+PAUSE 60
+MOUSE 3 5.333 12.000
+PAUSE 50
+MOUSE 3 5.167 11.833
+PAUSE 60
+MOUSE 3 5.000 11.500
+PAUSE 50
+MOUSE 3 4.833 11.333
+PAUSE 110
+MOUSE 3 4.667 11.000
+PAUSE 60
+MOUSE 3 4.417 10.667
+PAUSE 50
+MOUSE 3 4.333 10.500
+PAUSE 110
+MOUSE 3 4.167 10.083
+PAUSE 60
+MOUSE 3 4.000 9.750
+PAUSE 50
+MOUSE 3 3.833 9.417
+PAUSE 60
+MOUSE 3 3.750 9.167
+PAUSE 50
+MOUSE 3 3.667 8.833
+PAUSE 110
+MOUSE 3 3.500 8.500
+PAUSE 60
+MOUSE 3 3.500 8.250
+PAUSE 50
+MOUSE 3 3.333 8.000
+PAUSE 60
+MOUSE 3 3.333 7.667
+PAUSE 110
+MOUSE 3 3.333 7.417
+PAUSE 50
+MOUSE 3 3.250 7.167
+PAUSE 60
+MOUSE 3 3.167 6.917
+PAUSE 110
+MOUSE 3 3.167 6.500
+PAUSE 50
+MOUSE 3 3.167 6.250
+PAUSE 60
+MOUSE 3 3.167 6.000
+PAUSE 110
+MOUSE 3 3.167 5.833
+PAUSE 50
+MOUSE 3 3.167 5.500
+PAUSE 60
+MOUSE 3 3.167 5.333
+PAUSE 50
+MOUSE 3 3.250 5.167
+PAUSE 110
+MOUSE 3 3.333 4.917
+PAUSE 60
+MOUSE 3 3.500 4.667
+PAUSE 50
+MOUSE 3 3.500 4.583
+PAUSE 110
+MOUSE 3 3.750 4.417
+PAUSE 60
+MOUSE 3 4.167 4.083
+PAUSE 50
+MOUSE 3 4.333 4.000
+PAUSE 110
+MOUSE 3 4.500 3.833
+PAUSE 60
+MOUSE 3 4.667 3.667
+PAUSE 50
+MOUSE 3 5.000 3.583
+PAUSE 60
+MOUSE 3 5.167 3.500
+PAUSE 110
+MOUSE 3 5.333 3.500
+PAUSE 50
+MOUSE 3 5.500 3.417
+PAUSE 60
+MOUSE 3 5.667 3.333
+PAUSE 110
+MOUSE 3 5.833 3.333
+PAUSE 50
+MOUSE 3 6.000 3.250
+PAUSE 60
+MOUSE 3 6.000 3.167
+PAUSE 110
+MOUSE 3 6.167 3.167
+PAUSE 110
+MOUSE 3 6.250 3.167
+PAUSE 50
+MOUSE 3 6.333 3.167
+PAUSE 60
+MOUSE 3 6.417 3.167
+PAUSE 100
+MOUSE 3 6.500 3.167
+PAUSE 60
+MOUSE 3 6.583 3.167
+PAUSE 50
+MOUSE 3 6.667 3.083
+PAUSE 110
+MOUSE 3 6.667 3.000
+PAUSE 60
+MOUSE 3 6.750 3.083
+PAUSE 50
+MOUSE 3 6.833 3.083
+PAUSE 660
+MOUSE 3 6.917 3.083
+PAUSE 110
+MOUSE 3 7.000 3.167
+PAUSE 440
+MOUSE 3 7.083 3.167
+PAUSE 110
+MOUSE 3 7.167 3.167
+MOUSE 3 7.250 3.167
+PAUSE 50
+MOUSE 3 7.333 3.167
+PAUSE 170
+MOUSE 3 7.417 3.167
+PAUSE 50
+MESSAGE
+_________________________________________
+
+It's possible to almost create a complete circle.
+If you drag the mouse beyond the start of the curve the track becomes very short.
+END
+STEP
+MOUSE 3 7.500 3.167
+MESSAGE
+_________________________________________
+
+Here you are warned that the track will be too short.
+END
+MOUSE 3 7.60 3.167
+BIGPAUSE
+MOUSE 3 8.417 3.167
+PAUSE 60
+MOUSE 3 8.417 3.250
+PAUSE 440
+MOUSE 3 8.500 3.250
+PAUSE 50
+MOUSE 3 8.500 3.333
+PAUSE 110
+MOUSE 3 8.583 3.333
+PAUSE 60
+MOUSE 3 8.667 3.333
+PAUSE 270
+MOUSE 3 8.750 3.333
+PAUSE 60
+MOUSE 3 8.833 3.333
+PAUSE 50
+MOUSE 3 8.833 3.417
+PAUSE 110
+MOUSE 3 8.833 3.500
+PAUSE 1610
+MOUSE 3 8.833 3.417
+PAUSE 60
+MOUSE 3 8.833 3.500
+PAUSE 110
+MOUSE 3 8.917 3.500
+PAUSE 60
+MOUSE 3 9.000 3.667
+PAUSE 50
+MOUSE 3 9.083 3.667
+PAUSE 60
+MOUSE 3 9.167 3.750
+PAUSE 50
+MOUSE 3 9.333 3.833
+PAUSE 60
+MOUSE 3 9.417 4.000
+PAUSE 50
+MOUSE 3 9.667 4.167
+MOUSE 3 10.000 4.333
+PAUSE 60
+MOUSE 3 10.167 4.500
+PAUSE 50
+MOUSE 3 10.333 4.667
+PAUSE 60
+MOUSE 3 10.583 4.667
+PAUSE 50
+MOUSE 3 10.833 4.833
+PAUSE 60
+MOUSE 3 11.083 5.000
+PAUSE 50
+MOUSE 3 11.750 5.083
+PAUSE 60
+MOUSE 3 11.917 5.167
+PAUSE 50
+MOUSE 3 12.250 5.333
+PAUSE 60
+MOUSE 3 12.417 5.333
+PAUSE 50
+MOUSE 3 12.667 5.333
+PAUSE 60
+MOUSE 3 12.917 5.333
+PAUSE 160
+MOUSE 3 12.917 5.417
+PAUSE 60
+MOUSE 3 13.083 5.500
+PAUSE 50
+MOUSE 3 13.333 5.667
+MOUSE 3 13.417 5.750
+PAUSE 220
+MOUSE 3 13.417 5.833
+PAUSE 60
+MOUSE 3 13.417 5.917
+PAUSE 50
+MOUSE 3 13.417 6.083
+MOUSE 3 13.500 6.167
+PAUSE 60
+MOUSE 3 13.583 6.167
+PAUSE 110
+MOUSE 3 13.500 6.333
+PAUSE 110
+MOUSE 3 13.500 6.417
+PAUSE 50
+MOUSE 3 13.500 6.500
+PAUSE 50
+MOUSE 3 13.500 6.667
+PAUSE 110
+MOUSE 3 13.500 6.750
+PAUSE 60
+MOUSE 3 13.583 6.833
+MOUSE 4 13.583 6.833
+MESSAGE
+_________________________________________
+
+If you move the cursor away from the curve, you will create a straight track tangent to the curve.
+END
+STEP
+MOUSE 2 13.50 6.8
+PAUSE 110
+MOUSE 3 13.50 7.0
+PAUSE 440
+MOUSE 3 13.500 7.2
+PAUSE 60
+MOUSE 3 13.750 7.4
+PAUSE 50
+MOUSE 3 14.083 7.6
+PAUSE 60
+MOUSE 3 14.333 7.8
+PAUSE 110
+MOUSE 3 15.000 7.833
+PAUSE 50
+MOUSE 3 15.500 7.667
+PAUSE 60
+MOUSE 3 16.000 7.583
+PAUSE 110
+MOUSE 3 16.250 7.583
+PAUSE 50
+MOUSE 3 16.500 7.417
+PAUSE 60
+MOUSE 3 16.583 7.417
+PAUSE 110
+MOUSE 3 16.750 7.417
+PAUSE 50
+MOUSE 3 16.750 7.417
+PAUSE 110
+MOUSE 3 16.833 7.417
+PAUSE 60
+MOUSE 3 17.000 7.417
+PAUSE 50
+MOUSE 3 17.333 7.583
+PAUSE 110
+MOUSE 3 17.500 7.833
+PAUSE 60
+MOUSE 3 17.667 8.083
+PAUSE 110
+MOUSE 3 17.750 8.333
+PAUSE 50
+MOUSE 3 17.917 8.833
+PAUSE 60
+MOUSE 3 18.000 9.667
+PAUSE 110
+MOUSE 3 18.083 10.500
+PAUSE 50
+MOUSE 3 18.083 11.000
+PAUSE 110
+MOUSE 3 17.917 11.417
+PAUSE 60
+MOUSE 3 17.667 11.667
+PAUSE 50
+MOUSE 3 17.167 12.083
+PAUSE 110
+MOUSE 3 16.000 12.583
+PAUSE 60
+MOUSE 3 14.917 13.167
+PAUSE 110
+MOUSE 3 13.917 13.583
+PAUSE 50
+MOUSE 3 13.417 13.833
+PAUSE 110
+MOUSE 3 13.000 14.000
+MOUSE 3 12.583 14.083
+PAUSE 110
+MOUSE 3 12.167 14.250
+PAUSE 60
+MOUSE 3 11.333 14.417
+PAUSE 50
+MOUSE 3 10.000 14.500
+PAUSE 110
+MOUSE 3 8.333 14.583
+PAUSE 60
+MOUSE 3 6.667 14.583
+PAUSE 110
+MOUSE 3 5.500 14.583
+PAUSE 50
+MOUSE 3 4.333 14.583
+PAUSE 110
+MOUSE 3 4.000 14.500
+PAUSE 50
+MOUSE 3 4.000 14.417
+PAUSE 110
+MOUSE 3 3.833 14.250
+PAUSE 60
+MOUSE 3 3.667 14.167
+PAUSE 110
+MOUSE 3 3.667 14.083
+PAUSE 50
+MOUSE 3 3.583 14.083
+PAUSE 110
+MOUSE 3 3.500 14.083
+PAUSE 220
+MOUSE 3 3.417 14.083
+PAUSE 60
+MOUSE 3 3.167 14.167
+PAUSE 110
+MOUSE 3 3.167 14.250
+PAUSE 50
+MOUSE 3 3.000 14.250
+PAUSE 110
+MOUSE 3 2.833 14.417
+PAUSE 60
+MOUSE 3 2.667 14.417
+PAUSE 110
+MOUSE 3 2.500 14.583
+PAUSE 50
+MOUSE 3 2.333 14.583
+PAUSE 110
+MOUSE 3 2.167 14.583
+PAUSE 60
+MOUSE 3 2.000 14.667
+PAUSE 110
+MOUSE 3 1.833 14.667
+PAUSE 50
+MOUSE 3 1.667 14.667
+PAUSE 110
+MOUSE 3 1.500 14.667
+PAUSE 60
+MOUSE 3 1.417 14.583
+PAUSE 110
+MOUSE 3 1.250 14.583
+PAUSE 50
+MOUSE 3 1.167 14.500
+PAUSE 110
+MOUSE 3 1.000 14.417
+PAUSE 940
+MOUSE 3 1.000 14.333
+MOUSE 4 1.000 14.333
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
+MESSAGE
+If you adjust the End-Point of a turnout or sectional track the track is extended by a straight track segment.
+END
+STEP
+MOUSE 2 19.750 10.583
+MOUSE 4 28.583 13.500
+BIGPAUSE
+MOUSE 2 19.833 10.583
+MOUSE 4 28.583 12.083
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
+MESSAGE
+You can change the radius of a Straight or Curved track that is connected at one End-Point by holding down the Shift key while dragging on it.
+END
+STEP
+KEYSTATE 2
+MOUSE 2 28 13
+KEYSTATE 2
+MOUSE 4 31 21
+MESSAGE
+_________________________________________
+
+This lets you change a Straight track into a Curved track (and vice versa) as well as changing the radius of a Curved track.
+END
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmbench.xtr b/app/lib/demos/dmbench.xtr
new file mode 100644
index 0000000..8fbf7f2
--- /dev/null
+++ b/app/lib/demos/dmbench.xtr
@@ -0,0 +1,70 @@
+# XTrkCad Version: 3.0.1, Date: Sat Sep 23 23:40:39 2000
+
+VERSION 10
+DEMOINIT
+ORIG 4.000 0.000 0.000
+PARAMETER display description-fontsize 64
+REDRAW
+RESET
+MESSAGE
+You can draw a variety of different types of benchwork:
+- rectangular (1x2, 2x4 etc)
+- L girders
+- T girders
+
+You can also draw them in different orientations.
+END
+STEP
+COMMAND DrawBench
+PARAMETER draw benchcolor 16760832
+PARAMETER draw benchlist 0 1"x1"
+PARAMETER draw benchorient 0 On Edge
+PARAMETER GROUP draw
+PARAMETER draw benchlist 12 L-2"x4"
+PARAMETER draw benchlist 16 L-3"x6"
+MESSAGE
+_________________________________________
+
+We will draw two 3x6 inch L-girders.
+END
+STEP
+MOUSE 2 0.000 2.000
+MOUSE 4 23.812 2.000
+PARAMETER draw benchcolor 16760832
+PARAMETER draw benchlist 16 L-3"x6"
+PARAMETER draw benchorient 0 Left
+PARAMETER GROUP draw
+MOUSE 2 0.000 10.250
+MOUSE 4 23.750 10.250
+PARAMETER draw benchcolor 16760832
+PARAMETER draw benchlist 16 L-3"x6"
+PARAMETER draw benchorient 0 Left
+PARAMETER GROUP draw
+MESSAGE
+_________________________________________
+
+The flange of the top L-Girders is on the outside edge of the girders. We want to change the girder so both flanges are on the inside.
+
+We will use the <Describe> command for this.
+END
+STEP
+COMMAND Describe
+MOUSE 2 12.312 10.500
+MOUSE 4 12.312 10.500
+MESSAGE
+_________________________________________
+
+Change the Orientation to Right.
+END
+STEP
+PARAMETER describe L2 1 Right
+PARAMETER describe ok
+RESET
+MESSAGE
+_________________________________________
+
+Now both flanges are on the inside of the two girders.
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmcancel.xtr b/app/lib/demos/dmcancel.xtr
new file mode 100644
index 0000000..edaef5c
--- /dev/null
+++ b/app/lib/demos/dmcancel.xtr
@@ -0,0 +1,112 @@
+VERSION 10
+DEMOINIT
+ORIG 6.000 0.000 0.000
+STRAIGHT 1 0 0 0 0 DEMO 2
+ E 5.333333 2.250000 270.000000
+ T 2 14.000000 2.250011 90.000000
+ END
+TURNOUT 2 0 0 0 0 DEMO 2 14.000000 2.250011 0 0.000000 "Peco-55 Med Left SL-E396F"
+ T 1 14.000000 2.250011 270.000000
+ T 3 19.405000 2.250011 90.000000
+ E 19.370000 2.772011 80.314000
+ D 0.172500 -1.261011
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0.000000 0.000000 0.000000 0.353000 0.000000
+ S 0 0.000000 0.353000 0.000000 5.405000 0.000000
+ C 0 0.000000 -23.136000 0.351000 23.136000 170.297000 9.700000
+ S 0 0.000000 4.251000 0.331000 5.370000 0.522000
+ END
+STRAIGHT 3 0 0 0 0 DEMO 2
+ E 28.166667 2.250000 90.000123
+ T 2 19.405000 2.250007 270.000123
+ END
+NOTE 4 0 0 0 16.666667 4.250000 0 69
+This is a note about something important
+but I can't remember what.
+ END
+DRAW 5 0 0 0 0 4.125000 5.750000 0 0.000000
+ Z 0 0.000000 0.000000 0.000000 0 140.000000 "This is some text"
+ END
+REDRAW
+RESET
+MESSAGE
+Pushing the <Describe> button will cancel any other command in progress.
+
+Here we will begin to create a Curved track which is a two step process.
+END
+STEP
+COMMAND CurveEndPt
+MOUSE 2 21.250 5.583
+MOUSE 4 32.333 5.750
+COMMAND Describe
+MESSAGE
+_________________________________________
+
+When we clicked on the <Describe> button, the current command was cancelled.
+
+When in <Describe> mode, selecting any object will print a description in the Status Bar and display a Dialog showing properties of the clicked-on object.
+END
+STEP
+MOUSE 2 11.333 2.167
+MOUSE 4 11.333 2.167
+MESSAGE
+_________________________________________
+
+Certain parameters of the object can be changed. In this case we'll change the Length
+END
+STEP
+#DESCRIBE Length 7.500
+PARAMETER describe F7 7.500
+MESSAGE
+_________________________________________
+
+Let's look at the Turnout...
+END
+BIGPAUSE
+MOUSE 2 18.083 2.250
+MOUSE 4 18.083 2.250
+MESSAGE
+and change the turnout Title.
+END
+STEP
+#DESCRIBE Name Medium Left
+#DESCRIBE Part No SL-E396F2
+PARAMETER describe S2 Medium Left
+PARAMETER describe S3 SL-E396F2
+STEP
+MOUSE 2 11.500 6.625
+MOUSE 4 11.500 6.625
+MESSAGE
+_________________________________________
+
+You can change the contents of Text...
+END
+STEP
+#DESCRIBE Text Goodbye
+PARAMETER describe S1 Goodbye
+BIGPAUSE
+MESSAGE
+and its size.
+END
+STEP
+#DESCRIBE Font Size 19
+PARAMETER describe LE1 -1 19
+STEP
+MESSAGE
+_________________________________________
+
+If you select a Note, the Description dialog appears which displays the contents of the note.
+END
+BIGPAUSE
+MOUSE 2 16.750 4.583
+PAUSE 50
+MOUSE 3 16.750 4.583
+MOUSE 4 16.750 4.583
+BIGPAUSE
+BIGPAUSE
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmcircle.xtr b/app/lib/demos/dmcircle.xtr
new file mode 100644
index 0000000..5d93443
--- /dev/null
+++ b/app/lib/demos/dmcircle.xtr
@@ -0,0 +1,51 @@
+VERSION 9
+DEMOINIT
+ORIG 12.000 0.000 0.000
+PARAMETER display description-fontsize 72
+REDRAW
+RESET
+MESSAGE
+Like the <Curve> track command, there are several ways to create a Circle track.
+
+The first is to specify a fixed radius and simply drag the Circle into position.
+
+We will change the Radius before proceeding.
+END
+STEP
+COMMAND CircleFixedRadius
+PARAMETER circle radius 10.000
+BIGPAUSE
+PARAMETER circle radius 12.000000
+MOUSE 2 20.500 11.500
+MOUSE 4 13.750 13.250
+PARAMETER circle radius 12.000
+RESET
+MESSAGE
+_________________________________________
+
+The next method is to drag from the edge of the Circle to the center.
+END
+STEP
+PARAMETER misc cmdUndo
+COMMAND CircleTangent
+PARAMETER circle radius 12.000
+MOUSE 2 12.000 1.750
+MOUSE 4 12.250 12.000
+PARAMETER circle radius 10.253
+MESSAGE
+_________________________________________
+
+The last is similar, but you drag from the center of the Circle to the edge.
+END
+STEP
+PARAMETER misc cmdUndo
+RESET
+COMMAND CircleCenter
+PARAMETER circle radius 10.253
+MOUSE 2 14.000 14.000
+MOUSE 4 5.750 5.250
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmconn1.xtr b/app/lib/demos/dmconn1.xtr
new file mode 100644
index 0000000..25c562e
--- /dev/null
+++ b/app/lib/demos/dmconn1.xtr
@@ -0,0 +1,230 @@
+VERSION 7
+DEMOINIT
+ORIG 8.000 0.000 0.000
+PARAMETER display description-fontsize 24
+TURNOUT 1 0 0 0 0 HO -1 6.842105 1.684210 0.000000 "Kato Unitrack #4-L Turnout 2-850"
+ T 11 6.842105 1.684210 270.000000
+ T 2 14.125570 1.684210 90.000000
+ T 10 13.891809 2.863926 71.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ P "Reverse" 2
+ S 0 0.000000 0.000000 0.000000 7.283465 0.000000
+ C 0 0.000000 -21.654000 0.000000 21.654000 161.000000 19.000000
+ L 11579568 0.053333 0.000000 -0.723334 7.283465 -0.723334
+ A 11579568 0.053333 -20.930666 0.000000 21.654000 161.000000 19.000000
+ END
+TURNOUT 2 0 0 0 0 HO -1 14.125570 1.684210 0.000000 "Kato Unitrack S61L (incl w/#4 TO) "
+ T 1 14.125570 1.684210 270.000000
+ T 3 16.527145 1.684210 90.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ S 0 0.000000 0.000000 0.000000 2.401575 0.000000
+ L 11579568 0.053333 0.000000 0.723334 2.401575 0.723334
+ L 11579568 0.053333 0.000000 -0.723334 2.401575 -0.723334
+ END
+TURNOUT 3 0 0 0 0 HO -1 16.527145 1.684210 0.000000 "Kato Unitrack S114 (incl w/#4 TO) "
+ T 2 16.527145 1.684210 270.000000
+ T 12 21.015334 1.684210 90.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ S 0 0.000000 0.000000 0.000000 4.488189 0.000000
+ L 11579568 0.053333 0.000000 0.723334 4.488189 0.723334
+ L 11579568 0.053333 0.000000 -0.723334 4.488189 -0.723334
+ END
+TURNOUT 4 0 0 0 0 HO -1 34.716122 1.684210 0.000000 "Kato Unitrack S114 (incl w/#4 TO) "
+ T 13 34.716122 1.684210 270.000000
+ T 5 39.204311 1.684210 90.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ S 0 0.000000 0.000000 0.000000 4.488189 0.000000
+ L 11579568 0.053333 0.000000 0.723334 4.488189 0.723334
+ L 11579568 0.053333 0.000000 -0.723334 4.488189 -0.723334
+ END
+TURNOUT 5 0 0 0 0 HO -1 39.204311 1.684210 0.000000 "Kato Unitrack S61R (incl w/#4 TO) "
+ T 4 39.204311 1.684210 270.000000
+ T 6 41.605886 1.684210 90.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ S 0 0.000000 0.000000 0.000000 2.401575 0.000000
+ L 11579568 0.053333 0.000000 0.723334 2.401575 0.723334
+ L 11579568 0.053333 0.000000 -0.723334 2.401575 -0.723334
+ END
+TURNOUT 6 0 0 0 0 HO -1 48.889351 1.684210 180.000000 "Kato Unitrack #4-R Turnout 2-851"
+ T 16 48.889351 1.684210 90.000000
+ T 5 41.605886 1.684210 270.000000
+ T 7 41.839647 2.863926 289.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ P "Reverse" 2
+ S 0 0.000000 0.000000 0.000000 7.283465 0.000000
+ C 0 0.000000 21.654000 0.000000 -21.654000 0.000000 19.000000
+ L 11579568 0.053333 0.000000 0.723334 7.283465 0.723334
+ A 11579568 0.053333 20.930666 0.000000 -21.654000 0.000000 19.000000
+ END
+TURNOUT 7 0 0 0 0 HO -1 40.576601 3.256112 15.500000 "Kato Unitrack R550-3.5° (incl w/#4 TO) "
+ T 8 40.576601 3.256112 285.500000
+ T 6 41.839647 2.863926 109.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ C 0 0.000000 21.654000 0.000000 -21.654000 0.000000 3.500000
+ A 11579568 0.053333 20.930666 0.000000 -21.654000 0.000000 3.500000
+ A 11579568 0.053333 22.377334 0.000000 -21.654000 0.000000 3.500000
+ END
+TURNOUT 8 0 0 0 0 HO -1 34.789943 4.043642 0.000000 "Kato Unitrack R550-15.5° (incl w/#4 TO) "
+ T 14 34.789943 4.043642 270.000000
+ T 7 40.576601 3.256112 105.500000
+ D 0.000000 0.000000
+ P "Normal" 1
+ C 0 0.000000 21.654000 0.000000 -21.654000 0.000000 15.500000
+ A 11579568 0.053333 20.930666 0.000000 -21.654000 0.000000 15.500000
+ A 11579568 0.053333 22.377334 0.000000 -21.654000 0.000000 15.500000
+ END
+TURNOUT 9 0 0 0 0 HO -1 15.302497 3.256113 344.500000 "Kato Unitrack R550-15.5° (incl w/#4 TO) "
+ E 15.302497 3.256113 254.500000
+ T 15 21.089155 4.043642 90.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ C 0 0.000000 21.654000 0.000000 -21.654000 0.000000 15.500000
+ A 11579568 0.053333 20.930666 0.000000 -21.654000 0.000000 15.500000
+ A 11579568 0.053333 22.377334 0.000000 -21.654000 0.000000 15.500000
+ END
+TURNOUT 10 0 0 0 0 HO -1 13.891809 2.863926 341.000000 "Kato Unitrack R550-3.5° (incl w/#4 TO) "
+ T 1 13.891809 2.863926 251.000000
+ E 15.154856 3.256113 74.500000
+ D 0.000000 0.000000
+ P "Normal" 1
+ C 0 0.000000 21.654000 0.000000 -21.654000 0.000000 3.500000
+ A 11579568 0.053333 20.930666 0.000000 -21.654000 0.000000 3.500000
+ A 11579568 0.053333 22.377334 0.000000 -21.654000 0.000000 3.500000
+ END
+TURNOUT 11 0 0 0 0 HO -1 6.842105 1.684210 180.000000 "Kato Unitrack Straight 6 7/8 2-130"
+ T 1 6.842105 1.684210 90.000000
+ E -0.008289 1.684210 270.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ S 0 0.000000 0.000000 0.000000 6.850394 0.000000
+ L 11579568 0.053333 0.000000 0.723334 6.850394 0.723334
+ L 11579568 0.053333 0.000000 -0.723334 6.850394 -0.723334
+ END
+TURNOUT 12 0 0 0 0 HO -1 21.015334 1.684210 0.000000 "Kato Unitrack Straight 6 7/8 2-130"
+ T 3 21.015334 1.684210 270.000000
+ T 13 27.865728 1.684210 90.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ S 0 0.000000 0.000000 0.000000 6.850394 0.000000
+ L 11579568 0.053333 0.000000 0.723334 6.850394 0.723334
+ L 11579568 0.053333 0.000000 -0.723334 6.850394 -0.723334
+ END
+TURNOUT 13 0 0 0 0 HO -1 27.865728 1.684210 0.000000 "Kato Unitrack Straight 6 7/8 2-130"
+ T 12 27.865728 1.684210 270.000000
+ T 4 34.716122 1.684210 90.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ S 0 0.000000 0.000000 0.000000 6.850394 0.000000
+ L 11579568 0.053333 0.000000 0.723334 6.850394 0.723334
+ L 11579568 0.053333 0.000000 -0.723334 6.850394 -0.723334
+ END
+TURNOUT 14 0 0 0 0 HO -1 34.789943 4.043642 180.000000 "Kato Unitrack Straight 6 7/8 2-130"
+ T 8 34.789943 4.043642 90.000000
+ T 15 27.939549 4.043642 270.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ S 0 0.000000 0.000000 0.000000 6.850394 0.000000
+ L 11579568 0.053333 0.000000 0.723334 6.850394 0.723334
+ L 11579568 0.053333 0.000000 -0.723334 6.850394 -0.723334
+ END
+TURNOUT 15 0 0 0 0 HO -1 27.939549 4.043642 180.000000 "Kato Unitrack Straight 6 7/8 2-130"
+ T 14 27.939549 4.043642 90.000000
+ T 9 21.089155 4.043642 270.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ S 0 0.000000 0.000000 0.000000 6.850394 0.000000
+ L 11579568 0.053333 0.000000 0.723334 6.850394 0.723334
+ L 11579568 0.053333 0.000000 -0.723334 6.850394 -0.723334
+ END
+TURNOUT 16 0 0 0 0 HO -1 48.889351 1.684210 0.000000 "Kato Unitrack Straight 6 7/8 2-130"
+ T 6 48.889351 1.684210 270.000000
+ E 55.739745 1.684210 90.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ S 0 0.000000 0.000000 0.000000 6.850394 0.000000
+ L 11579568 0.053333 0.000000 0.723334 6.850394 0.723334
+ L 11579568 0.053333 0.000000 -0.723334 6.850394 -0.723334
+ END
+REDRAW
+RESET
+MESSAGE
+We have built a siding using Sectional track and have 2 End-Points that don't line up and are not connected automatically when placing the sectional track.
+END
+STEP
+ORIG 1.000 12.000 2.000
+MESSAGE
+_________________________________________
+
+We use the <Connect> command to adjust neighboring tracks so the gap is closed.
+
+Note: the adjustments are only done on tracks which have only 1 or 2 connections. In this example the Turnouts would not be affected.
+END
+STEP
+COMMAND Connect
+MOUSE 2 14.840 3.213
+MOUSE 4 14.840 3.213
+MOUSE 2 15.560 3.373
+MOUSE 4 15.560 3.373
+MESSAGE
+_________________________________________
+
+And now the gap is closed.
+END
+STEP
+MESSAGE
+_________________________________________
+
+Other tracks have been shifted slightly to close the gap.
+END
+STEP
+ORIG 1 32 3
+MESSAGE
+_________________________________________
+
+You can see these slight mis-alignments.
+But they will have no effect when the layout is actually built.
+END
+BIGPAUSE
+ORIG 1 26 3
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
+MESSAGE
+After working with Sectional track you might get to point where these mis-alignments have accumulated and you wish to remove them.
+You can remove these slight mis-alignments by tightening the tracks starting from a unconnected End-Point. Use Shift-Left-Click with the <Connect> command.
+
+First use the <Split> command to disconnect the tracks.
+END
+STEP
+COMMAND SplitTrack
+MOUSE 2 27.853 4.040
+MOUSE 4 27.853 4.040
+MESSAGE
+_________________________________________
+
+Then with the <Connect> command, Shift-Left-Click on the 2 End-Points.
+END
+STEP
+COMMAND Connect
+KEYSTATE 2
+MOUSE 2 27.680 4.053
+KEYSTATE 2
+MOUSE 4 27.680 4.053
+KEYSTATE 2
+MOUSE 2 27.933 4.080
+KEYSTATE 2
+MOUSE 4 27.933 4.080
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmconn2.xtr b/app/lib/demos/dmconn2.xtr
new file mode 100644
index 0000000..d233edc
--- /dev/null
+++ b/app/lib/demos/dmconn2.xtr
@@ -0,0 +1,242 @@
+VERSION 7
+DEMOINIT
+ORIG 8.000 5.000 0.000
+PARAMETER display description-fontsize 24
+TURNOUT 1 0 0 0 0 N -1 17.157895 20.894737 0.000000 "Kato Unitrack Curve 9.75R 249mm 45° 20-100"
+ T 2 17.157895 20.894737 270.000000
+ T 8 24.061930 18.034992 135.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ C 0 0.000000 9.764000 0.000000 -9.764000 0.000000 45.000000
+ A 11579568 0.053333 9.290666 0.000000 -9.764000 0.000000 45.000000
+ A 11579568 0.053333 10.237334 0.000000 -9.764000 0.000000 45.000000
+ END
+TURNOUT 2 0 0 0 0 N -1 10.253860 18.034992 315.000000 "Kato Unitrack Curve 9.75R 249mm 45° 20-100"
+ T 3 10.253860 18.034992 225.000000
+ T 1 17.157895 20.894737 90.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ C 0 0.000000 9.764000 0.000000 -9.764000 0.000000 45.000000
+ A 11579568 0.053333 9.290666 0.000000 -9.764000 0.000000 45.000000
+ A 11579568 0.053333 10.237334 0.000000 -9.764000 0.000000 45.000000
+ END
+TURNOUT 3 0 0 0 0 N -1 7.394115 11.130957 270.000000 "Kato Unitrack Curve 9.75R 249mm 45° 20-100"
+ T 4 7.394115 11.130957 180.000000
+ T 2 10.253860 18.034992 45.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ C 0 0.000000 9.764000 0.000000 -9.764000 0.000000 45.000000
+ A 11579568 0.053333 9.290666 0.000000 -9.764000 0.000000 45.000000
+ A 11579568 0.053333 10.237334 0.000000 -9.764000 0.000000 45.000000
+ END
+TURNOUT 4 0 0 0 0 N -1 10.253860 4.226922 225.000000 "Kato Unitrack Curve 9.75R 249mm 45° 20-100"
+ T 5 10.253860 4.226922 135.000000
+ T 3 7.394115 11.130957 0.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ C 0 0.000000 9.764000 0.000000 -9.764000 0.000000 45.000000
+ A 11579568 0.053333 9.290666 0.000000 -9.764000 0.000000 45.000000
+ A 11579568 0.053333 10.237334 0.000000 -9.764000 0.000000 45.000000
+ END
+TURNOUT 5 0 0 0 0 N -1 17.157895 1.367177 180.000000 "Kato Unitrack Curve 9.75R 249mm 45° 20-100"
+ T 6 17.157895 1.367177 90.000000
+ T 4 10.253860 4.226922 315.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ C 0 0.000000 9.764000 0.000000 -9.764000 0.000000 45.000000
+ A 11579568 0.053333 9.290666 0.000000 -9.764000 0.000000 45.000000
+ A 11579568 0.053333 10.237334 0.000000 -9.764000 0.000000 45.000000
+ END
+TURNOUT 6 0 0 0 0 N -1 24.061930 4.226922 135.000000 "Kato Unitrack Curve 9.75R 249mm 45° 20-100"
+ T 7 24.061930 4.226922 45.000000
+ T 5 17.157895 1.367177 270.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ C 0 0.000000 9.764000 0.000000 -9.764000 0.000000 45.000000
+ A 11579568 0.053333 9.290666 0.000000 -9.764000 0.000000 45.000000
+ A 11579568 0.053333 10.237334 0.000000 -9.764000 0.000000 45.000000
+ END
+TURNOUT 7 0 0 0 0 N -1 29.239955 9.404947 135.000000 "Kato Unitrack Straight 7 5/16 186mm 20-010"
+ T 10 29.239955 9.404947 45.000000
+ T 6 24.061930 4.226922 225.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ S 0 0.000000 0.000000 0.000000 7.322834 0.000000
+ L 11579568 0.053333 0.000000 0.473340 7.322834 0.473340
+ L 11579568 0.053333 0.000000 -0.473340 7.322834 -0.473340
+ END
+TURNOUT 8 0 0 0 0 N -1 29.239955 12.856966 225.000000 "Kato Unitrack Straight 7 5/16 186mm 20-010"
+ T 9 29.239955 12.856966 135.000000
+ T 1 24.061930 18.034992 315.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ S 0 0.000000 0.000000 0.000000 7.322834 0.000000
+ L 11579568 0.053333 0.000000 0.473340 7.322834 0.473340
+ L 11579568 0.053333 0.000000 -0.473340 7.322834 -0.473340
+ END
+TURNOUT 9 0 0 0 0 N -1 31.026851 11.070071 225.000000 "Kato Unitrack Straight 2 1/2 64mm 20-030"
+ T 12 31.026851 11.070071 135.000000
+ T 8 29.239955 12.856966 315.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ S 0 0.000000 0.000000 0.000000 2.527052 0.000000
+ L 11579568 0.053333 0.000000 0.473340 2.527052 0.473340
+ L 11579568 0.053333 0.000000 -0.473340 2.527052 -0.473340
+ END
+TURNOUT 10 0 0 0 0 N -1 31.026851 11.191843 135.000000 "Kato Unitrack Straight 2 1/2 64mm 20-030"
+ T 11 31.026851 11.191843 45.000000
+ T 7 29.239955 9.404947 225.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ S 0 0.000000 0.000000 0.000000 2.527052 0.000000
+ L 11579568 0.053333 0.000000 0.473340 2.527052 0.473340
+ L 11579568 0.053333 0.000000 -0.473340 2.527052 -0.473340
+ END
+TURNOUT 11 0 0 0 0 N -1 32.813746 12.978739 135.000000 "Kato Unitrack Straight 2 1/2 64mm 20-030"
+ E 32.813746 12.978739 45.000000
+ T 10 31.026851 11.191843 225.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ S 0 0.000000 0.000000 0.000000 2.527052 0.000000
+ L 11579568 0.053333 0.000000 0.473340 2.527052 0.473340
+ L 11579568 0.053333 0.000000 -0.473340 2.527052 -0.473340
+ END
+TURNOUT 12 0 0 0 0 N -1 32.813747 9.283175 225.000000 "Kato Unitrack Straight 2 1/2 64mm 20-030"
+ T 13 32.813747 9.283175 135.000000
+ T 9 31.026851 11.070071 315.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ S 0 0.000000 0.000000 0.000000 2.527052 0.000000
+ L 11579568 0.053333 0.000000 0.473340 2.527052 0.473340
+ L 11579568 0.053333 0.000000 -0.473340 2.527052 -0.473340
+ END
+TURNOUT 13 0 0 0 0 N -1 32.813747 9.283175 45.000000 "Kato Unitrack Turnout 6-R 20-203"
+ T 12 32.813747 9.283175 315.000000
+ T 15 37.991772 4.105149 135.000000
+ T 14 37.310072 3.423450 150.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ P "Reverse" 2
+ S 0 0.000000 0.000000 0.000000 7.322834 0.000000
+ C 0 0.000000 28.268000 0.003000 -28.268000 359.993000 15.014000
+ L 11579568 0.053333 0.000000 0.473340 7.322834 0.473340
+ A 11579568 0.053333 27.794666 0.003000 -28.268000 359.993000 15.014000
+ END
+TURNOUT 14 0 0 0 0 N -1 37.310072 3.423450 60.000000 "Kato Unitrack S60L {incl w/4} "
+ T 13 37.310072 3.423450 330.000000
+ E 38.491174 1.377721 150.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ S 0 0.000000 0.000000 0.000000 2.362204 0.000000
+ L 11579568 0.053333 0.000000 0.473340 2.362204 0.473340
+ L 11579568 0.053333 0.000000 -0.473340 2.362204 -0.473340
+ END
+TURNOUT 15 0 0 0 0 N -1 44.895807 1.245404 180.000000 "Kato Unitrack Curve 9.75R 249mm 45° 20-100"
+ T 16 44.895807 1.245404 90.000000
+ T 13 37.991772 4.105149 315.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ C 0 0.000000 9.764000 0.000000 -9.764000 0.000000 45.000000
+ A 11579568 0.053333 9.290666 0.000000 -9.764000 0.000000 45.000000
+ A 11579568 0.053333 10.237334 0.000000 -9.764000 0.000000 45.000000
+ END
+TURNOUT 16 0 0 0 0 N -1 51.799842 4.105149 135.000000 "Kato Unitrack Curve 9.75R 249mm 45° 20-100"
+ T 17 51.799842 4.105149 45.000000
+ T 15 44.895807 1.245404 270.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ C 0 0.000000 9.764000 0.000000 -9.764000 0.000000 45.000000
+ A 11579568 0.053333 9.290666 0.000000 -9.764000 0.000000 45.000000
+ A 11579568 0.053333 10.237334 0.000000 -9.764000 0.000000 45.000000
+ END
+TURNOUT 17 0 0 0 0 N -1 54.659587 11.009184 90.000000 "Kato Unitrack Curve 9.75R 249mm 45° 20-100"
+ T 18 54.659587 11.009184 0.000000
+ T 16 51.799842 4.105149 225.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ C 0 0.000000 9.764000 0.000000 -9.764000 0.000000 45.000000
+ A 11579568 0.053333 9.290666 0.000000 -9.764000 0.000000 45.000000
+ A 11579568 0.053333 10.237334 0.000000 -9.764000 0.000000 45.000000
+ END
+TURNOUT 18 0 0 0 0 N -1 51.799842 17.913219 45.000000 "Kato Unitrack Curve 9.75R 249mm 45° 20-100"
+ T 19 51.799842 17.913219 315.000000
+ T 17 54.659587 11.009184 180.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ C 0 0.000000 9.764000 0.000000 -9.764000 0.000000 45.000000
+ A 11579568 0.053333 9.290666 0.000000 -9.764000 0.000000 45.000000
+ A 11579568 0.053333 10.237334 0.000000 -9.764000 0.000000 45.000000
+ END
+TURNOUT 19 0 0 0 0 N -1 44.895807 20.772964 0.000000 "Kato Unitrack Curve 9.75R 249mm 45° 20-100"
+ T 20 44.895807 20.772964 270.000000
+ T 18 51.799842 17.913219 135.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ C 0 0.000000 9.764000 0.000000 -9.764000 0.000000 45.000000
+ A 11579568 0.053333 9.290666 0.000000 -9.764000 0.000000 45.000000
+ A 11579568 0.053333 10.237334 0.000000 -9.764000 0.000000 45.000000
+ END
+TURNOUT 20 0 0 0 0 N -1 37.991772 17.913220 315.000000 "Kato Unitrack Curve 9.75R 249mm 45° 20-100"
+ T 21 37.991772 17.913220 225.000000
+ T 19 44.895807 20.772964 90.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ C 0 0.000000 9.764000 0.000000 -9.764000 0.000000 45.000000
+ A 11579568 0.053333 9.290666 0.000000 -9.764000 0.000000 45.000000
+ A 11579568 0.053333 10.237334 0.000000 -9.764000 0.000000 45.000000
+ END
+TURNOUT 21 0 0 0 0 N -1 32.813747 12.735194 315.000000 "Kato Unitrack Straight 7 5/16 186mm 20-010"
+ E 32.813747 12.735194 225.000000
+ T 20 37.991772 17.913220 45.000000
+ D 0.000000 0.000000
+ P "Normal" 1
+ S 0 0.000000 0.000000 0.000000 7.322834 0.000000
+ L 11579568 0.053333 0.000000 0.473340 7.322834 0.473340
+ L 11579568 0.053333 0.000000 -0.473340 7.322834 -0.473340
+ END
+REDRAW
+RESET
+MESSAGE
+In example shows a simple figure-8 layout using Sectional track.
+You will notice that the tracks do not line up exactly in one location.
+END
+STEP
+#ORIG 6 10.5 2.75
+#BIGPAUSE
+#ORIG 4 16 5.5
+#BIGPAUSE
+#ORIG 3 21.5 8.25
+#BIGPAUSE
+ORIG 2.000 27.000 11.000
+MESSAGE
+_________________________________________
+
+We can use the <Connect> command to move the connecting tracks slightly and connect the 2 End-Points.
+END
+STEP
+COMMAND Connect
+MOUSE 2 32.605 12.763
+MOUSE 4 32.605 12.763
+BIGPAUSE
+MOUSE 2 33.184 13.105
+MOUSE 4 33.184 13.105
+BIGPAUSE
+MESSAGE
+_________________________________________
+
+The two End-Points are now aligned and connected.
+END
+STEP
+ORIG 2 51.0 9.0
+MESSAGE
+_________________________________________
+
+The connection was made by adding small gaps in other tracks.
+END
+BIGPAUSE
+ORIG 2 4.0 9.0
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmcrvtrk.xtr b/app/lib/demos/dmcrvtrk.xtr
new file mode 100644
index 0000000..884a9ab
--- /dev/null
+++ b/app/lib/demos/dmcrvtrk.xtr
@@ -0,0 +1,96 @@
+VERSION 9
+DEMOINIT
+ORIG 8.000 0.000 0.000
+PARAMETER display description-fontsize 72
+REDRAW
+RESET
+MESSAGE
+There are several ways to create a Curved track.
+
+You can choose which to use by clicking on the small button to the left of <Curve> command button if the current Curve command is not the one you want.
+_________________________________________
+
+The first is by clicking on the first End-Point and dragging in the direction of the Curve.
+END
+STEP
+COMMAND CurveEndPt
+MOUSE 2 6.500 1.625
+MOUSE 4 31.250 2.750
+MESSAGE
+_________________________________________
+
+You will see a straight track with a double ended Red arrow at the end.
+
+Click and drag on one of the Red arrows to complete the Curve.
+END
+STEP
+MOUSE 2 31.125 2.500
+MOUSE 4 20.375 17.875
+RESET
+RESET
+MESSAGE
+_________________________________________
+
+The next method is to click at one End-Point and drag to the center of the Curve.
+END
+STEP
+PARAMETER misc cmdUndo
+COMMAND CurveTangent
+MOUSE 2 8.250 2.250
+MOUSE 4 31.875 2.500
+MESSAGE
+_________________________________________
+
+Now you will see the double ended Red arrow connected to the center of the Curve marked by a small circle.
+
+As before, drag on one of the Red arrows to complete the Curve.
+END
+STEP
+MOUSE 2 8.875 2.500
+MOUSE 4 17.375 19.125
+RESET
+RESET
+MESSAGE
+_________________________________________
+
+The next method is similar to the last except that you drag first from the center of the Curve to one End-Point.
+END
+STEP
+PARAMETER misc cmdUndo
+COMMAND CurveCenter
+MOUSE 2 27.375 4.250
+MOUSE 4 5.000 4.250
+MESSAGE
+_________________________________________
+
+Once again, drag on a Red arrow to complete the Curve.
+END
+STEP
+MOUSE 2 5.000 4.375
+MOUSE 4 15.625 18.875
+RESET
+MESSAGE
+_________________________________________
+
+The last method begins by drawing a line between the two End-Points of the Curve. This forms the Chord of the Curve.
+END
+STEP
+RESET
+PARAMETER misc cmdUndo
+COMMAND CurveChord
+MOUSE 2 5.625 1.500
+MOUSE 4 37.125 1.500
+MESSAGE
+_________________________________________
+
+Now drag on a Red arrow to complete the Curve.
+END
+STEP
+MOUSE 2 21.250 2.125
+MOUSE 4 20.750 16.750
+RESET
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmctlpnl.xtr b/app/lib/demos/dmctlpnl.xtr
new file mode 100644
index 0000000..e98604d
--- /dev/null
+++ b/app/lib/demos/dmctlpnl.xtr
@@ -0,0 +1,891 @@
+
+VERSION 10
+DEMOINIT
+ROOMSIZE 48.0 x 12.0
+ORIG 8.000 0.000 0.000
+
+PARAMETER display labelenable 4
+PARAMETER display description-fontsize 48
+PARAMETER display layoutlabels 1
+STRAIGHT 1 0 0 0 0 DEMO 2
+ E 0.000000 5.984375 270.000000
+ T 4 4.375000 5.984375 90.000000
+ END
+STRAIGHT 2 0 0 0 0 DEMO 2
+ T 11 17.438834 4.734375 270.000000
+ T 16 17.562500 4.734375 90.000000
+ END
+STRAIGHT 3 0 0 0 0 DEMO 2
+ E 48.000000 5.984375 90.000000
+ T 6 41.375000 5.984375 270.000000
+ END
+TURNOUT 4 0 0 0 0 DEMO 2 4.375000 5.984375 0 0.000000 "Peco-55 Medium Right SL-E395F"
+ T 1 4.375000 5.984375 270.000000
+ T 5 9.780000 5.984375 90.000000
+ T 7 9.745000 5.462375 99.686000
+ D 0.000000 0.000000
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0.000000 0.000000 0.000000 0.353000 0.000000
+ S 0 0.000000 0.353000 0.000000 5.405000 0.000000
+ C 0 0.000000 23.136000 0.351000 -23.136000 0.004000 9.700000
+ S 0 0.000000 4.251000 -0.331000 5.370000 -0.522000
+ END
+STRAIGHT 5 0 0 0 0 DEMO 2
+ T 4 9.780000 5.984375 270.000000
+ T 6 35.970000 5.984375 90.000000
+ END
+TURNOUT 6 0 0 0 0 DEMO 2 41.375000 5.984375 0 180.000000 "Peco-55 Medium Left SL-E396F"
+ T 3 41.375000 5.984375 90.000000
+ T 5 35.970000 5.984375 270.000000
+ T 8 36.005000 5.462375 260.314000
+ D 0.000000 0.000000
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0.000000 0.000000 0.000000 0.353000 0.000000
+ S 0 0.000000 0.353000 0.000000 5.405000 0.000000
+ C 0 0.000000 -23.136000 0.351000 23.136000 170.297000 9.700000
+ S 0 0.000000 4.251000 0.331000 5.370000 0.522000
+ END
+STRAIGHT 7 0 0 0 0 DEMO 2
+ T 4 9.745000 5.462375 279.686000
+ T 10 10.630543 5.311229 99.686000
+ END
+STRAIGHT 8 0 0 0 0 DEMO 2
+ T 6 36.005000 5.462375 80.314000
+ T 13 35.119457 5.311229 260.314000
+ END
+CURVE 9 0 0 0 0 DEMO 2 15.937500 27.480640 0 22.729792 0 0.000000 0.000000
+ T 11 14.436166 4.800485 93.787221
+ T 10 13.601529 4.871202 275.898779
+ END
+JOINT 10 0 0 0 0 DEMO 2 0.000000 3.002667 9.750000 7.000000 0 1 0 10.630543 5.311229 0 99.686000
+ T 7 10.630543 5.311229 279.686000
+ T 9 13.601529 4.871202 95.898779
+ END
+JOINT 11 0 0 0 0 DEMO 2 0.000000 3.002667 9.750000 7.000000 0 0 0 17.438834 4.734375 0 269.999999
+ T 2 17.438834 4.734375 90.000000
+ T 9 14.436166 4.800485 273.787221
+ END
+CURVE 12 0 0 0 0 DEMO 2 29.812500 27.480640 0 22.729792 0 0.000000 0.000000
+ T 13 32.148471 4.871202 84.101221
+ T 14 31.313834 4.800485 266.212779
+ END
+JOINT 13 0 0 0 0 DEMO 2 0.000000 3.002667 9.750000 7.000000 0 0 0 35.119457 5.311229 0 260.314000
+ T 8 35.119457 5.311229 80.314000
+ T 12 32.148471 4.871202 264.101221
+ END
+JOINT 14 0 0 0 0 DEMO 2 0.000000 3.002667 9.750000 7.000000 0 1 0 28.311166 4.734375 0 90.000001
+ T 15 28.311166 4.734375 270.000000
+ T 12 31.313834 4.800485 86.212779
+ END
+STRAIGHT 15 0 0 0 0 DEMO 2
+ T 14 28.311166 4.734375 90.000000
+ T 16 22.967500 4.734375 270.000000
+ END
+TURNOUT 16 0 0 0 0 DEMO 2 17.562500 4.734375 0 0.000000 "Peco-55 Medium Right SL-E395F"
+ T 2 17.562500 4.734375 270.000000
+ T 15 22.967500 4.734375 90.000000
+ T 17 22.932500 4.212375 99.686000
+ D 0.000000 0.000000
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0.000000 0.000000 0.000000 0.353000 0.000000
+ S 0 0.000000 0.353000 0.000000 5.405000 0.000000
+ C 0 0.000000 23.136000 0.351000 -23.136000 0.004000 9.700000
+ S 0 0.000000 4.251000 -0.331000 5.370000 -0.522000
+ END
+STRAIGHT 17 0 0 0 0 DEMO 2
+ T 16 22.932500 4.212375 279.686000
+ E 37.586240 1.711250 99.686000
+ END
+LAYERS 0 1 0 1 255 0 0 0 0 "Main"
+LAYERS 3 1 0 0 16776960 0 0 0 0 ""
+LAYERS 4 0 0 1 65280 0 0 0 0 ""
+LAYERS 6 1 0 1 179456 0 0 0 0 ""
+LAYERS 7 0 0 1 8388736 0 0 0 0 ""
+LAYERS 8 0 0 1 8421376 0 0 0 0 ""
+LAYERS 10 0 0 1 255 0 0 0 0 ""
+LAYERS CURRENT 0
+REDRAW
+RESET
+MESSAGE
+This demo will construct a control panel for part of a bigger layout.
+END
+STEP
+RESET
+MESSAGE
+_________________________________________
+
+For our control panel we will use ¼" lines.
+Also, we will use a 1/8" grid to lay out our controls.
+
+First, we will set up the Snap Grid for 1" grid lines and 8 divisions.
+END
+STEP
+COMMAND Change Grid...
+STEP
+PARAMETER grid vertspacing 1.000000
+PARAMETER grid horzspacing 1.000000
+PARAMETER grid horzdivision 8
+PARAMETER grid vertdivision 8
+MESSAGE
+_________________________________________
+
+Now, clear the layout and turn on the Snap Grid.
+END
+STEP
+PARAMETER grid ok
+PARAMETER misc menuFile-clear
+PARAMETER misc cmdGridShow
+PARAMETER misc cmdGridEnable
+ORIG 2.000 0.000 2.000
+CLEAR
+MESSAGE
+First step: draw the lines representing the tracks.
+
+We specify the line width in pixels.
+
+To create a ¼" line, divide the dots-per-inch (DPI) of your display by 4 and then by the drawing scale (which is 2 right now).
+
+For MS-Windows the DPI is usually 98, so choose: 98/4/2 = 12 (approximately).
+For Linux, the DPI is usually 72, so choose: 72/4/2 = 9.
+END
+STEP
+COMMAND DrawLine
+PARAMETER draw linewidth 0
+PARAMETER draw linecolor 0
+PARAMETER GROUP draw
+PARAMETER draw linewidth 12
+STEP
+MOUSE 2 1.000 6.000
+MOUSE 3 1.016 6.000
+MOUSE 3 1.016 6.016
+MOUSE 3 1.047 6.016
+MOUSE 3 1.078 6.016
+MOUSE 3 1.125 6.016
+MOUSE 3 1.234 6.000
+MOUSE 3 1.375 5.969
+MOUSE 3 1.531 5.969
+MOUSE 3 1.734 5.938
+MOUSE 3 1.922 5.938
+MOUSE 3 2.141 5.938
+MOUSE 3 2.391 5.938
+MOUSE 3 2.641 5.906
+MOUSE 3 2.844 5.906
+MOUSE 3 3.031 5.906
+MOUSE 3 3.203 5.906
+MOUSE 3 3.344 5.906
+MOUSE 3 3.484 5.906
+MOUSE 3 3.609 5.938
+MOUSE 3 3.625 5.938
+MOUSE 3 3.641 5.938
+MOUSE 3 3.656 5.953
+MOUSE 3 3.750 5.984
+MOUSE 3 3.781 5.984
+MOUSE 3 3.922 5.984
+MOUSE 3 4.125 5.984
+MOUSE 3 4.344 5.953
+MOUSE 3 4.594 5.891
+MOUSE 3 4.875 5.875
+MOUSE 3 5.172 5.844
+MOUSE 3 5.422 5.812
+MOUSE 3 5.625 5.781
+MOUSE 3 5.875 5.750
+MOUSE 3 6.000 5.734
+MOUSE 3 6.094 5.703
+MOUSE 3 6.125 5.703
+MOUSE 3 6.156 5.688
+MOUSE 3 6.203 5.688
+MOUSE 3 6.219 5.688
+MOUSE 3 6.234 5.688
+MOUSE 3 6.250 5.688
+MOUSE 3 6.250 5.688
+MOUSE 3 6.250 5.703
+MOUSE 3 6.250 5.719
+MOUSE 3 6.281 5.734
+MOUSE 3 6.328 5.734
+MOUSE 3 6.469 5.734
+MOUSE 3 6.625 5.734
+MOUSE 3 6.828 5.734
+MOUSE 3 7.047 5.750
+MOUSE 3 7.375 5.750
+MOUSE 3 7.656 5.781
+MOUSE 3 7.906 5.781
+MOUSE 3 8.109 5.781
+MOUSE 3 8.266 5.781
+MOUSE 3 8.406 5.781
+MOUSE 3 8.578 5.781
+MOUSE 3 8.719 5.781
+MOUSE 3 8.828 5.781
+MOUSE 3 8.875 5.781
+MOUSE 3 8.891 5.766
+MOUSE 3 8.906 5.766
+MOUSE 3 8.922 5.766
+MOUSE 3 8.922 5.781
+MOUSE 3 8.922 5.812
+MOUSE 3 8.938 5.844
+MOUSE 3 9.000 5.891
+MOUSE 3 9.078 5.953
+MOUSE 3 9.188 5.984
+MOUSE 3 9.359 6.000
+MOUSE 3 9.516 6.000
+MOUSE 3 9.656 6.000
+MOUSE 3 9.859 6.000
+MOUSE 3 10.000 6.000
+MOUSE 3 10.109 6.000
+MOUSE 3 10.250 6.000
+MOUSE 3 10.375 6.000
+MOUSE 3 10.516 6.000
+MOUSE 3 10.656 6.031
+MOUSE 3 10.797 6.031
+MOUSE 3 10.938 6.062
+MOUSE 3 10.984 6.062
+MOUSE 3 11.062 6.094
+MOUSE 3 11.078 6.094
+MOUSE 3 11.094 6.109
+MOUSE 3 11.109 6.109
+MOUSE 3 11.125 6.109
+MOUSE 3 11.125 6.109
+MOUSE 3 11.141 6.109
+MOUSE 3 11.156 6.125
+MOUSE 3 11.172 6.125
+MOUSE 3 11.188 6.125
+MOUSE 3 11.203 6.125
+MOUSE 3 11.203 6.125
+MOUSE 3 11.219 6.125
+MOUSE 3 11.234 6.109
+MOUSE 3 11.250 6.094
+MOUSE 3 11.250 6.078
+MOUSE 3 11.266 6.062
+MOUSE 3 11.281 6.062
+MOUSE 3 11.297 6.062
+MOUSE 3 11.297 6.047
+MOUSE 3 11.312 6.047
+MOUSE 3 11.328 6.047
+MOUSE 3 11.312 6.047
+MOUSE 3 11.281 6.062
+MOUSE 3 11.172 6.094
+MOUSE 3 11.062 6.094
+MOUSE 3 10.953 6.094
+MOUSE 3 10.812 6.125
+MOUSE 3 10.703 6.125
+MOUSE 3 10.562 6.125
+MOUSE 3 10.516 6.125
+MOUSE 3 10.484 6.125
+MOUSE 3 10.453 6.125
+MOUSE 3 10.422 6.125
+MOUSE 3 10.406 6.125
+MOUSE 3 10.391 6.125
+MOUSE 3 10.375 6.125
+MOUSE 3 10.375 6.109
+MOUSE 3 10.375 6.109
+MOUSE 3 10.375 6.109
+MOUSE 3 10.391 6.109
+MOUSE 3 10.422 6.109
+MOUSE 3 10.500 6.078
+MOUSE 3 10.547 6.078
+MOUSE 3 10.578 6.078
+MOUSE 3 10.625 6.078
+MOUSE 3 10.641 6.062
+MOUSE 3 10.672 6.062
+MOUSE 3 10.688 6.062
+MOUSE 3 10.719 6.062
+MOUSE 3 10.734 6.062
+MOUSE 3 10.750 6.062
+MOUSE 3 10.750 6.062
+MOUSE 3 10.766 6.062
+MOUSE 3 10.781 6.062
+MOUSE 3 10.797 6.078
+MOUSE 3 10.812 6.078
+MOUSE 3 10.844 6.078
+MOUSE 3 10.875 6.078
+MOUSE 3 10.875 6.078
+MOUSE 3 10.891 6.078
+MOUSE 3 10.906 6.078
+MOUSE 3 10.922 6.078
+MOUSE 3 10.938 6.078
+MOUSE 3 10.953 6.078
+MOUSE 3 10.969 6.078
+MOUSE 3 10.984 6.078
+MOUSE 3 10.984 6.062
+MOUSE 3 10.984 6.047
+MOUSE 3 11.000 6.031
+MOUSE 3 11.000 6.016
+MOUSE 3 11.000 6.000
+MOUSE 3 11.000 6.000
+MOUSE 3 11.000 6.000
+MOUSE 3 11.000 5.984
+MOUSE 4 11.000 5.984
+BIGPAUSE
+MOUSE 2 3.000 4.984
+MOUSE 4 8.969 5.047
+BIGPAUSE
+MOUSE 2 2.000 6.016
+MOUSE 4 2.969 5.031
+BIGPAUSE
+MOUSE 2 10.000 6.016
+MOUSE 4 9.000 5.000
+MOUSE 2 6.000 5.000
+MOUSE 3 6.000 4.984
+MOUSE 3 6.000 4.984
+MOUSE 3 6.031 4.969
+MOUSE 3 6.047 4.953
+MOUSE 3 6.078 4.938
+MOUSE 3 6.109 4.938
+MOUSE 3 6.125 4.922
+MOUSE 3 6.156 4.906
+MOUSE 3 6.188 4.891
+MOUSE 3 6.203 4.891
+MOUSE 3 6.234 4.875
+MOUSE 3 6.250 4.875
+MOUSE 3 6.250 4.875
+MOUSE 3 6.281 4.875
+MOUSE 3 6.281 4.859
+MOUSE 3 6.297 4.844
+MOUSE 3 6.312 4.844
+MOUSE 3 6.328 4.828
+MOUSE 3 6.344 4.828
+MOUSE 3 6.375 4.812
+MOUSE 3 6.375 4.797
+MOUSE 3 6.438 4.750
+MOUSE 3 6.469 4.734
+MOUSE 3 6.516 4.672
+MOUSE 3 6.547 4.656
+MOUSE 3 6.578 4.641
+MOUSE 3 6.594 4.625
+MOUSE 3 6.609 4.625
+MOUSE 3 6.625 4.609
+MOUSE 3 6.625 4.594
+MOUSE 3 6.625 4.578
+MOUSE 3 6.625 4.562
+MOUSE 3 6.625 4.547
+MOUSE 3 6.625 4.531
+MOUSE 3 6.641 4.516
+MOUSE 3 6.656 4.500
+MOUSE 3 6.672 4.484
+MOUSE 3 6.688 4.469
+MOUSE 3 6.734 4.438
+MOUSE 3 6.734 4.422
+MOUSE 3 6.750 4.422
+MOUSE 3 6.750 4.406
+MOUSE 3 6.766 4.391
+MOUSE 3 6.781 4.375
+MOUSE 3 6.797 4.359
+MOUSE 3 6.828 4.344
+MOUSE 3 6.844 4.328
+MOUSE 3 6.859 4.312
+MOUSE 3 6.859 4.297
+MOUSE 3 6.875 4.297
+MOUSE 3 6.875 4.281
+MOUSE 3 6.891 4.281
+MOUSE 3 6.906 4.281
+MOUSE 3 6.922 4.281
+MOUSE 3 6.938 4.266
+MOUSE 3 6.969 4.266
+MOUSE 3 7.047 4.250
+MOUSE 3 7.078 4.234
+MOUSE 3 7.156 4.203
+MOUSE 3 7.250 4.172
+MOUSE 3 7.297 4.125
+MOUSE 3 7.328 4.109
+MOUSE 3 7.344 4.109
+MOUSE 3 7.359 4.109
+MOUSE 3 7.359 4.094
+MOUSE 3 7.375 4.094
+MOUSE 3 7.375 4.078
+MOUSE 3 7.375 4.078
+MOUSE 3 7.391 4.062
+MOUSE 3 7.422 4.047
+MOUSE 3 7.438 4.031
+MOUSE 3 7.453 4.016
+MOUSE 3 7.469 4.000
+MOUSE 3 7.484 4.000
+MOUSE 3 7.500 4.000
+MOUSE 3 7.500 4.000
+MOUSE 3 7.500 3.984
+MOUSE 3 7.516 3.969
+MOUSE 3 7.531 3.953
+MOUSE 3 7.547 3.938
+MOUSE 3 7.562 3.922
+MOUSE 3 7.578 3.906
+MOUSE 3 7.594 3.891
+MOUSE 3 7.609 3.875
+MOUSE 3 7.625 3.875
+MOUSE 3 7.625 3.859
+MOUSE 3 7.641 3.844
+MOUSE 3 7.703 3.781
+MOUSE 3 7.719 3.766
+MOUSE 3 7.734 3.750
+MOUSE 3 7.750 3.750
+MOUSE 3 7.750 3.734
+MOUSE 3 7.750 3.734
+MOUSE 3 7.750 3.719
+MOUSE 3 7.766 3.703
+MOUSE 3 7.781 3.688
+MOUSE 3 7.797 3.672
+MOUSE 3 7.812 3.656
+MOUSE 3 7.828 3.641
+MOUSE 3 7.844 3.625
+MOUSE 3 7.859 3.625
+MOUSE 3 7.859 3.625
+MOUSE 3 7.859 3.609
+MOUSE 3 7.859 3.594
+MOUSE 3 7.859 3.578
+MOUSE 3 7.859 3.562
+MOUSE 3 7.859 3.547
+MOUSE 3 7.859 3.531
+MOUSE 3 7.859 3.516
+MOUSE 3 7.859 3.500
+MOUSE 3 7.859 3.500
+MOUSE 3 7.875 3.484
+MOUSE 3 7.875 3.469
+MOUSE 3 7.875 3.453
+MOUSE 3 7.875 3.438
+MOUSE 3 7.875 3.422
+MOUSE 3 7.875 3.406
+MOUSE 3 7.891 3.406
+MOUSE 3 7.891 3.391
+MOUSE 3 7.891 3.375
+MOUSE 3 7.906 3.375
+MOUSE 3 7.906 3.375
+MOUSE 3 7.922 3.359
+MOUSE 3 7.922 3.344
+MOUSE 3 7.938 3.328
+MOUSE 3 7.938 3.312
+MOUSE 3 7.953 3.312
+MOUSE 3 7.953 3.297
+MOUSE 3 7.953 3.281
+MOUSE 3 7.969 3.281
+MOUSE 3 7.969 3.266
+MOUSE 3 7.969 3.250
+MOUSE 3 7.969 3.250
+MOUSE 3 7.984 3.234
+MOUSE 3 7.984 3.219
+MOUSE 3 7.984 3.203
+MOUSE 3 8.000 3.203
+MOUSE 3 8.000 3.188
+MOUSE 3 8.000 3.172
+MOUSE 3 8.000 3.156
+MOUSE 3 8.000 3.141
+MOUSE 3 8.016 3.141
+MOUSE 3 8.016 3.125
+MOUSE 3 8.016 3.125
+MOUSE 3 8.016 3.109
+MOUSE 3 8.031 3.109
+MOUSE 3 8.031 3.094
+MOUSE 3 8.031 3.078
+MOUSE 3 8.031 3.062
+MOUSE 3 8.031 3.047
+MOUSE 3 8.031 3.031
+MOUSE 4 8.031 3.031
+MESSAGE
+_________________________________________
+
+Notice how the Snap Grid keeps the main line and siding track parallel and the connecting tracks and spur at a 45° angle.
+END
+STEP
+RESET
+CLEAR
+MESSAGE
+Second step: add LEDs for the turnout position indicators.
+We will use T1 red and green LEDs.
+
+We will zoom in to show positioning.
+END
+STEP
+ORIG 1 0.000000 4.000000
+HOTBARSELECT LED T1 Green LED
+MOUSE 2 2.355 6.050
+MESSAGE
+_________________________________________
+
+Notice that when we are in the correct position (on the 1/8" grid), the Marker lines on the bottom and left rulers will high-light the tick marks. When both ticks are high-lighted, press the space bar to finalize the LED.
+END
+STEP
+MOUSE 3 2.325 6.050
+STEP
+MOUSE 3 2.350 6.050
+STEP
+MOUSE 3 2.375 6.050
+STEP
+MOUSE 3 2.375 6.025
+STEP
+MOUSE 4 2.375 6.000
+STEP
+MOUSE 8200 2.375 6.000
+HOTBARSELECT LED T1 Red LED
+MOUSE 2 2.250 5.750
+MOUSE 4 2.250 5.750
+BIGPAUSE
+MOUSE 8200 2.250 5.750
+ORIG 1 8.000000 4.000000
+HOTBARSELECT LED T1 Green LED
+MOUSE 2 9.625 6.000
+MOUSE 4 9.625 6.000
+BIGPAUSE
+MOUSE 8200 9.625 6.000
+HOTBARSELECT LED T1 Red LED
+MOUSE 2 9.750 5.750
+MOUSE 4 9.750 5.750
+BIGPAUSE
+MOUSE 8200 9.750 5.750
+ORIG 1 5.000000 3.000000
+HOTBARSELECT LED T1 Green LED
+MOUSE 2 6.375 5.000
+MOUSE 4 6.375 5.000
+BIGPAUSE
+MOUSE 8200 6.375 5.000
+HOTBARSELECT LED T1 Red LED
+MOUSE 2 6.250 4.750
+MOUSE 4 6.250 4.750
+BIGPAUSE
+MOUSE 8200 6.250 4.750
+ORIG 2 0.000000 2.000000
+MESSAGE
+_________________________________________
+
+Now we'll add push buttons to control the turnouts.
+END
+STEP
+ORIG 1 0.0000000 4.000000
+HOTBARSELECT Switch ¼" Push Button
+MOUSE 2 2.750 6.000
+MOUSE 4 2.750 6.000
+BIGPAUSE
+MOUSE 8200 2.750 6.000
+MOUSE 2 2.500 5.500
+MOUSE 4 2.500 5.500
+BIGPAUSE
+MOUSE 8200 2.500 5.500
+ORIG 1 8.0000000 4.000000
+MOUSE 2 9.250 6.000
+MOUSE 4 9.250 6.000
+BIGPAUSE
+MOUSE 8200 9.250 6.000
+MOUSE 2 9.500 5.500
+MOUSE 4 9.500 5.500
+BIGPAUSE
+MOUSE 8200 9.500 5.500
+ORIG 1 5.0000000 3.000000
+MOUSE 2 6.750 5.000
+MOUSE 4 6.750 5.000
+BIGPAUSE
+MOUSE 8200 6.750 5.000
+MOUSE 2 6.500 4.500
+MOUSE 4 6.500 4.500
+BIGPAUSE
+MOUSE 8200 6.500 4.500
+ORIG 2 0.000000 2.0000000
+STEP
+CLEAR
+MESSAGE
+Let's add signals to our siding.
+
+The entrance to the siding will be protected by double headed signals.
+END
+STEP
+HOTBARSELECT Signals Dbl Signal 2
+MOUSE 3 2.953 7.344
+MOUSE 4 1.625 5.578
+BIGPAUSE
+MOUSE 8200 1.625 5.578
+MOUSE 2 9.859 6.641
+MOUSE 4 10.594 6.891
+BIGPAUSE
+MOUSE 8200 10.594 6.891
+MESSAGE
+_________________________________________
+
+First turn off the Snap Grid.
+
+Rotate the signals and move them to the proper locations.
+
+We rotate the signals by Shift-Right-Click and select 90° CW on the popup menu. We can not show the popup menu in demo mode, but will simulate the effect.
+END
+STEP
+PARAMETER misc cmdGridEnable
+ORIG 1 0.000000 4.000000
+RESET
+MOUSE 2 1.641 5.453
+MOUSE 4 1.641 5.453
+MENU 1.641 5.453 "Move Draw Mode " "90° CW"
+KEYSTATE 2
+MOUSE 2 1.641 5.453
+KEYSTATE 2
+MOUSE 3 1.311 5.453
+KEYSTATE 2
+MOUSE 4 1.510 5.580
+BIGPAUSE
+MOUSE 6920 1.510 5.580
+STEP
+ORIG 1 8.000000 4.000000
+RESET
+MOUSE 2 10.641 6.781
+MOUSE 4 10.641 6.781
+MENU 10.641 6.781 "Move Draw Mode " "90° CCW"
+KEYSTATE 2
+MOUSE 2 10.641 6.781
+KEYSTATE 2
+MOUSE 3 10.341 6.781
+KEYSTATE 2
+MOUSE 4 10.510 6.405
+BIGPAUSE
+MOUSE 6920 10.510 6.405
+STEP
+MESSAGE
+_________________________________________
+
+The exits from the siding will be protected by single headed signals.
+END
+STEP
+ORIG 1 0.000000 4.000000
+HOTBARSELECT Signals Sgl Signal 1
+MOUSE 3 3.250 6.375
+MOUSE 4 3.250 6.375
+BIGPAUSE
+MOUSE 8200 3.250 6.375
+MOUSE 2 3.250 5.375
+MOUSE 4 3.250 5.375
+BIGPAUSE
+MOUSE 8200 3.250 5.375
+RESET
+MOUSE 2 3.250 6.375
+MOUSE 4 3.250 6.375
+MENU 3.250 6.375 "Move Draw Mode " "90° CCW"
+MOUSE 6920 3.250 6.375
+MOUSE 2 3.250 5.375
+MOUSE 4 3.250 5.375
+MENU 3.250 5.375 "Move Draw Mode " "90° CCW"
+MOUSE 6920 3.250 5.375
+HOTBARSELECT Signals Sgl Signal 1
+ORIG 1 8.000000 4.000000
+MOUSE 2 8.750 5.625
+MOUSE 4 8.750 5.625
+BIGPAUSE
+MOUSE 8200 8.750 5.625
+MOUSE 2 8.750 4.625
+MOUSE 4 8.750 4.625
+BIGPAUSE
+MOUSE 8200 8.750 4.625
+#MOUSE 4 3.250 4.625
+#MOUSE 8200 3.250 4.625
+RESET
+MOUSE 2 8.750 5.625
+MOUSE 4 8.750 5.625
+MENU 8.750 5.625 "Move Draw Mode " "90° CW"
+MOUSE 6920 8.750 5.625
+MOUSE 2 8.750 4.625
+MOUSE 4 8.750 4.625
+MENU 8.750 4.625 "Move Draw Mode " "90° CW"
+MOUSE 6920 8.750 4.625
+RESET
+ORIG 2 0.000000 2.000000
+STEP
+CLEAR
+MESSAGE
+Now for some touch-ups.
+
+Notice when the line meet at an angle there is a gap.
+We will fill this gap with the ¼" dot.
+
+Note: Win95/Win98/WinME does not support drawing lines with flat end-caps, but only with round end-caps.
+Users on those platforms will not see the gap.
+END
+STEP
+ORIG 0.500 2.000 4.000
+HOTBARSELECT Symbols ¼" DOT
+MOUSE 2 3.000 5.000
+MOUSE 4 3.000 5.000
+BIGPAUSE
+MOUSE 8200 3.000 5.000
+ORIG 0.5 8.000 4.000
+HOTBARSELECT Symbols ¼" DOT
+MOUSE 2 9.000 5.000
+MOUSE 4 9.000 5.000
+BIGPAUSE
+MOUSE 8200 9.000 5.000
+ORIG 2 0.000000 2.000000
+MESSAGE
+_________________________________________
+
+Add an arrow head to indicate the tracks that connect to the rest of the layout.
+END
+STEP
+HOTBARSELECT Symbols Arrow
+MOUSE 2 11.000 5.750
+MOUSE 4 11.000 5.750
+BIGPAUSE
+MOUSE 8200 11.000 5.750
+MOUSE 2 0.500 5.750
+MOUSE 4 0.500 5.750
+BIGPAUSE
+MOUSE 8200 0.500 5.750
+RESET
+MOUSE 6920 0.500 6.000
+MESSAGE
+_________________________________________
+
+Rotate the arrow head by 180° and move into position.
+END
+MOUSE 2 0.500 6.000
+MOUSE 4 0.500 6.000
+BIGPAUSE
+MENU 0.500 6.000 "Move Draw Mode " "180°"
+KEYSTATE 2
+MOUSE 2 0.500 6.000
+KEYSTATE 2
+MOUSE 3 1.500 6.000
+KEYSTATE 2
+MOUSE 4 1.000 6.000
+BIGPAUSE
+MOUSE 6920 1.000 6.000
+MESSAGE
+_________________________________________
+
+And add some labels.
+END
+STEP
+COMMAND Text
+PARAMETER text fontsize 0 18
+PARAMETER GROUP text
+PARAMETER text fontsize -1 48
+MOUSE 2 4.500 6.969
+MOUSE 4 4.391 6.672
+KEYSTATE 2
+MOUSE 21256 4.391 6.672
+MOUSE 29960 4.391 6.672
+MOUSE 27912 4.391 6.672
+MOUSE 27912 4.391 6.672
+MOUSE 26888 4.391 6.672
+MOUSE 29704 4.391 6.672
+MOUSE 2 4.500 6.656
+MOUSE 4 4.812 6.625
+MOUSE 3336 5.156 6.766
+PARAMETER text fontsize -1 48
+PARAMETER text fontsize 11 24
+PARAMETER text fontsize -1 24
+MOUSE 2 0.500 5.016
+MOUSE 4 0.641 5.016
+KEYSTATE 2
+MOUSE 21256 1.312 5.016
+MOUSE 25864 1.312 5.016
+MOUSE 24840 1.312 5.016
+MOUSE 29704 1.312 5.016
+MOUSE 29704 1.312 5.016
+MOUSE 27656 1.312 5.016
+MOUSE 25864 1.312 5.016
+MOUSE 3336 3.031 3.859
+PARAMETER text fontsize -1 24
+PARAMETER GROUP text
+MOUSE 2 10.375 5.047
+MOUSE 4 10.125 5.047
+KEYSTATE 2
+MOUSE 17160 10.125 5.047
+MOUSE 26632 10.125 5.047
+MOUSE 26888 10.125 5.047
+MOUSE 25352 10.125 5.047
+MOUSE 24840 10.125 5.047
+MOUSE 2056 10.125 5.047
+MOUSE 28424 10.125 5.047
+MOUSE 2056 10.125 5.047
+MOUSE 24840 10.125 5.047
+MOUSE 26376 10.125 5.047
+MOUSE 28424 10.125 5.047
+MOUSE 2 10.094 5.125
+MOUSE 4 9.891 5.000
+MOUSE 3336 9.906 5.031
+PARAMETER text fontsize -1 24
+PARAMETER GROUP text
+CLEAR
+MESSAGE
+We want to print our control panel onto a 8½x11 page, but the control panel is a bit too wide.
+
+Lets tighten it up a bit.
+
+First turn the Snap Grid on again so any moves we make will keep objects on the grid.
+END
+STEP
+PARAMETER misc cmdGridEnable
+MESSAGE
+_________________________________________
+
+Lets move the spur track the left 3/4"
+END
+STEP
+ORIG 1 5.000 4.000
+RESET
+MOUSE 2 5.672 5.375
+MOUSE 4 8.516 2.297
+BIGPAUSE
+KEYSTATE 2
+MOUSE 2 6.594 4.000
+KEYSTATE 2
+MOUSE 3 6.594 4.000
+KEYSTATE 2
+MOUSE 4 5.781 4.000
+RESET
+BIGPAUSE
+MOUSE 6920 5.781 4.000
+RESET
+REDRAW
+MESSAGE
+_________________________________________
+
+Now move the right side of the siding over.
+END
+STEP
+MOUSE 2 7.500 6.641
+MOUSE 4 11.625 4.047
+BIGPAUSE
+KEYSTATE 2
+MOUSE 2 8.875 4.422
+KEYSTATE 2
+MOUSE 3 8.875 4.422
+KEYSTATE 2
+MOUSE 4 7.531 4.391
+RESET
+BIGPAUSE
+MOUSE 6920 7.562 4.531
+RESET
+REDRAW
+MESSAGE
+_________________________________________
+
+Now, adjust the ends of the mainline and siding tracks.
+END
+STEP
+COMMAND Modify
+MOUSE 2 10.984 6.047
+BIGPAUSE
+MOUSE 4 9.672 6.000
+MOUSE 2 9.000 4.906
+BIGPAUSE
+MOUSE 4 7.766 5.031
+ORIG 2 0.000 2.000
+MESSAGE
+_________________________________________
+
+And move the title over as well.
+END
+STEP
+MOUSE 6920 7.766 5.031
+MOUSE 2 5.875 6.672
+MOUSE 4 5.875 6.672
+BIGPAUSE
+KEYSTATE 2
+MOUSE 2 5.875 6.672
+KEYSTATE 2
+MOUSE 3 4.375 6.672
+KEYSTATE 2
+MOUSE 4 5.000 6.672
+CLEAR
+MESSAGE
+Now you can print it.
+
+The cross-hairs on the LEDs and switch show the centers for drilling.
+
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmdelund.xtr b/app/lib/demos/dmdelund.xtr
new file mode 100644
index 0000000..f3c153c
--- /dev/null
+++ b/app/lib/demos/dmdelund.xtr
@@ -0,0 +1,80 @@
+VERSION 2
+DEMOINIT
+ORIG 6.000 0.000 0.000
+STRAIGHT 1 DEMO 1
+ E 4.166667 1.750000 270.000000
+ T 4 8.916667 1.750001 90.000000
+ END
+CURVE 2 DEMO 1 21.833333 25.924310 24.125000
+ E 40.128499 10.198454 40.681260
+ T 3 24.504997 1.947700 263.642025
+ END
+JOINT 3 DEMO 1 0.000000 5.343264 13.750000 9.375000 0 1 0 19.161701 1.750004 90.000089
+ T 5 19.161701 1.750004 270.000000
+ T 2 24.504997 1.947700 83.642025
+ END
+TURNOUT 4 DEMO 1 8.916667 1.750001 0.000000 "Peco-55 Medium Left SL-E396F"
+ T 1 8.916667 1.750001 270.000000
+ T 5 14.321667 1.750001 90.000000
+ E 14.286667 2.272001 80.314000
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0 0.000000 0.000000 0.353000 0.000000
+ S 0 0 0.353000 0.000000 5.405000 0.000000
+ C 0 0 -23.136000 0.351000 23.136000 170.297000 9.700000
+ S 0 0 4.251000 0.331000 5.370000 0.522000
+ END
+STRAIGHT 5 DEMO 1
+ T 3 19.161701 1.750004 90.000062
+ T 4 14.321667 1.750002 270.000062
+ END
+REDRAW
+RESET
+MESSAGE
+Pressing the <Delete> button lets you delete selected tracks from the layout.
+
+First you select the tracks you want to delete, and then press the <Delete> button.
+END
+STEP
+COMMAND Select
+MOUSE 2 6.417 1.833
+MOUSE 4 6.417 1.833
+MOUSE 2 11.833 2.083
+MOUSE 4 11.833 2.083
+PARAMETER misc cmdDelete
+MESSAGE
+_________________________________________
+
+If you delete a track connected to an easement curve, then the easement curve is deleted as well.
+END
+STEP
+COMMAND Select
+MOUSE 2 17.750 1.833
+MOUSE 4 17.750 1.833
+PARAMETER misc cmdDelete
+MESSAGE
+_________________________________________
+
+You can use the <Undo> command to undelete tracks.
+END
+BIGPAUSE
+PARAMETER misc cmdUndo
+BIGPAUSE
+PARAMETER misc cmdUndo
+BIGPAUSE
+MESSAGE
+_________________________________________
+
+If you Left-Drag on the layout you can select all tracks within an area.
+
+Note, only tracks within the selected area are deleted. Since the easement curve is connected to a deleted track, it is deleted as well.
+END
+STEP
+MOUSE 2 3.167 3.333
+MOUSE 4 22.083 0.667
+PARAMETER misc cmdDelete
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmdialog.xtr b/app/lib/demos/dmdialog.xtr
new file mode 100644
index 0000000..308428b
--- /dev/null
+++ b/app/lib/demos/dmdialog.xtr
@@ -0,0 +1,36 @@
+VERSION 7
+DEMOINIT
+ORIG 8.000 0.000 0.000
+REDRAW
+RESET
+MESSAGE
+The demo also simulates entering values and selecting options on various dialogs.
+
+This is simulated by drawing a rectangle around the control when values are entered or changed.
+END
+STEP
+PARAMETER misc cmdDisplay
+MESSAGE
+_________________________________________
+
+Here we are going to make some changes to the Display dialog. Notice how this is simulated.
+END
+STEP
+PARAMETER display tunnels 2
+PARAMETER display description-fontsize 56
+PARAMETER display layoutlabels 4
+PARAMETER display layoutlabels 0
+PARAMETER display mapscale 50
+PARAMETER display carhotbarlabels 4 Manuf/Proto
+MESSAGE
+_________________________________________
+
+This effect is only used in demonstration mode. During normal operation you will not see this.
+END
+STEP
+PARAMETER display cancel
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmdimlin.xtr b/app/lib/demos/dmdimlin.xtr
new file mode 100644
index 0000000..9668b95
--- /dev/null
+++ b/app/lib/demos/dmdimlin.xtr
@@ -0,0 +1,165 @@
+# XTrkCad Version: 3.0.1, Date: Sun Sep 24 00:01:36 2000
+
+VERSION 10
+DEMOINIT
+ORIG 1.000 12.000 5.000
+PARAMETER display description-fontsize 64
+STRUCTURE 1 0 0 0 0 N 2 6.210395 3.915802 0 236.697715 "Walthers Interstate Fuel - Loading Rack 933-32000a"
+ D 0.000000 0.000000
+ L3 0 0.000000 0.750000 0.000000 0 3.750000 0.000000 0
+ L3 0 0.000000 3.750000 0.000000 0 3.750000 3.125000 0
+ L3 0 0.000000 3.750000 3.125000 0 0.750000 3.125000 0
+ L3 0 0.000000 3.687500 0.062500 0 1.687500 0.062500 0
+ L3 0 0.000000 1.687500 0.062500 0 1.687500 0.812500 0
+ L3 0 0.000000 1.687500 0.812500 0 3.687500 0.812500 0
+ L3 0 0.000000 3.687500 0.812500 0 3.687500 0.062500 0
+ L3 0 0.000000 3.687500 3.062500 0 1.687500 3.062500 0
+ L3 0 0.000000 1.687500 3.062500 0 1.687500 2.312500 0
+ L3 0 0.000000 1.687500 2.312500 0 3.687500 2.312500 0
+ L3 0 0.000000 3.687500 2.312500 0 3.687500 3.062500 0
+ L3 0 0.000000 3.687500 1.187500 0 1.687500 1.187500 0
+ L3 0 0.000000 1.687500 1.187500 0 1.687500 1.937500 0
+ L3 0 0.000000 1.687500 1.937500 0 3.687500 1.937500 0
+ L3 0 0.000000 3.687500 1.937500 0 3.687500 1.187500 0
+ A3 0 0.000000 0.088388 3.000000 2.687500 0 0.000000 360.000000
+ A3 0 0.000000 0.088388 3.000000 1.562500 0 0.000000 360.000000
+ A3 0 0.000000 0.088388 3.000000 0.437500 0 0.000000 360.000000
+ L3 0 0.000000 0.750000 2.875000 0 0.000000 2.875000 0
+ L3 0 0.000000 0.000000 2.875000 0 0.000000 0.250000 0
+ L3 0 0.000000 0.000000 0.250000 0 0.750000 0.250000 0
+ L3 0 0.000000 1.500000 2.187500 0 0.437500 2.187500 0
+ L3 0 0.000000 0.437500 2.187500 0 0.437500 0.937500 0
+ L3 0 0.000000 0.437500 0.937500 0 1.500000 0.937500 0
+ L3 0 0.000000 1.500000 0.937500 0 1.500000 2.187500 0
+ L3 0 0.000000 0.750000 3.125000 0 0.750000 2.187500 0
+ L3 0 0.000000 0.750000 0.000000 0 0.750000 0.937500 0
+ END
+STRAIGHT 2 0 0 0 0 N 2
+ E 0.105826 -1.346082 236.697715
+ T 5 3.511000 0.890894 56.697715
+ END
+STRUCTURE 3 0 0 0 0 N 2 15.697638 4.710368 0 326.697715 "Walthers Shady Jct Water Tower 933-3205a"
+ D 0.000000 0.000000
+ L3 0 0.000000 0.000000 0.000000 0 1.562500 0.000000 0
+ L3 0 0.000000 1.562500 0.000000 0 1.562500 1.562500 0
+ L3 0 0.000000 1.562500 1.562500 0 0.000000 1.562500 0
+ L3 0 0.000000 0.000000 1.562500 0 0.000000 0.000000 0
+ L3 0 0.000000 0.000000 0.375000 0 1.250000 0.375000 0
+ L3 0 0.000000 1.250000 0.375000 0 1.250000 1.562500 0
+ L3 0 0.000000 0.625000 1.000000 0 0.625000 0.375000 0
+ L3 0 0.000000 0.625000 1.000000 0 1.250000 1.000000 0
+ L3 0 0.000000 0.625000 1.000000 0 0.000000 1.000000 0
+ L3 0 0.000000 0.625000 1.000000 0 0.625000 1.562500 0
+ L3 0 0.000000 0.625000 1.000000 0 1.062500 1.437500 0
+ L3 0 0.000000 0.625000 1.000000 0 1.062500 0.562500 0
+ L3 0 0.000000 0.625000 1.000000 0 0.187500 0.562500 0
+ L3 0 0.000000 0.625000 1.000000 0 0.187500 1.437500 0
+ L3 0 0.000000 0.625000 1.562500 0 1.062500 1.437500 0
+ L3 0 0.000000 1.062500 1.437500 0 1.250000 1.000000 0
+ L3 0 0.000000 1.250000 1.000000 0 1.062500 0.562500 0
+ L3 0 0.000000 1.062500 0.562500 0 0.625000 0.375000 0
+ L3 0 0.000000 0.625000 0.375000 0 0.187500 0.562500 0
+ L3 0 0.000000 0.187500 0.562500 0 0.000000 1.000000 0
+ L3 0 0.000000 0.000000 1.000000 0 0.187500 1.437500 0
+ L3 0 0.000000 0.187500 1.437500 0 0.625000 1.562500 0
+ L3 0 0.000000 1.250000 1.500000 0 1.750000 1.500000 0
+ L3 0 0.000000 1.750000 1.500000 0 1.750000 1.062500 0
+ L3 0 0.000000 1.750000 1.062500 0 1.250000 1.062500 0
+ END
+STRAIGHT 4 0 0 0 0 N 2
+ E 22.026067 13.054077 56.697715
+ T 5 8.028421 3.858543 236.697715
+ END
+TURNOUT 5 0 0 0 0 N 2 3.511000 0.890894 0 326.697715 "Peco-55 Medium Right SL-E395F"
+ T 2 3.511000 0.890894 236.697715
+ T 4 8.028421 3.858543 56.697715
+ T 8 8.285775 3.403046 66.383715
+ D 0.000000 0.000000
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0.000000 0.000000 0.000000 0.353000 0.000000
+ S 0 0.000000 0.353000 0.000000 5.405000 0.000000
+ C 0 0.000000 23.136000 0.351000 -23.136000 0.004000 9.700000
+ S 0 0.000000 4.251000 -0.331000 5.370000 -0.522000
+ END
+STRAIGHT 6 0 0 0 0 N 2
+ E 22.690715 11.995108 56.697715
+ T 7 13.433501 5.913726 236.697715
+ END
+CURVE 7 0 0 0 0 N 2 4.259807 19.878127 0 16.708116 0 0.000000 0.000000
+ T 6 13.433501 5.913726 56.697715
+ T 8 10.953237 4.569334 246.383715
+ END
+STRAIGHT 8 0 0 0 0 N 2
+ T 5 8.285775 3.403046 246.383715
+ T 7 10.953237 4.569334 66.383715
+ END
+STRUCTURE 9 0 0 0 0 N 2 16.897495 6.987885 0 326.697715 "Walthers 2-Stall Engine House 933-3204"
+ D 0.000000 0.000000
+ L3 0 0.000000 0.000000 0.000000 0 7.625000 0.000000 0
+ L3 0 0.000000 7.625000 0.000000 0 7.625000 3.250000 0
+ L3 0 0.000000 7.625000 3.250000 0 0.000000 3.250000 0
+ L3 0 0.000000 0.000000 3.250000 0 0.000000 0.000000 0
+ L3 0 0.000000 0.000000 1.625000 0 7.625000 1.625000 0
+ L3 0 0.000000 0.000000 2.000000 0 7.625000 2.000000 0
+ L3 0 0.000000 0.000000 1.250000 0 7.625000 1.250000 0
+ A3 0 0.000000 0.225347 6.625000 0.875000 0 0.000000 360.000000
+ A3 0 0.000000 0.139754 6.625000 0.875000 0 0.000000 360.000000
+ A3 0 0.000000 0.225347 1.000000 0.875000 0 0.000000 360.000000
+ A3 0 0.000000 0.139754 1.000000 0.875000 0 0.000000 360.000000
+ A3 0 0.000000 0.225347 1.000000 2.375000 0 0.000000 360.000000
+ A3 0 0.000000 0.139754 1.000000 2.375000 0 0.000000 360.000000
+ A3 0 0.000000 0.225347 6.625000 2.375000 0 0.000000 360.000000
+ A3 0 0.000000 0.139754 6.625000 2.375000 0 0.000000 360.000000
+ END
+REDRAW
+RESET
+MESSAGE
+Dimension Lines are used to mark the distances between two points.
+
+Here we will create a Dimension Line to show the separation between two tracks.
+END
+STEP
+COMMAND DrawDimLine
+PARAMETER draw arrowsize 0 Tiny
+PARAMETER GROUP draw
+MOUSE 2 13.953 7.766
+MOUSE 4 14.688 6.734
+#PARAMETER draw arrowsize 0 Tiny
+PARAMETER GROUP draw
+STEP
+ORIG 4.000 3.000 0.000
+MESSAGE
+_________________________________________
+
+We might also want to measure the distance between two structures. In this case we will use a larger dimension line.
+END
+STEP
+PARAMETER draw arrowsize 2 Medium
+MOUSE 2 15.000 9.688
+MOUSE 4 6.375 4.000
+#PARAMETER draw arrowsize 2 Medium
+PARAMETER GROUP draw
+MESSAGE
+_________________________________________
+
+We can use the <Describe> command to change the position of the Dimension Line and the size of the numbers.
+END
+STEP
+COMMAND Describe
+MOUSE 2 11.000 7.125
+MOUSE 4 11.000 7.125
+BIGPAUSE
+#DESCRIBE Size 3
+PARAMETER describe L1 3 Large
+STEP
+#DESCRIBE Size 1
+PARAMETER describe L1 1 Small
+#DESCRIBE OK
+PARAMETER describe ok
+RESET
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmease.xtr b/app/lib/demos/dmease.xtr
new file mode 100644
index 0000000..0e8e406
--- /dev/null
+++ b/app/lib/demos/dmease.xtr
@@ -0,0 +1,72 @@
+VERSION 2
+DEMOINIT
+ORIG 8.000 0.000 0.000
+STRAIGHT 1 DEMO 1
+ E 1.916667 32.771041 0.000000
+ E 1.916667 0.416667 180.000000
+ END
+STRAIGHT 2 DEMO 1
+ E 2.583333 0.833333 270.000000
+ E 37.083333 0.833333 90.000000
+ END
+REDRAW
+RESET
+MESSAGE
+This example will show the effect of using easements while joining tracks.
+
+First, we'll enable easements.
+END
+PARAMETER misc cmdEasement
+STEP
+PARAMETER easement val 0.500
+BIGPAUSE
+PARAMETER easement ok
+MESSAGE
+_________________________________________
+
+We've selected sharp easements. The minimum radius curve we can use will be 9.75"
+
+Notice the label on the Easement button has changed to 'Sharp'.
+END
+STEP
+COMMAND Join
+MOUSE 2 1.917 12.167
+MOUSE 3 1.917 12.167
+MOUSE 4 1.917 12.167
+MOUSE 2 12.000 0.833
+MESSAGE
+_________________________________________
+
+Note the connecting curve does not quite meet the straight tracks. This the 'Offset'.
+END
+STEP
+MOUSE 3 14.000 0.833
+MOUSE 3 11.833 0.833
+MESSAGE
+_________________________________________
+
+Here the connecting curve is too small.
+END
+STEP
+MOUSE 3 11.750 0.833
+BIGPAUSE
+MOUSE 4 14.500 0.833
+PARAMETER easement val 0.500
+MESSAGE
+_________________________________________
+
+The connecting curve is made of three tracks, the curve and two easement segments on each end.
+END
+STEP
+COMMAND Describe
+MOUSE 2 5.750 4.083
+MOUSE 4 5.750 4.083
+MOUSE 2 14.333 0.500
+MOUSE 4 14.333 0.500
+MOUSE 2 1.917 13.333
+MOUSE 4 1.917 13.333
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmelev.xtr b/app/lib/demos/dmelev.xtr
new file mode 100644
index 0000000..b0c524b
--- /dev/null
+++ b/app/lib/demos/dmelev.xtr
@@ -0,0 +1,357 @@
+VERSION 7
+DEMOINIT
+ORIG 12.000 0.000 0.000
+PARAMETER display description-fontsize 72
+PARAMETER display labelenable 4
+CURVE 1 0 0 0 0 N -1 12.666667 13.666667 10.000000
+ T 3 11.809617 3.703461 94.916566
+ T 5 22.410419 15.915955 167.001307
+ END
+STRAIGHT 2 0 0 0 0 N -1
+ T 3 27.376540 8.227390 232.674480
+ T 6 29.448408 9.807189 52.674480
+ END
+CURVE 3 0 0 0 0 N -1 13.737465 26.114701 22.494005
+ T 2 27.376540 8.227390 52.674480
+ T 1 11.809617 3.703461 274.916566
+ END
+STRAIGHT 4 0 0 0 0 N -1
+ T 5 37.111111 4.222222 270.000000
+ T 9 38.222222 4.222222 90.000000
+ END
+CURVE 5 0 0 0 0 N -1 37.111111 19.309524 15.087302
+ T 4 37.111111 4.222222 90.000000
+ T 1 22.410419 15.915955 347.001307
+ END
+TURNOUT 6 0 0 0 0 N -1 29.448408 9.807189 322.674480 "Peco-55 Medium Right SL-E395F"
+ T 2 29.448408 9.807189 232.674480
+ T 7 33.746482 13.084471 52.674480
+ T 8 34.035161 12.648152 62.360480
+ D 0.000000 0.000000
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0.000000 0.000000 0.000000 0.353000 0.000000
+ S 0 0.000000 0.353000 0.000000 5.405000 0.000000
+ C 0 0.000000 23.136000 0.351000 -23.136000 0.004000 9.700000
+ S 0 0.000000 4.251000 -0.331000 5.370000 -0.522000
+ END
+STRAIGHT 7 0 0 0 0 N -1
+ T 19 42.270123 19.583746 52.674480
+ T 6 33.746482 13.084471 232.674480
+ END
+CURVE 8 0 0 0 0 N -1 45.574853 -9.388207 24.875000
+ T 6 34.035161 12.648152 242.360480
+ T 18 51.462480 14.779984 103.691177
+ END
+TURNOUT 9 0 0 0 0 N -1 38.222222 4.222222 0.000000 "Peco-55 Medium Left SL-E396F"
+ T 4 38.222222 4.222222 270.000000
+ T 15 43.627222 4.222222 90.000000
+ T 13 43.592222 4.744222 80.314000
+ D 0.000000 0.000000
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0.000000 0.000000 0.000000 0.353000 0.000000
+ S 0 0.000000 0.353000 0.000000 5.405000 0.000000
+ C 0 0.000000 -23.136000 0.351000 23.136000 170.297000 9.700000
+ S 0 0.000000 4.251000 0.331000 5.370000 0.522000
+ END
+STRAIGHT 10 0 0 0 0 N -1
+ E 76.446137 4.222222 90.000000
+ T 14 72.333333 4.222222 270.000000
+ END
+STRAIGHT 11 0 0 0 0 N -1
+ T 12 49.777778 5.472222 270.000000
+ T 16 60.777778 5.472222 90.000000
+ END
+CURVE 12 0 0 0 0 N -1 49.777778 -17.192082 22.664304
+ T 13 45.964542 5.149134 260.314000
+ T 11 49.777778 5.472222 90.000000
+ END
+STRAIGHT 13 0 0 0 0 N -1
+ T 9 43.592222 4.744222 260.314000
+ T 12 45.964542 5.149134 80.314000
+ END
+TURNOUT 14 0 0 0 0 N -1 72.333333 4.222222 180.000000 "Peco-55 Medium Right SL-E395F"
+ T 10 72.333333 4.222222 90.000000
+ T 15 66.928333 4.222222 270.000000
+ T 17 66.963333 4.744222 279.686000
+ D 0.000000 0.000000
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0.000000 0.000000 0.000000 0.353000 0.000000
+ S 0 0.000000 0.353000 0.000000 5.405000 0.000000
+ C 0 0.000000 23.136000 0.351000 -23.136000 0.004000 9.700000
+ S 0 0.000000 4.251000 -0.331000 5.370000 -0.522000
+ END
+STRAIGHT 15 0 0 0 0 N -1
+ T 9 43.627222 4.222222 270.000000
+ T 14 66.928333 4.222222 90.000000
+ END
+CURVE 16 0 0 0 0 N -1 60.777778 -17.192082 22.664304
+ T 11 60.777778 5.472222 270.000000
+ T 17 64.591013 5.149134 99.686000
+ END
+STRAIGHT 17 0 0 0 0 N -1
+ T 14 66.963333 4.744222 99.686000
+ T 16 64.591013 5.149134 279.686000
+ END
+CURVE 18 0 0 0 0 N -1 64.332420 67.609950 54.375000
+ E 74.352464 14.166154 79.381036
+ T 8 51.462480 14.779984 283.691177
+ END
+CURVE 19 0 0 0 0 N -1 49.773613 9.743103 12.375000
+ T 7 42.270123 19.583746 232.674480
+ T 20 56.175027 20.333784 121.150374
+ END
+CURVE 20 0 0 0 0 N -1 64.968888 34.882599 17.000000
+ E 74.032528 20.500303 57.781104
+ T 19 56.175027 20.333784 301.150374
+ END
+REDRAW
+RESET
+MESSAGE
+We have designed part of the layout with a siding, 2 branches and a spiral loop. We want to set Elevations.
+END
+STEP
+MESSAGE
+_________________________________________
+
+First we will set elevations at the end of the branches.
+END
+STEP
+ORIG 4 65 11
+COMMAND Elevation
+PARAMETER elev mode 0
+PARAMETER elev value 0.000
+MESSAGE
+_________________________________________
+
+We'll select the end of the top branch and set the Elevation to 4"
+
+First, click on the End-Point.
+END
+STEP
+MOUSE 2 73.895 20.474
+MOUSE 4 73.895 20.474
+MESSAGE
+
+Next, pick Defined on the Elevation dialog Radio box.
+END
+STEP
+PARAMETER elev mode 1
+MESSAGE
+
+And set the Elevation to 4.
+END
+STEP
+PARAMETER elev value 4.000000
+#REDRAW
+BIGPAUSE
+MESSAGE
+_________________________________________
+
+Now, select the other branch and set it's elevation to 2"
+END
+STEP
+MOUSE 2 74.263 14.263
+MOUSE 4 74.263 14.263
+BIGPAUSE
+PARAMETER elev mode 1
+BIGPAUSE
+PARAMETER elev value 2.000000
+BIGPAUSE
+#REDRAW
+MESSAGE
+_________________________________________
+
+We can move the Elevations by using Right-Drag
+END
+STEP
+MOUSE 5 74.307 14.173
+#MOUSE 6 74.227 13.453
+MOUSE 7 74.227 12.453
+#PARAMETER elev ok
+MESSAGE
+_________________________________________
+
+Now, we set the Elevation at one end of the Siding.
+END
+STEP
+ORIG 3.000 34.000 3.000
+#COMMAND Elevation
+#PARAMETER elev mode 1
+#PARAMETER elev value 3.000
+MOUSE 2 38.160 4.320
+MOUSE 4 38.160 4.320
+BIGPAUSE
+PARAMETER elev mode 1
+BIGPAUSE
+PARAMETER elev value 0.500000
+BIGPAUSE
+REDRAW
+BIGPAUSE
+MOUSE 5 38.320 4.280
+MOUSE 6 38.240 3.480
+MOUSE 7 38.240 3.480
+#PARAMETER elev ok
+BIGPAUSE
+MESSAGE
+=========================================
+END
+STEP
+ORIG 3 21.0 5.0
+CLEAR
+MESSAGE
+We want to find the elevations where the 2 tracks cross.
+END
+STEP
+#COMMAND Elevation
+#PARAMETER elev mode 0
+#PARAMETER elev value 0.000
+MOUSE 2 27.320 8.320
+MOUSE 4 27.320 8.320
+MESSAGE
+_________________________________________
+
+We picked an End-Point on the upper track.
+
+XTrackCAD has computed the Elevation (2.34") at this point based on the Elevation at the siding and a combination of the of the first Elevations.
+
+We create a Computed Elevation here that will be automatically adjusted whenever the other Elevations are changed.
+END
+STEP
+PARAMETER elev mode 3
+BIGPAUSE
+MOUSE 5 27.400 8.240
+MOUSE 6 28.480 7.840
+MOUSE 7 28.480 7.840
+BIGPAUSE
+MESSAGE
+_________________________________________
+
+The Compute Elevation is based on Elevations at end of both of the branches. We may want to base the Elevation on only one branch. For example if one branch was the mainline we don't want the other branch affecting this Computed Elevation.
+
+We do this by Ignoring the branch we don't want.
+
+We'll ignore the lower branch.
+END
+STEP
+#ORIG 3 26 8
+MOUSE 2 34.200 12.600
+MOUSE 4 34.200 12.600
+PARAMETER elev mode 6
+REDRAW
+MESSAGE
+_________________________________________
+
+Notice at the End-Point where the tracks cross, we see the Elevation has changed from 2.34 to 2.64.
+END
+STEP
+MESSAGE
+_________________________________________
+
+Now we want to know the elevation of the lower track.
+END
+STEP
+#ORIG 3 23 6.0
+#COMMAND Elevation
+#PARAMETER elev mode 3
+#PARAMETER elev value 2.641
+MESSAGE
+_________________________________________
+
+There is no End-Point on the lower track here.
+
+Use Shift-Left-Click to Split the track and create an End-Point we can use for an Elevation,
+END
+STEP
+KEYSTATE 2
+MOUSE 2 26.480 8.520
+KEYSTATE 2
+MOUSE 4 26.480 8.520
+STEP
+MESSAGE
+and create another Computed Elevation point.
+END
+STEP
+PARAMETER elev mode 3
+BIGPAUSE
+#REDRAW
+MOUSE 5 26.480 8.640
+MOUSE 6 25.320 8.400
+MOUSE 7 25.320 8.400
+BIGPAUSE
+#PARAMETER elev ok
+MESSAGE
+_________________________________________
+
+Now we want to label the Grade on this section of track.
+END
+STEP
+#COMMAND Elevation
+#PARAMETER elev mode 3
+#PARAMETER elev value 0.835
+MESSAGE
+_________________________________________
+
+Again, since there is no End-Point nearby, we split the track to create an End-Point we can use,
+END
+STEP
+KEYSTATE 2
+MOUSE 2 24.280 6.240
+KEYSTATE 2
+MOUSE 4 24.280 6.240
+MESSAGE
+and create a Grade marker.
+END
+STEP
+PARAMETER elev mode 4
+BIGPAUSE
+MOUSE 5 24.240 6.360
+MOUSE 6 25.680 5.1
+MOUSE 7 25.680 5.1
+BIGPAUSE
+#PARAMETER elev ok
+MESSAGE
+_________________________________________
+
+Note the marker has an arrow pointing in the upwards direction.
+=========================================
+END
+STEP
+CLEAR
+ORIG 3 45 2
+MESSAGE
+_________________________________________
+
+The last thing we want to do is to create a Station label that we'll use in the <Profile> command.
+END
+STEP
+#COMMAND Elevation
+#PARAMETER elev value 0.000
+KEYSTATE 2
+MOUSE 2 55.080 5.320
+KEYSTATE 2
+MOUSE 4 55.080 5.320
+MOUSE 2 55.080 5.320
+MOUSE 4 55.080 5.320
+MESSAGE
+_________________________________________
+
+Now, set the Elevation to Station and enter the its name.
+END
+STEP
+PARAMETER elev mode 5
+BIGPAUSE
+PARAMETER elev station New York City
+BIGPAUSE
+MOUSE 5 55.120 5.480
+#MOUSE 6 54.960 6.120
+MOUSE 7 54.960 6.520
+BIGPAUSE
+PARAMETER elev ok
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmexcept.xtr b/app/lib/demos/dmexcept.xtr
new file mode 100644
index 0000000..a507771
--- /dev/null
+++ b/app/lib/demos/dmexcept.xtr
@@ -0,0 +1,89 @@
+# XTrkCad Version: 3.0.1, Date: Sat Sep 23 21:54:29 2000
+
+VERSION 10
+DEMOINIT
+ORIG 4.000 0.000 0.000
+PARAMETER display description-fontsize 64
+PARAMETER layout mintrackradius 9.000000
+PARAMETER layout maxtrackgrade 5.000000
+CURVE 1 0 128 0 0 N 2 9.328210 12.681510 0 9.000000 0 -0.662481 0.508964
+ T 3 10.311823 3.735421 83.725592
+ E 0.736918 15.362872 17.333261
+ END
+STRAIGHT 2 0 0 0 0 N 2
+ T 3 18.591303 5.367316 253.974133
+ E 23.914162 6.896222 73.974133
+ END
+CURVE 3 0 0 0 0 N 2 4.886341 53.080886 0 49.642831 0 0.000000 0.000000
+ T 2 18.591303 5.367316 73.974133
+ T 1 10.311823 3.735421 263.725592
+ END
+STRAIGHT 4 0 0 0 0 N 2
+ E 4.698097 0.130693 253.974133 9 -0.010597 0.869307 1.000000
+ T 5 14.456557 2.933654 73.974133 11 0.855943 -1.308654
+ END
+STRAIGHT 5 0 0 0 0 N 2
+ E 23.748581 5.602640 73.974133 9 -1.123581 -1.415140 1.750000
+ T 4 14.456557 2.933654 253.974133 11 0.855943 -1.308654
+ END
+REDRAW
+RESET
+MESSAGE
+XTrackCAD can help find tracks that are curved too sharply or are too steep. These tracks are Exception tracks and are drawn in the Exception track color.
+
+In this example we have a curved track with radius of 9" and a straight track with a grade of 3.8%.
+
+END
+STEP
+PARAMETER misc cmdLayout
+MESSAGE
+_________________________________________
+
+The Layout dialog shows the Minimum Track Radius is 9" and the Maximum Track Grade is 5%.
+END
+STEP
+PARAMETER layout mintrackradius 9.000000
+PARAMETER layout maxtrackgrade 5.000000
+PARAMETER layout ok
+MESSAGE
+_________________________________________
+
+If we make the curved track sharper it will be drawn in the Exception color.
+END
+STEP
+COMMAND Describe
+MOUSE 2 4.500 5.188
+MOUSE 4 4.500 5.188
+BIGPAUSE
+#DESCRIBE Radius 8.000
+PARAMETER describe F9 8.000
+STEP
+MESSAGE
+_________________________________________
+
+If we make the straight track steeper it will also be drawn in the Exception color.
+END
+STEP
+MOUSE 2 23.125 5.375
+MOUSE 4 23.125 5.375
+BIGPAUSE
+#DESCRIBE Z 2.250
+PARAMETER describe F3 2.250
+REDRAW
+STEP
+#DESCRIBE OK
+PARAMETER describe ok
+RESET
+PARAMETER misc cmdColor
+MESSAGE
+_________________________________________
+
+You can change the Exception color on the Colors dialog from the Options menu.
+END
+STEP
+PARAMETER rgbcolor ok
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmextend.xtr b/app/lib/demos/dmextend.xtr
new file mode 100644
index 0000000..1996c42
--- /dev/null
+++ b/app/lib/demos/dmextend.xtr
@@ -0,0 +1,69 @@
+VERSION 2
+DEMOINIT
+ORIG 8.000 0.000 0.000
+TURNOUT 1 DEMO 1 6.916667 2.666667 0.000000 "Peco-55 Med Left SL-E396F"
+ E 6.916667 2.666667 270.000000
+ E 12.321667 2.666667 90.000000
+ E 12.286667 3.188667 80.314000
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0 0.000000 0.000000 0.353000 0.000000
+ S 0 0 0.353000 0.000000 5.405000 0.000000
+ C 0 0 -23.136000 0.351000 23.136000 170.297000 9.700000
+ S 0 0 4.251000 0.331000 5.370000 0.522000
+ END
+STRAIGHT 2 DEMO 1
+ E 2 1 270
+ E 12 1 90
+ END
+REDRAW
+RESET
+MESSAGE
+The unconnected End-Point of any track can be extended with the <Modify> command using Right-Drag.
+END
+STEP
+COMMAND Modify
+MESSAGE
+_________________________________________
+
+Select the End-Point and Right-Drag.
+END
+BIGPAUSE
+MOUSE 5 12.250 2.750
+MOUSE 6 15.500 2.583
+MESSAGE
+_________________________________________
+
+The extending track can be straight...
+END
+BIGPAUSE
+PAUSE 60
+MOUSE 6 15.500 2.583
+MOUSE 6 26.000 2.583
+PAUSE 50
+MESSAGE
+
+... or curved.
+END
+BIGPAUSE
+MOUSE 6 26.083 2.583
+MOUSE 7 26.333 12.417
+MESSAGE
+_________________________________________
+
+If you extend a Straight or Curved flex track and enable Easements then an Easement curve will be automatically generated when you extend the track.
+END
+STEP
+PARAMETER misc cmdEasement
+BIGPAUSE
+PARAMETER easement val 0.500
+BIGPAUSE
+PARAMETER easement ok
+MOUSE 5 12 1
+MOUSE 6 18 1
+MOUSE 7 28 11
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmflip.xtr b/app/lib/demos/dmflip.xtr
new file mode 100644
index 0000000..b6ad7ab
--- /dev/null
+++ b/app/lib/demos/dmflip.xtr
@@ -0,0 +1,190 @@
+# XTrkCad Version: 3.0.1, Date: Sat Sep 23 22:47:33 2000
+
+VERSION 10
+DEMOINIT
+ORIG 4.000 0.000 0.000
+PARAMETER display description-fontsize 64
+STRUCTURE 1 0 0 0 0 DEMO 2 6.210395 3.915802 0 236.697715 "Walthers Interstate Fuel - Loading Rack 933-32000a"
+ D 0.000000 0.000000
+ L3 0 0.000000 0.750000 0.000000 0 3.750000 0.000000 0
+ L3 0 0.000000 3.750000 0.000000 0 3.750000 3.125000 0
+ L3 0 0.000000 3.750000 3.125000 0 0.750000 3.125000 0
+ L3 0 0.000000 3.687500 0.062500 0 1.687500 0.062500 0
+ L3 0 0.000000 1.687500 0.062500 0 1.687500 0.812500 0
+ L3 0 0.000000 1.687500 0.812500 0 3.687500 0.812500 0
+ L3 0 0.000000 3.687500 0.812500 0 3.687500 0.062500 0
+ L3 0 0.000000 3.687500 3.062500 0 1.687500 3.062500 0
+ L3 0 0.000000 1.687500 3.062500 0 1.687500 2.312500 0
+ L3 0 0.000000 1.687500 2.312500 0 3.687500 2.312500 0
+ L3 0 0.000000 3.687500 2.312500 0 3.687500 3.062500 0
+ L3 0 0.000000 3.687500 1.187500 0 1.687500 1.187500 0
+ L3 0 0.000000 1.687500 1.187500 0 1.687500 1.937500 0
+ L3 0 0.000000 1.687500 1.937500 0 3.687500 1.937500 0
+ L3 0 0.000000 3.687500 1.937500 0 3.687500 1.187500 0
+ A3 0 0.000000 0.088388 3.000000 2.687500 0 0.000000 360.000000
+ A3 0 0.000000 0.088388 3.000000 1.562500 0 0.000000 360.000000
+ A3 0 0.000000 0.088388 3.000000 0.437500 0 0.000000 360.000000
+ L3 0 0.000000 0.750000 2.875000 0 0.000000 2.875000 0
+ L3 0 0.000000 0.000000 2.875000 0 0.000000 0.250000 0
+ L3 0 0.000000 0.000000 0.250000 0 0.750000 0.250000 0
+ L3 0 0.000000 1.500000 2.187500 0 0.437500 2.187500 0
+ L3 0 0.000000 0.437500 2.187500 0 0.437500 0.937500 0
+ L3 0 0.000000 0.437500 0.937500 0 1.500000 0.937500 0
+ L3 0 0.000000 1.500000 0.937500 0 1.500000 2.187500 0
+ L3 0 0.000000 0.750000 3.125000 0 0.750000 2.187500 0
+ L3 0 0.000000 0.750000 0.000000 0 0.750000 0.937500 0
+ END
+STRAIGHT 2 0 0 0 0 DEMO 2
+ E 0.105826 -1.346082 236.697715
+ T 5 3.511000 0.890894 56.697715
+ END
+STRUCTURE 3 0 0 0 0 DEMO 2 15.697638 4.710368 0 326.697715 "Walthers Shady Jct Water Tower 933-3205a"
+ D 0.000000 0.000000
+ L3 0 0.000000 0.000000 0.000000 0 1.562500 0.000000 0
+ L3 0 0.000000 1.562500 0.000000 0 1.562500 1.562500 0
+ L3 0 0.000000 1.562500 1.562500 0 0.000000 1.562500 0
+ L3 0 0.000000 0.000000 1.562500 0 0.000000 0.000000 0
+ L3 0 0.000000 0.000000 0.375000 0 1.250000 0.375000 0
+ L3 0 0.000000 1.250000 0.375000 0 1.250000 1.562500 0
+ L3 0 0.000000 0.625000 1.000000 0 0.625000 0.375000 0
+ L3 0 0.000000 0.625000 1.000000 0 1.250000 1.000000 0
+ L3 0 0.000000 0.625000 1.000000 0 0.000000 1.000000 0
+ L3 0 0.000000 0.625000 1.000000 0 0.625000 1.562500 0
+ L3 0 0.000000 0.625000 1.000000 0 1.062500 1.437500 0
+ L3 0 0.000000 0.625000 1.000000 0 1.062500 0.562500 0
+ L3 0 0.000000 0.625000 1.000000 0 0.187500 0.562500 0
+ L3 0 0.000000 0.625000 1.000000 0 0.187500 1.437500 0
+ L3 0 0.000000 0.625000 1.562500 0 1.062500 1.437500 0
+ L3 0 0.000000 1.062500 1.437500 0 1.250000 1.000000 0
+ L3 0 0.000000 1.250000 1.000000 0 1.062500 0.562500 0
+ L3 0 0.000000 1.062500 0.562500 0 0.625000 0.375000 0
+ L3 0 0.000000 0.625000 0.375000 0 0.187500 0.562500 0
+ L3 0 0.000000 0.187500 0.562500 0 0.000000 1.000000 0
+ L3 0 0.000000 0.000000 1.000000 0 0.187500 1.437500 0
+ L3 0 0.000000 0.187500 1.437500 0 0.625000 1.562500 0
+ L3 0 0.000000 1.250000 1.500000 0 1.750000 1.500000 0
+ L3 0 0.000000 1.750000 1.500000 0 1.750000 1.062500 0
+ L3 0 0.000000 1.750000 1.062500 0 1.250000 1.062500 0
+ END
+STRAIGHT 4 0 0 0 0 DEMO 2
+ E 22.026067 13.054077 56.697715
+ T 5 8.028421 3.858543 236.697715
+ END
+TURNOUT 5 0 0 0 0 DEMO 2 3.511000 0.890894 0 326.697715 "Peco-55 Medium Right SL-E395F"
+ T 2 3.511000 0.890894 236.697715
+ T 4 8.028421 3.858543 56.697715
+ T 8 8.285775 3.403046 66.383715
+ D 0.000000 0.000000
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0.000000 0.000000 0.000000 0.353000 0.000000
+ S 0 0.000000 0.353000 0.000000 5.405000 0.000000
+ C 0 0.000000 23.136000 0.351000 -23.136000 0.004000 9.700000
+ S 0 0.000000 4.251000 -0.331000 5.370000 -0.522000
+ END
+STRAIGHT 6 0 0 0 0 DEMO 2
+ E 22.690715 11.995108 56.697715
+ T 7 13.433501 5.913726 236.697715
+ END
+CURVE 7 0 0 0 0 DEMO 2 4.259807 19.878127 0 16.708116 0 0.000000 0.000000
+ T 6 13.433501 5.913726 56.697715
+ T 8 10.953237 4.569334 246.383715
+ END
+STRAIGHT 8 0 0 0 0 DEMO 2
+ T 5 8.285775 3.403046 246.383715
+ T 7 10.953237 4.569334 66.383715
+ END
+STRUCTURE 9 0 0 0 0 DEMO 2 16.897495 6.987885 0 326.697715 "Walthers 2-Stall Engine House 933-3204"
+ D 0.000000 0.000000
+ L3 0 0.000000 0.000000 0.000000 0 7.625000 0.000000 0
+ L3 0 0.000000 7.625000 0.000000 0 7.625000 3.250000 0
+ L3 0 0.000000 7.625000 3.250000 0 0.000000 3.250000 0
+ L3 0 0.000000 0.000000 3.250000 0 0.000000 0.000000 0
+ L3 0 0.000000 0.000000 1.625000 0 7.625000 1.625000 0
+ L3 0 0.000000 0.000000 2.000000 0 7.625000 2.000000 0
+ L3 0 0.000000 0.000000 1.250000 0 7.625000 1.250000 0
+ A3 0 0.000000 0.225347 6.625000 0.875000 0 0.000000 360.000000
+ A3 0 0.000000 0.139754 6.625000 0.875000 0 0.000000 360.000000
+ A3 0 0.000000 0.225347 1.000000 0.875000 0 0.000000 360.000000
+ A3 0 0.000000 0.139754 1.000000 0.875000 0 0.000000 360.000000
+ A3 0 0.000000 0.225347 1.000000 2.375000 0 0.000000 360.000000
+ A3 0 0.000000 0.139754 1.000000 2.375000 0 0.000000 360.000000
+ A3 0 0.000000 0.225347 6.625000 2.375000 0 0.000000 360.000000
+ A3 0 0.000000 0.139754 6.625000 2.375000 0 0.000000 360.000000
+ END
+DRAW 10 0 0 0 0 0.000000 0.000000 0 0.000000
+ F3 3866368 0.000000 3
+ 8.000000 11.000000 0
+ 8.000000 5.687500 0
+ 10.156250 5.687500 0
+ END
+REDRAW
+RESET
+MESSAGE
+The <Flip> command will create a mirror image of the selected objects.
+END
+STEP
+MOUSE 2 7.625 7.938
+MOUSE 4 7.625 7.938
+COMMAND Flip
+MESSAGE
+_________________________________________
+
+After selecting the object, drag a line which will form the mirror.
+END
+STEP
+MOUSE 2 6.938 7.875
+BIGPAUSE
+MOUSE 4 10.438 7.875
+MESSAGE
+_________________________________________
+
+The mirror line does not have to be vertical or horizontal.
+END
+STEP
+MOUSE 2 6.938 6.000
+BIGPAUSE
+MOUSE 4 10.562 10.625
+MESSAGE
+_________________________________________
+
+You can also flip any number of objects.
+
+Watch what happens to the structure and turnout titles.
+END
+STEP
+PARAMETER misc cmdSelectAll
+BIGPAUSE
+MOUSE 2 12.000 11.938
+BIGPAUSE
+MOUSE 4 12.000 -0.125
+REDRAW
+MESSAGE
+_________________________________________
+
+Note that the turnout title has been changed from the Medium Right to Medium Left. When turnouts are flipped, XTrackCAD will try to find a matching turnout and if found will change the name.
+END
+STEP
+COMMAND Describe
+MESSAGE
+_________________________________________
+
+Structures do not have Right and Left hand versions. Their title is changed to indicate that they were flipped.
+
+You can use the <Describe> command to change their title.
+END
+STEP
+MOUSE 2 20.125 4.812
+MOUSE 4 20.125 4.812
+STEP
+#DESCRIBE Name Interstate Fuel - Loading Rack
+PARAMETER describe S2 Interstate Fuel - Loading Rack
+BIGPAUSE
+#DESCRIBE OK
+PARAMETER describe ok
+REDRAW
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmgroup.xtr b/app/lib/demos/dmgroup.xtr
new file mode 100644
index 0000000..efc883d
--- /dev/null
+++ b/app/lib/demos/dmgroup.xtr
@@ -0,0 +1,467 @@
+# XTrkCad Version: 3.0.1, Date: Wed Sep 20 22:05:35 2000
+
+VERSION 10
+DEMOINIT
+PARAMETER display labelenable 1
+ORIG 2.000 0.000 0.000
+TURNOUT 6 0 0 0 0 DEMO 2 2.125000 2.281250 0 0.000000 "Peco-55 Medium Right SL-E395F"
+ E 2.125000 2.281250 270.000000
+ E 7.530000 2.281250 90.000000
+ E 7.495000 1.759250 99.686000
+ D -0.108750 -0.832750
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0.000000 0.000000 0.000000 0.353000 0.000000
+ S 0 0.000000 0.353000 0.000000 5.405000 0.000000
+ C 0 0.000000 23.136000 0.351000 -23.136000 0.004000 9.700000
+ S 0 0.000000 4.251000 -0.331000 5.370000 -0.522000
+ END
+REDRAW
+RESET
+MESSAGE
+The <Group> and <Ungroup> commands (on the Tools menu) are a powerful way to manipulate Turnout and Structure definitions.
+
+We'll start with a simple turnout and add a switch machine.
+END
+STEP
+COMMAND DrawLine
+PARAMETER draw linewidth 0
+PARAMETER draw linecolor 0
+PARAMETER GROUP draw
+PARAMETER draw linewidth 4
+MOUSE 2 2.500 3.000
+MOUSE 4 2.500 1.500
+MOUSE 2 3.200 3.000
+MOUSE 4 3.200 1.500
+RESET
+COMMAND DrawFilledBox
+PARAMETER draw linecolor 0
+PARAMETER GROUP draw
+MOUSE 2 2.600 3.000
+MOUSE 4 3.100 2.500
+MOUSE 2 2.600 2.000
+MOUSE 4 3.100 1.500
+RESET
+MESSAGE
+_________________________________________
+
+Now that we have drawn a rough outline of a switch machine we will group it with the turnout definition.
+
+First we Select the objects in the new definition.
+END
+STEP
+COMMAND Select
+MOUSE 2 0.781 3.375
+MOUSE 4 8.312 1.312
+MESSAGE
+_________________________________________
+
+Now do the <Group> command.
+END
+STEP
+PARAMETER misc cmdGroup
+MESSAGE
+_________________________________________
+
+The <Group> command dialog shows the Title (Manufacturer, Description and Part Number) of the new definition. This information is taken from the Selected objects you are grouping.
+END
+STEP
+MESSAGE
+_________________________________________
+
+The 'Replace with new group?' toggle will replace the Selected objects with the new definition.
+END
+STEP
+PARAMETER group replace 1
+MESSAGE
+_________________________________________
+
+If we don't change the Title then the new definition will replace the existing definition.
+
+We'll give this definition a new Description.
+END
+STEP
+PARAMETER group desc M Medium Right
+PARAMETER group desc Modi Medium Right
+PARAMETER group desc Modified Medium Right
+MESSAGE
+_________________________________________
+
+We're done with this definition. Press Ok.
+END
+STEP
+PARAMETER group ok
+MESSAGE
+_________________________________________
+
+You will see the updated image on the HotBar.
+END
+STEP
+CLEAR
+MESSAGE
+The <Ungroup> command replaces any Selected turnouts or structures with their parts.
+
+Structures and non-track segements of turnouts are composed of Lines, Circles and other shapes. In this turnout these are the two lines and the two squares.
+
+We will Ungroup this turnout and see how the individual parts can be changed.
+
+First Select the turnout and then Ungroup it.
+
+END
+STEP
+MOUSE 2 7.156 2.094
+MOUSE 4 7.156 2.094
+PARAMETER misc cmdUngroup
+MESSAGE
+_________________________________________
+
+Notice that the Title now indicates the turnout is Ungrouped.
+
+Hit Escape to deselect everything.
+END
+STEP
+MOUSE 6920 4.094 5.188
+RESET
+MESSAGE
+_________________________________________
+
+Now Select the lines and squares.
+END
+STEP
+MOUSE 2 2.469 2.812
+MOUSE 4 2.469 2.812
+MOUSE 2 2.688 2.875
+MOUSE 4 2.688 2.875
+MOUSE 2 3.188 2.844
+MOUSE 4 3.188 2.844
+MOUSE 2 2.812 1.656
+MOUSE 4 2.812 1.656
+MESSAGE
+_________________________________________
+
+We could modify these object or add new ones. For now we'll just delete them.
+END
+STEP
+PARAMETER misc cmdDelete
+MESSAGE
+_________________________________________
+
+And move the Label out of the way.
+END
+STEP
+COMMAND MoveLabel
+MOUSE 2 4.281 2.031
+MOUSE 4 4.594 0.844
+ORIG 3.000 0.000 0.000
+ORIG 1.000 2.000 1.000
+MESSAGE
+_________________________________________
+
+Notice that the turnout has been broken into three parts.
+END
+STEP
+COMMAND Describe
+MOUSE 2 4.531 2.219
+MOUSE 4 4.531 2.219
+BIGPAUSE
+MOUSE 2 6.984 1.812
+MOUSE 4 6.984 1.812
+BIGPAUSE
+MOUSE 2 2.359 2.266
+MOUSE 4 2.359 2.266
+BIGPAUSE
+#DESCRIBE OK
+PARAMETER describe ok
+RESET
+MESSAGE
+_________________________________________
+
+Two ends of the turnout, from the frog to the end of the diverging leg and from the points to the left, are now straight track sections.
+
+The a turnout is made of a number of individual straight and curved track segements. This turnout had four segments:
+ 1 a short straight segment to the left of the points
+ 2 a long straight segment to the right of the points
+ 3 a curved segment from the points to the frog
+ 4 a straight segment from the frog to the end of the diverging leg.
+The first and last segments have be converted to straight tracks.
+The second and third segments form the the body of the turnout and can not be ungrouped further.
+
+You can later Group this turnout with the straight segments to recreate the turnout definition. You can also add other track segments to turnout definitions.
+
+END
+STEP
+KEYSTATE 2
+MOUSE 2 4.625 1.969
+KEYSTATE 2
+MOUSE 4 4.625 1.969
+PARAMETER misc cmdDelete
+ORIG 3.000 0.000 0.000
+CLEAR
+MESSAGE
+Now, create a track and place the new turnout on it.
+END
+STEP
+COMMAND Straight
+MOUSE 2 0.281 0.688
+MOUSE 4 11.156 4.281
+BIGPAUSE
+COMMAND TurnoutHotBar
+#PARAMETER turnout list 0
+PARAMETER GROUP turnout
+HOTBARSELECT Peco-55 Modified Medium Right SL-E395F
+MOUSE 4 4.750 1.906
+MOUSE 8200 4.750 1.906
+MESSAGE
+_________________________________________
+
+Now suppose we want to replace the black squares with green circles.
+
+First we Select the turnout.
+END
+STEP
+COMMAND Select
+MOUSE 2 6.062 2.906
+MOUSE 4 6.062 2.906
+MESSAGE
+And now Ungroup it (from the Tools Menu)
+END
+STEP
+PARAMETER misc cmdUngroup
+MESSAGE
+_________________________________________
+
+Notice that the name has changed to indicate the turnout was Ungrouped.
+END
+STEP
+MESSAGE
+_________________________________________
+
+Now, hit escape to deselect everything and then Select the 2 squares and delete them.
+END
+STEP
+MOUSE 6920 6.062 2.906
+RESET
+BIGPAUSE
+MOUSE 2 5.219 2.938
+MOUSE 4 5.219 2.938
+MOUSE 2 5.531 1.844
+MOUSE 4 5.531 1.844
+PARAMETER misc cmdDelete
+MESSAGE
+_________________________________________
+
+Now draw the green circles...
+END
+STEP
+ORIG 1.000 2.000 1.000
+COMMAND DrawFilledCircleCenter
+PARAMETER draw linecolor 0
+PARAMETER GROUP draw
+PARAMETER draw linecolor 65280
+MOUSE 2 5.203 2.812
+MOUSE 4 5.359 2.609
+PARAMETER GROUP draw
+MOUSE 2 5.516 1.891
+MOUSE 4 5.672 1.719
+PARAMETER GROUP draw
+MESSAGE
+and Group the new definition.
+END
+STEP
+ORIG 2.000 0.000 0.000
+RESET
+COMMAND Select
+MOUSE 2 3.719 4.156
+MOUSE 4 10.531 0.969
+BIGPAUSE
+PARAMETER misc cmdGroup
+PARAMETER group replace 1
+BIGPAUSE
+PARAMETER group ok
+MESSAGE
+_________________________________________
+
+Notice that the turnout in the HotBar is angled the same as the turnout on the layout. Make sure your new definition is rotated the way you want it.
+END
+STEP
+KEYSTATE 2
+MOUSE 2 5.000 2.188
+KEYSTATE 2
+MOUSE 4 5.000 2.188
+PARAMETER misc cmdDelete
+CLEAR
+RESET
+MESSAGE
+We can also create turnouts from simple straight and curved tracks.
+
+We'll create two tracks that have a common End-Point.
+END
+STEP
+COMMAND Straight
+MOUSE 2 2.000 2.000
+MOUSE 4 10.000 2.000
+COMMAND CurveEndPt
+MOUSE 2 2.000 2.000
+MOUSE 4 9.000 2.000
+MOUSE 2 9.000 2.000
+MOUSE 4 8.875 3.062
+MESSAGE
+_________________________________________
+
+At this point we can modify the tracks if necessary.
+
+We will use the <Describe> command to change the tracks.
+END
+STEP
+COMMAND Describe
+MOUSE 2 9.438 2.000
+MOUSE 4 9.438 2.000
+MESSAGE
+_________________________________________
+
+We'll make the Length 7.5".
+
+If we change the Length, each End-Point will be moved to shorten the track. We want to just move the Right End-Point. To control this, change the Pivot to First which means the Left End-Point will be unchanged when we change the length (or angle) of the track.
+END
+STEP
+#DESCRIBE Pivot 0
+PARAMETER describe P1 0
+MESSAGE
+_________________________________________
+
+Now when change the Length only the Right End-Point will move.
+END
+STEP
+#DESCRIBE Length 7.500
+PARAMETER describe F7 7.500
+#DESCRIBE OK
+PARAMETER describe ok
+RESET
+MESSAGE
+_________________________________________
+
+Now let's look at the curved track.
+END
+STEP
+COMMAND Describe
+MOUSE 2 7.688 2.625
+MOUSE 4 7.688 2.625
+MESSAGE
+_________________________________________
+
+Here the Left End-Point (which we don't want to move) is the Second End-Point, so we'll make that the Pivot.
+END
+STEP
+#DESCRIBE Pivot 2
+PARAMETER describe P1 2
+MESSAGE
+_________________________________________
+
+We want the curve to have a radius of 20" and an angle of 17.5°.
+First change the Radius...
+END
+STEP
+#DESCRIBE Radius 20.000
+PARAMETER describe F9 20.000000
+MESSAGE
+and the the Angular Length.
+END
+STEP
+PARAMETER describe F11 17.5
+BIGPAUSE
+#DESCRIBE OK
+PARAMETER describe ok
+MESSAGE
+_________________________________________
+
+Now Select both tracks...
+END
+STEP
+COMMAND Select
+MOUSE 2 7.500 2.750
+MOUSE 4 7.500 2.750
+MOUSE 2 8.000 2.000
+MOUSE 4 8.000 2.000
+MESSAGE
+and Group them.
+END
+PARAMETER group manuf
+PARAMETER group desc
+PARAMETER group partno
+STEP
+PARAMETER misc cmdGroup
+PARAMETER group manuf Custom
+PARAMETER group desc Left
+PARAMETER group partno 99-L
+MESSAGE
+_________________________________________
+
+If the two tracks have a common End-Point then they will form a Turnout and can be switched with the <Train> command. Otherwise they will just be two track segments grouped together.
+END
+STEP
+PARAMETER group ok
+MESSAGE
+_________________________________________
+
+We have created a left hand turnout and we also want a right hand version.
+
+We'll use the <Flip> command.
+END
+STEP
+COMMAND Select
+MOUSE 2 7.812 2.250
+MOUSE 4 7.812 2.250
+COMMAND Flip
+MESSAGE
+_________________________________________
+
+Drag a horizontal line that will be the mirror for the <Flip> command.
+END
+STEP
+MOUSE 2 1.438 1.938
+MOUSE 4 11.625 1.938
+MESSAGE
+_________________________________________
+
+Notice the title has changed to Flipped Left.
+
+Now Group the turnout.
+END
+STEP
+PARAMETER misc cmdGroup
+MESSAGE
+_________________________________________
+
+We'll change the Title and Part No for the new defintion.
+END
+STEP
+PARAMETER group desc Right
+PARAMETER group partno 99-
+PARAMETER group partno 99-R
+PARAMETER group replace 1
+PARAMETER group ok
+STEP
+CLEAR
+MESSAGE
+To Remove the definitions, use the Custom Management dialog on the Tools menu.
+END
+STEP
+PARAMETER misc cmdCustmgm
+MESSAGE
+_________________________________________
+
+Select the definitions you added and Delete them.
+END
+STEP
+PARAMETER custmgm inx 0 Peco-55 DEMO SL-E395F Modified Medium Right
+PARAMETER custmgm delete
+PARAMETER custmgm inx 0 Custom DEMO 99-L Left
+PARAMETER custmgm delete
+PARAMETER custmgm inx 0 Custom DEMO 99-R Right
+PARAMETER custmgm delete
+PARAMETER custmgm ok
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmhelix.xtr b/app/lib/demos/dmhelix.xtr
new file mode 100644
index 0000000..1a54c48
--- /dev/null
+++ b/app/lib/demos/dmhelix.xtr
@@ -0,0 +1,193 @@
+VERSION 7
+DEMOINIT
+ORIG 10.000 0.000 0.000
+PARAMETER display labelscale 10
+PARAMETER display description-fontsize 144
+STRAIGHT 1 0 0 0 0 N -1
+ E 23.086096 1.459535 254.675892
+ E 72.500000 15.000000 74.675892
+ END
+STRAIGHT 2 0 0 0 0 N -1
+ E 1.770859 28.642902 189.520022
+ E 5.625000 51.625000 9.520022
+ END
+REDRAW
+RESET
+MESSAGE
+Now we will create a helix in the corner of the layout connected to 2 tracks.
+END
+STEP
+COMMAND Helix
+PARAMETER helix radius 18.000
+PARAMETER helix turns 1
+PARAMETER helix elev 0.0
+PARAMETER helix angSep 0.0
+PARAMETER helix grade 0.0
+PARAMETER helix vertSep 1.0
+PARAMETER helix vertSep 0.0
+MESSAGE
+_________________________________________
+
+We will be creating a helix with a Elevation Difference of 12", Grade of 1.5% and limit the Vertical Separation to at least 2".
+END
+STEP
+MESSAGE
+_________________________________________
+
+First set the Elevation Difference to 12"
+END
+STEP
+PARAMETER helix elev 12.0
+BIGPAUSE
+BIGPAUSE
+MESSAGE
+_________________________________________
+
+Next set the Vertical Separation to 2"
+Notice how this causes the number of Turns to be set to 6
+END
+STEP
+PARAMETER helix vertSep 2.0
+STEP
+MESSAGE
+_________________________________________
+
+Next set the Grade to 1.5%
+Notice how this causes the Radius to change.
+END
+STEP
+PARAMETER helix grade 1.5
+MESSAGE
+_________________________________________
+
+Setting these values changes the Radius to 21.2" and the number of Turns to 6.
+END
+STEP
+MESSAGE
+_________________________________________
+
+Now we specify the Angular Separation between the enterance and exit to the helix.
+
+Note: this will decrease the Radius slightly.
+END
+STEP
+PARAMETER helix angSep 90.0
+BIGPAUSE
+MESSAGE
+_________________________________________
+
+Next we can fine tune the helix by decreasing the Radius to 15".
+Note the change to the Grade.
+END
+STEP
+PARAMETER helix radius 15.0
+BIGPAUSE
+MESSAGE
+_________________________________________
+
+Lastly change the Vertical Separation to 2.5". The number of Turns will change to 4 and the grade increase to almost 3%.
+
+Note: the Vertical Separation will be increased. This value is the Elevation Difference (12.0) divided by the total number of turns. The total number of turns is 4.25: 4 whole Turns plus a quarter turn for the Angular Separation.
+END
+STEP
+PARAMETER helix vertSep 2.5
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
+MESSAGE
+Now that the helix parameters are set we can place the helix on the layout.
+END
+MOUSE 2 15.375 20.500
+MOUSE 3 15.375 20.500
+MOUSE 3 16.000 16.000
+STEP
+MOUSE 4 16.000 16.000
+RESET
+MESSAGE
+_________________________________________
+
+Next, join the 2 straight tracks to the helix in the same way we join to a circle.
+END
+STEP
+COMMAND Join
+MOUSE 2 1.875 30.000
+MOUSE 4 1.875 30.000
+MOUSE 2 1.000 17.375
+MOUSE 3 1.000 17.250
+MOUSE 3 1.000 17.000
+MOUSE 3 1.000 17.000
+MOUSE 3 1.000 16.750
+MOUSE 3 1.000 16.500
+MOUSE 3 1.125 16.500
+MOUSE 3 1.125 16.375
+MOUSE 3 1.125 16.250
+MOUSE 4 1.125 16.250
+MOUSE 2 28.125 3.000
+MOUSE 4 28.125 3.000
+MOUSE 2 16.500 1.000
+MOUSE 3 16.500 1.000
+MOUSE 3 16.375 1.000
+MOUSE 3 16.125 1.000
+MOUSE 3 16.125 0.875
+MOUSE 3 16.000 0.875
+MOUSE 3 16.000 0.875
+MOUSE 3 15.875 0.875
+MOUSE 3 15.625 0.875
+MOUSE 3 15.500 1.000
+MOUSE 3 15.375 1.000
+MOUSE 4 15.375 1.000
+MESSAGE
+_________________________________________
+
+Notice that the length has increased because we have more than 4 turns in the helix. It is closer to 4.25 turns.
+END
+STEP
+COMMAND Elevation
+PARAMETER elev mode 0
+PARAMETER elev value 0.000
+PARAMETER elev station
+MESSAGE
+_________________________________________
+
+Next, we assign elevations to the 2 End-Points of the helix. This will determine the grade and separation between the helix coils.
+
+Note: we could set the elevations anywhere along the connecting tracks instead. XTrackCAD treats a helix as a single length of track for elevations.
+END
+STEP
+MOUSE 2 15.125 1.125
+MOUSE 4 15.125 1.125
+PARAMETER elev mode 1
+PARAMETER elev value 1.000000
+BIGPAUSE
+MOUSE 2 1.250 16.000
+MOUSE 4 1.250 16.000
+PARAMETER elev mode 1
+PARAMETER elev value 13.000000
+PARAMETER elev ok
+BIGPAUSE
+RESET
+REDRAW
+MESSAGE
+_________________________________________
+
+We have set the elevations to 1" and 13" to produce a grade of 3.0% with 2.8" between coils.
+
+You can use the <Describe> command to change the number of Turns or the Elevations at either end of the Helix. This will affect the Grade and Vertical Separation.
+END
+STEP
+MESSAGE
+_________________________________________
+
+The helix description can be moved by the <Move Label> command.
+END
+COMMAND MoveLabel
+MOUSE 2 15.875 16.125
+MOUSE 3 16.125 6.250
+MOUSE 4 16.125 6.250
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmhndld.xtr b/app/lib/demos/dmhndld.xtr
new file mode 100644
index 0000000..2647818
--- /dev/null
+++ b/app/lib/demos/dmhndld.xtr
@@ -0,0 +1,111 @@
+# XTrkCad Version: 3.0.1, Date: Sat Sep 23 20:54:12 2000
+
+VERSION 10
+DEMOINIT
+ORIG 4.000 13.000 6.000
+STRAIGHT 1 0 0 0 0 N 2
+ E 13.625000 6.625000 243.300294
+ E 34.875000 17.312500 63.300294
+ END
+CURVE 2 0 0 0 0 N 2 34.992582 -3.178627 0 16.250000 0 0.000000 0.000000
+ E 19.937500 2.937500 202.109448
+ E 40.001921 12.279996 107.954824
+ END
+REDRAW
+RESET
+MESSAGE
+In addition to using the turnout definitions you can create 'Hand Laid Turnout'.
+
+This is two step process:
+END
+STEP
+COMMAND HandLaidTurnout
+MESSAGE
+1 - click on the frog and drag away to set the frog angle
+END
+STEP
+MOUSE 2 24.125 12.000
+MOUSE 3 28.312 15.312
+MESSAGE
+ Hint: the further you drag from the frog, the more accurate the angle.
+END
+STEP
+MOUSE 4 28.312 15.312
+MESSAGE
+2 - click and drag to set the position of the points
+END
+STEP
+MOUSE 2 21.312 10.500
+BIGPAUSE
+MOUSE 4 20.688 10.188
+RESET
+MESSAGE
+_________________________________________
+
+We can create Hand Laid Turnouts on curved tracks.
+END
+STEP
+COMMAND HandLaidTurnout
+BIGPAUSE
+MOUSE 2 26.750 10.875
+MOUSE 4 31.875 15.562
+BIGPAUSE
+MOUSE 2 23.688 8.500
+MOUSE 4 23.125 7.312
+RESET
+BIGPAUSE
+ORIG 2.000 19.000 7.000
+MESSAGE
+_________________________________________
+
+A Hand Laid Turnout is composed of several parts.
+END
+STEP
+COMMAND Describe
+MOUSE 2 21.000 10.312
+MOUSE 4 21.000 10.312
+MESSAGE
+The actual Turnout is a short portion at the points.
+END
+STEP
+MOUSE 2 23.375 12.000
+MOUSE 4 23.375 12.000
+BIGPAUSE
+MOUSE 2 24.094 12.500
+MOUSE 4 24.094 12.500
+BIGPAUSE
+MESSAGE
+The other parts are various straight and curved segments.
+END
+STEP
+MESSAGE
+_________________________________________
+
+The new curved turnout is also composed of several segments.
+END
+STEP
+MOUSE 2 23.094 7.844
+MOUSE 4 23.094 7.844
+BIGPAUSE
+#MOUSE 2 23.312 8.156
+#MOUSE 4 23.312 8.156
+#BIGPAUSE
+#MOUSE 2 23.281 8.250
+#MOUSE 4 23.281 8.250
+#BIGPAUSE
+MOUSE 2 25.500 10.344
+MOUSE 4 25.500 10.344
+BIGPAUSE
+MOUSE 2 26.531 11.250
+MOUSE 4 26.531 11.250
+BIGPAUSE
+MOUSE 2 26.656 11.094
+MOUSE 4 26.656 11.094
+#DESCRIBE OK
+PARAMETER describe ok
+RESET
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmintro.xtr b/app/lib/demos/dmintro.xtr
new file mode 100644
index 0000000..602b436
--- /dev/null
+++ b/app/lib/demos/dmintro.xtr
@@ -0,0 +1,79 @@
+VERSION 1
+DEMOINIT
+ORIG 12.000 0.000 0.000
+PARAMETER display description-fontsize 18
+REDRAW
+RESET
+MESSAGE
+Welcome to the XTrackCAD demonstration.
+
+This will show some the features of XTrackCAD in an automated presentation. This window contains a number of controls and a message area (which I hope you are reading now).
+
+The controls are:
+Step - advances to the next step of the demo.
+Next - skips ahead to the next demo.
+Quit - exits the demo and returns to XTrackCAD.
+Speed - controls the speed of the demo.
+
+Click Step now for the next message.
+=========================================
+END
+STEP
+CLEAR
+MESSAGE
+If this is the first time you have used the demo you may want to rearrange the windows so the demo window does not obscure the main window.
+
+You can move the demo window now by dragging on the title bar at the top of the window. I suggest you move it to the top of your screen.
+=========================================
+END
+STEP
+CLEAR
+MESSAGE
+The various controls are disabled when it would be inappropiate to click on them. When the demo is running the Step button is disabled. When the demo is paused the Step button is enabled and you can click it when you are ready to view the next part of the demo.
+
+You can click on Quit to return to XTrackCAD at any time.
+
+You can adjust the speed of the demonstration with the Speed control.
+=========================================
+END
+STEP
+CLEAR
+DRAW 1 0 0 0 0 0.000000 0.000000 0 0.000000
+ L3 0 0.444444 0.000000 0.000000 0 72.000000 0.000000 0
+ END
+DRAW 2 0 0 0 0 0.000000 0.000000 0 0.000000
+ L3 0 0.444444 72.000000 0.000000 0 72.000000 36.000000 0
+ END
+DRAW 3 0 0 0 0 0.000000 0.000000 0 0.000000
+ L3 0 0.444444 72.000000 36.000000 0 0.000000 36.000000 0
+ END
+DRAW 4 0 0 0 0 0.000000 0.000000 0 0.000000
+ L3 0 0.444444 0.000000 36.000000 0 0.000000 0.000000 0
+ END
+DRAW 5 0 0 0 0 0.000000 0.000000 0 0.000000
+ L3 0 0.444444 0.000000 0.000000 0 72.000000 36.000000 0
+ END
+DRAW 6 0 0 0 0 0.000000 0.000000 0 0.000000
+ L3 0 0.444444 0.000000 36.000000 0 72.000000 0.000000 0
+ END
+REDRAW
+MESSAGE
+The demos are designed to fit within a certain sized window.
+
+For best results, change the size of the main XTrackCAD window so the box shape is completely visible.
+
+You can do this by clicking and dragging on a corner of the window.
+END
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
+MESSAGE
+This is the end of the introductory demo.
+
+Please click Step for the next demo or click Quit to return to XTrackCAD.
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmjcir.xtr b/app/lib/demos/dmjcir.xtr
new file mode 100644
index 0000000..9647e39
--- /dev/null
+++ b/app/lib/demos/dmjcir.xtr
@@ -0,0 +1,240 @@
+VERSION 2
+DEMOINIT
+ORIG 8.000 0.000 0.000
+CURVE 1 DEMO 1 12.633333 7.966667 6.000000
+ E 12.633333 13.966667 270.000000
+ E 12.633333 13.966667 90.000000
+ END
+CURVE 2 DEMO 1 32.133333 7.966667 6.000000
+ E 32.133333 13.966667 270.000000
+ E 32.133333 13.966667 90.000000
+ END
+REDRAW
+RESET
+MESSAGE
+You can also join to and from circles. This will change the circles to curves.
+
+In this example we will join two circles.
+END
+STEP
+COMMAND Join
+MOUSE 2 14.083 14.083
+MOUSE 4 14.083 14.083
+MOUSE 2 28.250 12.833
+MESSAGE
+_________________________________________
+
+Here we've selected points on the two circles. The direction of the connections (whether clockwise or counter clockwise) is controlled by where on the circle you select the connection points.
+END
+STEP
+MOUSE 3 28.250 12.750
+MOUSE 3 28.167 12.750
+MOUSE 3 28.083 12.750
+MOUSE 3 28.000 12.583
+MOUSE 3 27.833 12.417
+MOUSE 3 27.750 12.250
+MOUSE 3 27.667 12.083
+MOUSE 3 27.500 11.917
+MOUSE 3 27.250 11.583
+MOUSE 3 27.167 11.417
+MOUSE 3 27.000 11.167
+MOUSE 3 26.917 11.000
+MOUSE 3 26.833 10.833
+MOUSE 3 26.750 10.750
+MOUSE 3 26.750 10.583
+MOUSE 3 26.667 10.417
+MOUSE 3 26.583 10.250
+MOUSE 3 26.583 10.000
+MOUSE 3 26.417 9.750
+MOUSE 3 26.417 9.583
+MOUSE 3 26.417 9.417
+MOUSE 3 26.250 9.417
+MOUSE 3 26.250 9.167
+MOUSE 3 26.250 9.000
+MOUSE 3 26.167 8.833
+MOUSE 3 26.083 8.667
+MOUSE 3 26.083 8.583
+MOUSE 3 26.083 8.417
+MOUSE 3 26.000 8.250
+MOUSE 3 26.000 8.083
+MOUSE 3 26.000 7.833
+MOUSE 3 26.000 7.750
+MOUSE 3 26.083 7.583
+MOUSE 3 26.083 7.417
+MOUSE 3 26.083 7.250
+MOUSE 3 26.083 7.000
+MOUSE 3 26.250 6.750
+MOUSE 3 26.250 6.500
+MOUSE 3 26.250 6.333
+MOUSE 3 26.417 6.083
+MOUSE 3 26.583 5.833
+MOUSE 3 26.667 5.750
+MOUSE 3 26.750 5.500
+MOUSE 3 26.917 5.250
+MOUSE 3 27.083 5.167
+MOUSE 3 27.333 4.833
+MOUSE 3 27.500 4.750
+MOUSE 3 27.583 4.583
+MOUSE 3 27.750 4.417
+MOUSE 3 27.833 4.417
+MOUSE 3 28.000 4.250
+MOUSE 3 28.083 4.000
+MOUSE 3 28.250 3.833
+MOUSE 3 28.417 3.750
+MOUSE 3 28.583 3.583
+MOUSE 3 28.750 3.417
+MOUSE 3 28.917 3.250
+MOUSE 3 29.167 3.083
+MOUSE 3 29.333 2.917
+MOUSE 3 29.750 2.833
+MOUSE 3 30.000 2.667
+MOUSE 3 30.417 2.500
+MOUSE 3 30.750 2.417
+MOUSE 3 31.083 2.417
+MOUSE 3 31.583 2.417
+MOUSE 3 32.000 2.333
+MOUSE 3 33.500 2.417
+MOUSE 3 34.750 2.750
+MOUSE 3 35.250 2.917
+MOUSE 3 35.417 3.000
+MOUSE 3 35.583 3.167
+MOUSE 3 36.083 3.417
+MOUSE 3 36.250 3.750
+MOUSE 3 36.750 4.250
+MOUSE 3 37.167 4.750
+MOUSE 3 37.583 5.167
+MOUSE 3 37.833 5.667
+MOUSE 3 38.000 6.083
+MOUSE 3 38.083 6.667
+MOUSE 3 38.250 7.083
+MOUSE 3 38.250 7.500
+MOUSE 3 38.250 7.917
+MOUSE 3 38.167 8.250
+MOUSE 3 38.083 8.583
+MOUSE 3 38.083 9.083
+MOUSE 3 37.917 9.417
+MOUSE 3 37.917 9.917
+MOUSE 3 37.750 10.167
+MOUSE 3 37.583 10.500
+MOUSE 3 37.333 10.917
+MOUSE 3 37.250 11.167
+MOUSE 3 36.917 11.417
+MOUSE 3 36.583 11.750
+MOUSE 3 36.250 12.000
+MOUSE 3 35.917 12.250
+MOUSE 3 35.750 12.583
+MOUSE 3 35.500 12.750
+MOUSE 3 35.167 13.083
+MOUSE 3 34.833 13.250
+MOUSE 3 34.583 13.333
+MOUSE 3 34.417 13.417
+MOUSE 3 34.250 13.500
+MOUSE 4 34.250 13.500
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
+MESSAGE
+Now let's try a cross connection.
+END
+STEP
+PARAMETER misc cmdUndo
+COMMAND Join
+MOUSE 2 15.500 13.333
+MOUSE 4 15.500 13.333
+MOUSE 2 27.667 4.167
+MOUSE 3 27.583 4.167
+MOUSE 3 27.667 4.000
+MOUSE 3 27.833 3.583
+MOUSE 3 28.250 3.167
+MOUSE 3 28.667 2.917
+MOUSE 3 29.500 2.667
+MOUSE 3 30.250 2.583
+MOUSE 3 30.583 2.500
+MOUSE 3 31.000 2.417
+MOUSE 3 31.667 2.333
+MOUSE 3 32.000 2.250
+MOUSE 3 32.333 2.250
+MOUSE 3 32.667 2.250
+MOUSE 3 33.167 2.333
+MOUSE 3 34.333 2.333
+MOUSE 3 34.833 2.417
+MOUSE 3 35.167 2.500
+MOUSE 3 35.333 2.667
+MOUSE 3 35.500 2.833
+MOUSE 3 35.667 3.083
+MOUSE 3 36.000 3.333
+MOUSE 3 36.250 3.500
+MOUSE 3 36.500 3.833
+MOUSE 3 36.833 4.167
+MOUSE 3 37.000 4.500
+MOUSE 3 37.167 4.667
+MOUSE 3 37.333 5.000
+MOUSE 3 37.500 5.333
+MOUSE 3 37.583 5.667
+MOUSE 3 37.750 6.083
+MOUSE 3 38.000 6.667
+MOUSE 3 38.167 7.167
+MOUSE 3 38.167 7.667
+MOUSE 3 38.000 8.083
+MOUSE 3 38.000 8.500
+MOUSE 3 37.833 9.000
+MOUSE 3 37.583 9.500
+MOUSE 3 37.333 9.833
+MOUSE 3 37.083 10.000
+MOUSE 3 36.750 10.583
+MOUSE 3 36.500 11.417
+MOUSE 3 36.333 12.750
+MOUSE 3 36.083 13.250
+MOUSE 3 35.750 13.750
+MOUSE 3 35.500 13.917
+MOUSE 3 34.333 14.000
+MOUSE 3 32.500 14.083
+MOUSE 3 31.917 14.167
+MOUSE 3 31.250 14.250
+MOUSE 3 30.500 14.250
+MOUSE 3 30.000 14.167
+MOUSE 3 29.500 14.083
+MOUSE 3 28.833 13.667
+MOUSE 3 28.167 13.083
+MOUSE 3 26.833 11.333
+MOUSE 3 26.667 11.250
+MOUSE 3 26.667 11.167
+MOUSE 3 26.667 11.083
+MOUSE 3 26.667 10.750
+MOUSE 3 26.500 10.167
+MOUSE 3 26.500 9.750
+MOUSE 3 26.500 9.417
+MOUSE 3 26.500 9.083
+MOUSE 3 26.500 8.750
+MOUSE 3 26.417 8.417
+MOUSE 3 26.333 8.250
+MOUSE 3 26.333 8.000
+MOUSE 3 26.333 7.750
+MOUSE 3 26.333 7.250
+MOUSE 3 26.333 6.833
+MOUSE 3 26.500 6.417
+MOUSE 3 26.583 6.250
+MOUSE 3 26.667 6.000
+MOUSE 3 26.833 5.917
+MOUSE 3 26.917 5.750
+MOUSE 3 27.083 5.583
+MOUSE 3 27.250 5.417
+MOUSE 3 27.417 5.250
+MOUSE 3 27.500 5.083
+MOUSE 3 27.583 5.083
+MOUSE 3 27.667 4.917
+MOUSE 3 27.750 4.917
+MOUSE 3 27.833 4.917
+MOUSE 3 27.833 4.750
+MOUSE 4 27.833 4.750
+MESSAGE
+_________________________________________
+
+Note that the connection is from different 'ends' of the circle than in the last example.
+=========================================
+END
+STEP
+RESET
+CLEAR
diff --git a/app/lib/demos/dmjnabut.xtr b/app/lib/demos/dmjnabut.xtr
new file mode 100644
index 0000000..e72c898
--- /dev/null
+++ b/app/lib/demos/dmjnabut.xtr
@@ -0,0 +1,59 @@
+VERSION 2
+DEMOINIT
+ORIG 4.000 12.000 0.000
+STRAIGHT 1 DEMO 1
+ E 4.133333 3.216667 270.000000
+ E 23.383333 3.216692 90.000000
+ END
+STRAIGHT 2 DEMO 1
+ E 4.133333 4.466667 270.000000
+ E 19.216667 4.466687 90.000000
+ END
+CURVE 3 DEMO 1 19.300229 18.466687 14.000000
+ E 32.510491 13.831066 19.336606
+ E 19.300192 4.466687 270.000000
+ END
+STRAIGHT 4 DEMO 1
+ E 35.216667 3.216667 90.000200
+ E 23.383333 3.216692 270.000200
+ END
+REDRAW
+RESET
+MESSAGE
+This examples shows joining tracks whose End-Points are aligned.
+
+Note the 2 pairs of tracks have End-Points that are close and aligned but not connected.
+END
+STEP
+COMMAND Join
+MOUSE 2 20.167 4.500
+MESSAGE
+_________________________________________
+
+The first case joins the curve and straight track.
+END
+STEP
+MOUSE 3 20.250 4.500
+MOUSE 4 20.250 4.500
+MOUSE 2 17.583 4.417
+MOUSE 4 17.583 4.417
+MESSAGE
+_________________________________________
+
+The second case will join the two straight tracks.
+END
+STEP
+MOUSE 2 24.000 3.250
+MOUSE 4 24.000 3.250
+MOUSE 2 21.917 3.250
+MOUSE 4 21.917 3.250
+MESSAGE
+_________________________________________
+
+Note that the two straight tracks were combined to form one track.
+END
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmjncs.xtr b/app/lib/demos/dmjncs.xtr
new file mode 100644
index 0000000..f1bd27f
--- /dev/null
+++ b/app/lib/demos/dmjncs.xtr
@@ -0,0 +1,64 @@
+VERSION 2
+DEMOINIT
+ORIG 8.000 0.000 0.000
+STRAIGHT 1 DEMO 1
+ E 1.883214 2.133372 270.000000
+ E 31.050000 2.133333 90.000000
+ END
+CURVE 2 DEMO 1 29.473372 12.727335 7.625000
+ E 37.081031 13.241282 356.135245
+ E 33.769610 6.427894 235.706018
+ END
+REDRAW
+RESET
+MESSAGE
+The <Join> command can join straight and curved tracks (in either order).
+END
+STEP
+COMMAND Join
+MOUSE 2 34.167 6.917
+MOUSE 4 34.167 6.917
+MOUSE 2 23.750 2.167
+MESSAGE
+_________________________________________
+
+A connecting track is drawn between the two tracks.
+END
+STEP
+MOUSE 3 23.750 2.083
+MOUSE 3 19.417 2.000
+MESSAGE
+_________________________________________
+
+Notice that the curved track is extended as the connection point moves past the End-Point.
+END
+STEP
+MOUSE 3 19.167 2.000
+MOUSE 3 10.917 2.333
+BIGPAUSE
+MOUSE 3 10.917 2.333
+MOUSE 3 28.250 2.250
+MESSAGE
+_________________________________________
+
+Here the connection makes the curved track wrap around.
+END
+STEP
+MOUSE 3 28.250 2.250
+MOUSE 3 3.250 2.333
+MESSAGE
+_________________________________________
+
+Now the cursor is about to be moved past the other (far) End-Point of the straight track. You will receive a warning and the connecting track turns Red.
+END
+STEP
+MOUSE 3 2.500 2.250
+MOUSE 3 0.667 2.167
+STEP
+MOUSE 3 0.667 2.167
+MOUSE 4 7.333 1.833
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmjnmove.xtr b/app/lib/demos/dmjnmove.xtr
new file mode 100644
index 0000000..43626e6
--- /dev/null
+++ b/app/lib/demos/dmjnmove.xtr
@@ -0,0 +1,51 @@
+VERSION 2
+DEMOINIT
+ORIG 8.000 0.000 0.000
+PARAMETER cmdopt move-quick 2
+STRAIGHT 1 DEMO 1
+ E 13.440000 4.160000 270.000000
+ E 30.186667 4.160000 90.000000
+ END
+CURVE 2 DEMO 1 19.577603 7.976896 5.250000
+ E 14.380804 7.231395 171.836391
+ T 3 19.577724 13.226896 90.001318
+ END
+STRAIGHT 3 DEMO 1
+ T 2 19.577724 13.226896 270.001318
+ E 29.546667 13.226667 90.001318
+ END
+REDRAW
+RESET
+MESSAGE
+The <Join> command can move one group of tracks to join with another.
+
+First <Select> the tracks you want to move.
+END
+STEP
+MOUSE 2 24.000 13.013
+MOUSE 4 24.000 13.013
+MOUSE 2 15.893 12.160
+MOUSE 4 15.893 12.160
+MESSAGE
+_________________________________________
+
+Click <Join> and Shift-Left-Click on the two End-Points.
+END
+STEP
+COMMAND Join
+KEYSTATE 2
+MOUSE 2 14.613 7.573
+KEYSTATE 2
+MOUSE 4 14.613 7.573
+KEYSTATE 2
+MOUSE 2 13.867 4.373
+KEYSTATE 2
+MOUSE 4 13.867 4.373
+MESSAGE
+_________________________________________
+
+The selected tracks are moved into position.
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmjnss.xtr b/app/lib/demos/dmjnss.xtr
new file mode 100644
index 0000000..451fde4
--- /dev/null
+++ b/app/lib/demos/dmjnss.xtr
@@ -0,0 +1,61 @@
+VERSION 2
+DEMOINIT
+ORIG 8.000 0.000 0.000
+STRAIGHT 1 DEMO 1
+ E 13.716667 4.466667 270.000000
+ E 37.133333 4.466667 90.000000
+ END
+STRAIGHT 2 DEMO 1
+ E 13.216667 8.383333 240.802413
+ E 27.383333 16.300000 60.802413
+ END
+REDRAW
+RESET
+MESSAGE
+Two straight tracks are joined by selecting the two End-Points. The selected End-Points will be those closest to the cursor when the track is selected.
+
+END
+STEP
+COMMAND Join
+MOUSE 2 16.583 10.417
+MOUSE 4 16.583 10.417
+MOUSE 2 17.083 4.583
+MESSAGE
+_________________________________________
+
+A connecting track is drawn between the two tracks. Notice how it moves as the cursor is dragged along the second track.
+END
+STEP
+MOUSE 3 17.167 4.583
+MOUSE 3 21.917 4.583
+BIGPAUSE
+MOUSE 3 21.917 4.583
+MOUSE 3 14.833 4.250
+MESSAGE
+_________________________________________
+
+Note that two tracks are extended if you move past the end of the track.
+END
+STEP
+MOUSE 3 14.750 4.250
+MOUSE 3 9.000 4.000
+MESSAGE
+_________________________________________
+
+Notice what happens if you drag past the intersection points of the two tracks.
+END
+STEP
+MOUSE 3 8.833 4.000
+MOUSE 3 -0.667 2.750
+MESSAGE
+_________________________________________
+
+This is probably not a very useful thing to do.
+END
+BIGPAUSE
+MOUSE 4 -0.667 2.750
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmjntt.xtr b/app/lib/demos/dmjntt.xtr
new file mode 100644
index 0000000..7835299
--- /dev/null
+++ b/app/lib/demos/dmjntt.xtr
@@ -0,0 +1,175 @@
+VERSION 2
+DEMOINIT
+ORIG 8.000 0.000 0.000
+TURNTABLE 1 DEMO 1 26.216667 7.216667 3.750000
+ T 3 22.726088 5.846133 248.563046
+ END
+CURVE 2 DEMO 1 14.175294 26.431926 16.875000
+ E 20.116486 10.637374 69.386119
+ E 1.716636 15.050033 317.585911
+ END
+STRAIGHT 3 DEMO 1
+ T 1 22.726088 5.846133 68.563198
+ E 12.633333 1.883333 248.563198
+ END
+REDRAW
+MESSAGE
+You can connect from any track to a turntable
+
+Note: you cannot have a turntable as your first connection point.
+END
+STEP
+RESET
+COMMAND Join
+MOUSE 2 17.833 10.167
+MOUSE 4 17.833 10.167
+BIGPAUSE
+MOUSE 2 22.000 8.167
+BIGPAUSE
+MOUSE 3 21.750 6.417
+MESSAGE
+_________________________________________
+
+You cannot place the connecting track too close to an existing stall track. How close you can get is controlled by the Turntable Angle on the Setup dialog.
+
+In this example it is set to 7.5 degrees.
+END
+STEP
+MOUSE 3 21.750 6.167
+MOUSE 3 22.083 5.333
+BIGPAUSE
+MOUSE 3 22.083 5.417
+MOUSE 3 21.750 6.000
+BIGPAUSE
+MOUSE 3 21.750 5.917
+MOUSE 3 22.083 4.833
+MESSAGE
+_________________________________________
+
+You can drag the connecting point all round the turntable.
+END
+STEP
+MOUSE 3 22.083 4.833
+MOUSE 3 22.167 4.833
+MOUSE 3 22.417 4.417
+MOUSE 3 22.667 4.000
+MOUSE 3 22.917 3.500
+MOUSE 3 23.250 3.167
+MOUSE 3 25.750 2.667
+MOUSE 3 27.583 2.583
+MOUSE 3 27.833 2.667
+MOUSE 3 28.083 2.833
+MOUSE 3 28.667 3.000
+MOUSE 3 29.000 3.250
+MOUSE 3 29.500 3.583
+MOUSE 3 29.833 4.000
+MOUSE 3 30.083 4.417
+MOUSE 3 30.250 4.833
+MOUSE 3 30.333 5.167
+MOUSE 3 30.500 5.583
+MOUSE 3 30.583 6.000
+MOUSE 3 30.667 6.417
+MOUSE 3 30.750 6.750
+MOUSE 3 30.833 7.250
+MOUSE 3 30.833 7.583
+MOUSE 3 30.833 7.917
+MOUSE 3 30.833 8.083
+MOUSE 3 30.917 8.333
+MOUSE 3 30.917 8.500
+MOUSE 3 31.000 8.500
+MOUSE 3 31.250 8.583
+MOUSE 3 31.667 8.667
+MOUSE 3 32.000 8.833
+MOUSE 3 32.333 8.917
+MOUSE 3 32.750 9.000
+MOUSE 3 33.333 9.000
+MOUSE 3 33.833 9.083
+MOUSE 3 34.000 9.167
+MOUSE 3 34.500 9.167
+MOUSE 3 34.750 9.250
+MOUSE 3 35.083 9.333
+MOUSE 3 35.333 9.333
+MOUSE 3 35.500 9.333
+MOUSE 3 35.667 9.417
+MOUSE 3 36.000 9.500
+MESSAGE
+_________________________________________
+
+As you drag away from the turntable a straight track will be drawn to the cursor postion and a curve will be drawn from the cursor to the connecting track.
+END
+STEP
+MOUSE 3 36.000 9.583
+MOUSE 3 30.250 8.083
+MESSAGE
+_________________________________________
+
+Now the cursor will be moved within the turntable. Notice the error message.
+END
+BIGPAUSE
+MOUSE 3 29.917 8.000
+MOUSE 3 29.000 7.917
+STEP
+MOUSE 3 29.000 7.833
+MOUSE 3 29.083 7.833
+MOUSE 3 29.833 8.000
+MOUSE 3 30.667 8.167
+MOUSE 3 30.750 8.250
+MOUSE 3 30.833 8.333
+MOUSE 3 31.000 8.333
+MOUSE 3 31.000 8.417
+MOUSE 3 31.250 8.667
+MOUSE 3 31.333 9.167
+MOUSE 3 31.167 9.500
+MOUSE 3 31.000 9.667
+MOUSE 3 30.500 10.333
+MOUSE 3 30.000 10.667
+MOUSE 3 29.667 11.000
+MOUSE 3 29.417 11.250
+MOUSE 3 29.000 11.583
+MOUSE 3 28.667 11.833
+MOUSE 3 27.833 12.083
+MOUSE 3 26.833 12.333
+MOUSE 3 26.333 12.500
+MOUSE 3 25.833 12.500
+MOUSE 3 25.333 12.583
+MOUSE 3 25.000 12.583
+MOUSE 3 24.750 12.500
+MOUSE 3 23.750 12.333
+MOUSE 3 23.333 12.250
+MOUSE 3 23.083 12.167
+MOUSE 3 23.000 12.000
+MOUSE 3 22.750 11.917
+MOUSE 3 22.667 11.833
+MOUSE 3 22.583 11.667
+MOUSE 3 22.500 11.500
+MOUSE 3 22.333 11.333
+MOUSE 3 22.333 11.167
+MOUSE 3 22.333 10.917
+MOUSE 3 22.167 10.583
+MOUSE 3 22.083 10.333
+MOUSE 3 22.000 10.000
+MOUSE 3 21.833 9.667
+MOUSE 3 21.833 9.417
+MOUSE 3 21.750 9.167
+MOUSE 3 21.667 8.917
+MOUSE 3 21.667 8.667
+MOUSE 3 21.583 8.500
+MOUSE 3 21.500 8.333
+MOUSE 3 21.333 8.167
+MOUSE 3 21.333 8.000
+MOUSE 3 21.333 7.917
+MOUSE 3 21.250 7.917
+MOUSE 3 21.250 7.833
+MOUSE 3 21.333 7.833
+MESSAGE
+_________________________________________
+
+All done.
+END
+BIGPAUSE
+MOUSE 4 21.333 7.833
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmlines.xtr b/app/lib/demos/dmlines.xtr
new file mode 100644
index 0000000..c37246c
--- /dev/null
+++ b/app/lib/demos/dmlines.xtr
@@ -0,0 +1,223 @@
+VERSION 2
+DEMOINIT
+ORIG 4.000 0.000 0.000
+PARAMETER display labelenable 4
+STRAIGHT 1 DEMO 1
+ E 0.051703 4.160000 270.000000
+ T 2 4.533333 4.160000 90.000000
+ END
+TURNOUT 2 DEMO 1 4.533333 4.160000 0.000000 "Peco-55 Medium Left SL-E395F"
+ T 1 4.533333 4.160000 270.000000
+ T 3 9.938333 4.160000 90.000000
+ T 6 9.903333 3.638000 99.686000
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0 0.000000 0.000000 0.353000 0.000000
+ S 0 0 0.353000 0.000000 5.405000 0.000000
+ C 0 0 23.136000 0.351000 -23.136000 0.004000 9.700000
+ S 0 0 4.251000 -0.331000 5.370000 -0.522000
+ END
+STRAIGHT 3 DEMO 1
+ E 31.466667 4.160000 90.000000
+ T 2 9.938333 4.160000 270.000000
+ END
+STRAIGHT 4 DEMO 1
+ E 31.466667 2.660000 90.000000
+ T 5 16.693333 2.660000 270.000000
+ END
+CURVE 5 DEMO 1 16.693333 15.171003 12.511003
+ T 4 16.693333 2.660000 90.000000
+ T 6 14.588376 2.838349 279.686000
+ END
+STRAIGHT 6 DEMO 1
+ T 2 9.903333 3.638000 279.686000
+ T 5 14.588376 2.838349 99.686000
+ END
+REDRAW
+RESET
+MESSAGE
+The Draw Commands are used to draw straight and curved lines on the layout.
+
+END
+STEP
+COMMAND DrawLine
+PARAMETER draw linewidth 0
+PARAMETER draw linecolor 0
+MESSAGE
+_________________________________________
+
+Lines are drawn by clicking at the starting postion and dragging to the final position.
+END
+STEP
+MOUSE 2 0.533 4.693
+MOUSE 3 4.320 4.693
+MOUSE 4 4.320 4.693
+MOUSE 2 4.373 4.693
+MOUSE 3 4.533 5.120
+MOUSE 4 4.533 5.120
+MOUSE 2 0.267 5.120
+MOUSE 3 0.587 4.747
+MOUSE 4 0.587 4.747
+MOUSE 2 0.267 3.253
+MOUSE 3 0.533 3.787
+MOUSE 4 0.533 3.787
+MESSAGE
+_________________________________________
+
+Drawing lines with the Shift key held down will use the previous line End-Point as the starting position. This makes it easy to draw connected lines.
+END
+STEP
+KEYSTATE 2
+MOUSE 2 3.520 3.680
+KEYSTATE 2
+MOUSE 3 4.320 3.787
+KEYSTATE 2
+MOUSE 4 4.320 3.787
+KEYSTATE 2
+MOUSE 2 4.533 3.307
+KEYSTATE 2
+MOUSE 3 4.533 3.307
+KEYSTATE 2
+MOUSE 4 4.533 3.307
+MESSAGE
+_________________________________________
+
+You also draw in various colors and line widths.
+END
+PARAMETER draw linecolor 255
+PARAMETER draw linewidth 2
+STEP
+MOUSE 2 0.747 4.800
+MOUSE 4 0.693 6.560
+KEYSTATE 2
+MOUSE 2 0.693 6.560
+KEYSTATE 2
+MOUSE 4 1.493 7.573
+KEYSTATE 2
+MOUSE 2 1.547 7.573
+KEYSTATE 2
+MOUSE 4 3.147 7.467
+KEYSTATE 2
+MOUSE 2 3.787 6.773
+KEYSTATE 2
+MOUSE 4 4.213 5.813
+KEYSTATE 2
+MOUSE 2 4.107 5.173
+KEYSTATE 2
+MOUSE 4 4.107 4.693
+MESSAGE
+_________________________________________
+
+Like Curved Tracks, Curved Lines can be drawn by a variety of methods.
+
+Here we will draw a Curve by dragging from one End-Point to the other to define the chord of the Curve. Then we will drag from the center to shape the curve.
+END
+STEP
+COMMAND DrawCurveChord
+MOUSE 2 0.800 3.680
+#MOUSE 3 0.800 3.573
+#MOUSE 3 0.853 3.467
+#MOUSE 3 0.853 3.360
+#MOUSE 3 0.853 3.253
+#MOUSE 3 0.853 3.147
+#MOUSE 3 0.853 2.987
+#MOUSE 3 0.853 2.880
+#MOUSE 3 0.747 2.560
+#MOUSE 3 0.747 2.133
+#MOUSE 3 0.747 1.707
+#MOUSE 3 0.747 1.547
+#MOUSE 3 0.800 1.493
+#MOUSE 3 0.800 1.440
+#MOUSE 3 0.800 1.387
+#MOUSE 3 0.853 1.280
+#MOUSE 3 0.907 1.173
+#MOUSE 3 1.120 0.960
+#MOUSE 3 1.173 0.907
+#MOUSE 3 1.173 0.853
+#MOUSE 3 1.173 0.800
+#MOUSE 3 1.173 0.747
+#MOUSE 4 1.173 0.747
+#BIGPAUSE
+#MOUSE 2 1.173 0.747
+#MOUSE 3 1.280 0.747
+#MOUSE 3 1.600 0.533
+#MOUSE 3 2.133 0.427
+#MOUSE 3 2.773 0.427
+#MOUSE 3 3.520 0.533
+#MOUSE 3 4.053 0.747
+#MOUSE 3 4.480 0.960
+#MOUSE 3 4.693 1.173
+#MOUSE 3 4.800 1.493
+#MOUSE 3 4.800 1.920
+#MOUSE 3 4.800 2.347
+#MOUSE 3 4.907 2.773
+#MOUSE 3 4.853 2.880
+#MOUSE 3 4.747 3.200
+#MOUSE 3 4.693 3.253
+#MOUSE 3 4.640 3.307
+#MOUSE 3 4.533 3.307
+#MOUSE 3 4.480 3.307
+#MOUSE 3 4.427 3.307
+#MOUSE 3 4.373 3.360
+#MOUSE 3 4.267 3.360
+#MOUSE 3 4.160 3.413
+#MOUSE 3 4.107 3.467
+#MOUSE 3 4.053 3.520
+#MOUSE 3 4.000 3.520
+#MOUSE 3 4.000 3.467
+#MOUSE 3 4.000 3.520
+#MOUSE 3 4.053 3.573
+#MOUSE 3 4.000 3.627
+#MOUSE 3 4.000 3.680
+#MOUSE 3 3.947 3.680
+#MOUSE 3 3.947 3.733
+#MOUSE 3 3.947 3.787
+MOUSE 4 4.107 3.787
+BIGPAUSE
+MOUSE 2 2.9 3.78
+MOUSE 4 2.9 1.5
+MESSAGE
+_________________________________________
+
+Boxes are useful for drawing rectangular shapes.
+END
+STEP
+PARAMETER draw linecolor 8355584
+COMMAND DrawBox
+MOUSE 2 11.413 4.960
+MOUSE 4 20.640 7.840
+MESSAGE
+_________________________________________
+
+Circles can be drawn by clicking on the center or edge and dragging to set the radius.
+Here we will drag from the Center.
+END
+STEP
+COMMAND DrawCircleCenter
+MOUSE 2 7.360 6.453
+MOUSE 4 8.533 5.920
+MESSAGE
+_________________________________________
+
+Lines and Shapes can be deleted by Selecting and Deleting.
+END
+STEP
+COMMAND Select
+MOUSE 2 11.307 6.400
+MOUSE 4 11.307 6.400
+#BIGPAUSE
+#PARAMETER misc cmdDelete
+MOUSE 2 4.160 5.493
+MOUSE 4 4.160 5.493
+#BIGPAUSE
+#PARAMETER misc cmdDelete
+MOUSE 2 3.467 6.933
+MOUSE 4 3.467 6.933
+BIGPAUSE
+PARAMETER misc cmdDelete
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
+RESET
diff --git a/app/lib/demos/dmlines2.xtr b/app/lib/demos/dmlines2.xtr
new file mode 100644
index 0000000..11837ae
--- /dev/null
+++ b/app/lib/demos/dmlines2.xtr
@@ -0,0 +1,197 @@
+VERSION 7
+DEMOINIT
+ORIG 4.000 0.000 0.000
+PARAMETER display labelenable 4
+PARAMETER display description-fontsize 24
+STRAIGHT 1 0 0 0 0 DEMO -1
+ E 0.051703 4.160000 270.000000
+ T 2 4.533333 4.160000 90.000000
+ END
+TURNOUT 2 0 0 0 0 DEMO -1 4.533333 4.160000 0.000000 "Peco-55 Medium Right SL-E395F"
+ T 1 4.533333 4.160000 270.000000
+ T 3 9.938333 4.160000 90.000000
+ T 6 9.903333 3.638000 99.686000
+ D 0.000000 0.000000
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0.000000 0.000000 0.000000 0.353000 0.000000
+ S 0 0.000000 0.353000 0.000000 5.405000 0.000000
+ C 0 0.000000 23.136000 0.351000 -23.136000 0.004000 9.700000
+ S 0 0.000000 4.251000 -0.331000 5.370000 -0.522000
+ END
+STRAIGHT 3 0 0 0 0 DEMO -1
+ E 31.466667 4.160000 90.000000
+ T 2 9.938333 4.160000 270.000000
+ END
+STRAIGHT 4 0 0 0 0 DEMO -1
+ E 31.466667 2.660000 90.000000
+ T 5 16.693333 2.660000 270.000000
+ END
+CURVE 5 0 0 0 0 DEMO -1 16.693333 15.171003 12.511003
+ T 4 16.693333 2.660000 90.000000
+ T 6 14.588376 2.838349 279.686000
+ END
+STRAIGHT 6 0 0 0 0 DEMO -1
+ T 2 9.903333 3.638000 279.686000
+ T 5 14.588376 2.838349 99.686000
+ END
+DRAW 7 0 0 0 0 0.000000 0.000000 0.000000
+ L 0 0.000000 0.533333 4.693333 4.320000 4.693333
+ END
+DRAW 8 0 0 0 0 0.000000 0.000000 0.000000
+ L 0 0.000000 4.373333 4.693333 4.533333 5.120000
+ END
+DRAW 9 0 0 0 0 0.000000 0.000000 0.000000
+ L 0 0.000000 0.266667 5.120000 0.586667 4.746667
+ END
+DRAW 10 0 0 0 0 0.000000 0.000000 0.000000
+ L 0 0.000000 0.266667 3.253333 0.533333 3.786667
+ END
+DRAW 11 0 0 0 0 0.000000 0.000000 0.000000
+ L 0 0.000000 0.533333 3.786667 4.320000 3.786667
+ END
+DRAW 12 0 0 0 0 0.000000 0.000000 0.000000
+ L 0 0.000000 4.320000 3.786667 4.533333 3.306667
+ END
+DRAW 13 0 0 0 0 0.000000 0.000000 0.000000
+ L 255 0.106667 0.746667 4.800000 0.746667 6.080000
+ END
+DRAW 14 0 0 0 0 0.000000 0.000000 0.000000
+ L 255 0.106667 0.746667 6.080000 1.226667 7.200000
+ END
+DRAW 15 0 0 0 0 0.000000 0.000000 0.000000
+ L 255 0.106667 1.226667 7.200000 2.720000 7.520000
+ END
+DRAW 16 0 0 0 0 0.000000 0.000000 0.000000
+ A 255 0.106667 1.581026 2.368375 3.879611 93.370222 169.376584
+ END
+DRAW 17 0 0 0 0 0.000000 0.000000 0.000000
+ L 8421376 0.106667 11.413333 4.960000 20.106667 4.960000
+ END
+DRAW 18 0 0 0 0 0.000000 0.000000 0.000000
+ L 8421376 0.106667 20.106667 4.960000 20.106667 7.680000
+ END
+DRAW 19 0 0 0 0 0.000000 0.000000 0.000000
+ L 8421376 0.106667 20.106667 7.680000 11.413333 7.680000
+ END
+DRAW 20 0 0 0 0 0.000000 0.000000 0.000000
+ A 8421376 0.106667 0.812349 7.360000 6.453333 0.000000 360.000000
+ END
+DRAW 21 0 0 0 0 0.000000 0.000000 0.000000
+ L 255 0.105263 2.736842 7.473684 3.947368 6.526316
+ END
+DRAW 22 0 0 0 0 0.000000 0.000000 0.000000
+ L 255 0.105263 3.947368 6.526316 4.157895 4.684211
+ END
+DRAW 23 0 0 0 0 0.000000 0.000000 0.000000
+ L 8421376 0.105263 11.473684 7.736842 11.473684 5.000000
+ END
+REDRAW
+RESET
+MESSAGE
+We also draw Polylines and filled shapes.
+END
+PARAMETER draw linewidth 2
+PARAMETER draw linecolor 11591910
+COMMAND DrawPolyline
+STEP
+MESSAGE
+_________________________________________
+
+A Polyline is drawn by dragging to place each of the point in the Polyline.
+END
+STEP
+PARAMETER draw linecolor 0
+PARAMETER draw linewidth 3
+PARAMETER draw linecolor 32768
+MOUSE 2 0.64 6.07
+MOUSE 4 0.64 6.07
+MOUSE 2 1.17 7.25
+MOUSE 4 1.17 7.25
+MOUSE 2 2.71 7.61
+MOUSE 4 2.71 7.61
+MOUSE 2 4.04 6.57
+MOUSE 4 4.04 6.57
+MOUSE 2 4.25 4.77
+MOUSE 4 4.25 4.77
+MOUSE 2 4.56 5.21
+MOUSE 4 4.56 5.21
+MOUSE 2 5.92 5.21
+MOUSE 4 5.92 5.21
+MOUSE 2 5.92 8.84
+MOUSE 4 5.92 8.84
+MOUSE 2 0.316 8.842
+MOUSE 4 0.316 8.842
+MESSAGE
+_________________________________________
+
+To finish off the Polyline press the <Space> key or choose another drawing type.
+END
+STEP
+MOUSE 8200 0.316 8.842
+MESSAGE
+_________________________________________
+
+A Polygon is drawn in the same way
+END
+COMMAND DrawPolygon
+PARAMETER draw linecolor 65280
+STEP
+MOUSE 2 0.579 6.211
+MOUSE 4 0.579 6.211
+MOUSE 2 1.211 7.421
+MOUSE 4 1.211 7.421
+MOUSE 2 2.684 7.789
+MOUSE 4 2.684 7.789
+MOUSE 2 4.053 6.684
+MOUSE 4 4.053 6.684
+MOUSE 2 4.263 5.000
+MOUSE 4 4.263 5.000
+MOUSE 2 4.474 5.211
+MOUSE 4 4.474 5.211
+MOUSE 2 6.053 5.211
+MOUSE 4 6.053 5.211
+MOUSE 2 5.789 8.737
+MOUSE 4 5.789 8.737
+MOUSE 2 0.421 8.684
+MOUSE 4 0.421 8.684
+MOUSE 8200 0.421 8.684
+MESSAGE
+_________________________________________
+
+You can use the Above and Below Commands to move lines and shapes to the front or back of the drawing.
+END
+STEP
+COMMAND Select
+BIGPAUSE
+MOUSE 2 3.737 8.84
+MOUSE 4 3.737 8.84
+BIGPAUSE
+PARAMETER misc cmdAbove
+BIGPAUSE
+#MOUSE 2 3.737 8.84
+#MOUSE 4 3.737 8.84
+BIGPAUSE
+PARAMETER misc cmdBelow
+MESSAGE
+_________________________________________
+
+Filled Boxes and Circles work the same as line Boxes and Circles.
+END
+COMMAND DrawFilledCircleCenter
+PARAMETER draw linecolor 16776960
+BIGPAUSE
+MOUSE 2 7.360 6.45333
+MOUSE 3 7.87 5.92
+MOUSE 4 7.87 5.92
+COMMAND DrawFilledBox
+BIGPAUSE
+MOUSE 2 11.53 7.63
+MOUSE 3 20.000 5.03
+MOUSE 4 20.000 5.03
+RESET
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmmouse.xtr b/app/lib/demos/dmmouse.xtr
new file mode 100644
index 0000000..9bf8e97
--- /dev/null
+++ b/app/lib/demos/dmmouse.xtr
@@ -0,0 +1,210 @@
+VERSION 1
+DEMOINIT
+ORIG 12.000 0.000 0.000
+PARAMETER display description-fontsize 18
+REDRAW
+RESET
+MOUSE 1 0.160 1.120
+MESSAGE
+In the drawing area of the main window you can see an hollow arrow which represents the mouse cursor. In this demo the mouse will move about to show you the actions of different commands.
+
+The hollow arrow represents the mouse cursor without a mouse button being pressed.
+END
+STEP
+MOUSE 1 0.480 1.280
+MOUSE 1 1.440 1.920
+MOUSE 1 2.080 2.560
+MOUSE 1 2.240 2.720
+MOUSE 1 2.400 2.880
+MOUSE 1 2.560 3.040
+MOUSE 1 2.720 3.040
+MOUSE 1 3.040 3.200
+MOUSE 1 3.040 3.360
+MOUSE 1 3.360 3.520
+MOUSE 1 3.520 3.680
+MOUSE 1 3.680 3.680
+MOUSE 1 4.000 3.840
+MOUSE 1 4.160 4.000
+MOUSE 1 4.320 4.160
+MOUSE 1 4.480 4.160
+MOUSE 1 4.480 4.320
+MOUSE 1 4.640 4.320
+MOUSE 1 4.800 4.480
+MOUSE 1 5.120 4.640
+MOUSE 1 5.280 4.800
+MOUSE 1 5.440 4.960
+MOUSE 1 5.600 5.120
+MOUSE 1 5.920 5.280
+MOUSE 1 6.080 5.600
+MOUSE 1 6.400 5.600
+MOUSE 1 6.560 5.920
+MOUSE 1 6.880 6.080
+MOUSE 1 7.040 6.240
+MOUSE 1 7.200 6.400
+MOUSE 1 7.520 6.560
+MOUSE 1 8.160 7.200
+MOUSE 1 8.480 7.360
+MOUSE 1 9.120 8.000
+MOUSE 1 9.280 8.160
+MOUSE 1 9.440 8.320
+MOUSE 1 9.760 8.480
+MOUSE 1 9.920 8.800
+MOUSE 1 10.240 8.960
+MOUSE 1 10.560 9.120
+MOUSE 1 11.200 10.080
+MOUSE 1 12.160 10.400
+MOUSE 1 12.800 11.040
+MOUSE 1 13.440 11.680
+MOUSE 1 13.760 11.840
+MOUSE 1 13.920 12.000
+MOUSE 1 14.080 12.160
+MOUSE 1 14.240 12.320
+MOUSE 1 14.880 12.960
+MOUSE 1 15.200 13.120
+MOUSE 1 15.360 13.280
+MOUSE 1 16.000 13.920
+MOUSE 1 16.320 14.080
+MOUSE 1 16.960 14.720
+MOUSE 1 17.280 14.880
+MOUSE 1 17.600 15.040
+MOUSE 1 17.760 15.200
+MOUSE 1 18.400 15.840
+MOUSE 1 18.720 16.000
+MOUSE 1 19.360 16.640
+MOUSE 1 19.520 16.800
+MOUSE 1 19.680 16.960
+MOUSE 1 20.000 17.120
+MOUSE 1 20.160 17.280
+MOUSE 1 20.320 17.440
+MOUSE 1 20.640 17.600
+MOUSE 1 20.800 17.920
+MOUSE 1 21.120 18.080
+MOUSE 1 21.440 18.240
+MOUSE 1 21.600 18.400
+MOUSE 1 21.760 18.560
+MOUSE 1 21.920 18.720
+MOUSE 1 22.080 18.880
+MOUSE 1 22.240 19.040
+MOUSE 1 22.560 19.200
+MOUSE 1 22.880 19.360
+MOUSE 1 23.040 19.520
+MOUSE 1 23.200 19.680
+MOUSE 1 23.360 19.840
+MOUSE 1 23.520 20.000
+MOUSE 1 23.680 20.160
+MOUSE 1 24.000 20.160
+MOUSE 1 24.160 20.320
+MOUSE 1 24.160 20.480
+MOUSE 1 24.320 20.640
+MOUSE 1 24.480 20.800
+MOUSE 1 24.640 20.800
+MOUSE 1 25.280 21.440
+MOUSE 1 25.440 21.600
+MOUSE 1 25.600 21.760
+MOUSE 1 25.760 21.760
+MOUSE 1 25.920 21.920
+MOUSE 1 26.080 22.080
+MOUSE 1 26.240 22.240
+MOUSE 1 26.560 22.400
+MOUSE 1 26.720 22.720
+MOUSE 1 26.880 22.720
+MOUSE 1 27.040 22.880
+MOUSE 1 27.200 23.040
+MOUSE 1 27.360 23.200
+MOUSE 1 27.520 23.360
+MOUSE 1 27.680 23.520
+MOUSE 1 27.840 23.520
+MOUSE 1 28.000 23.680
+MOUSE 1 28.160 23.840
+MOUSE 1 28.320 24.000
+MOUSE 1 28.480 24.160
+MOUSE 1 28.800 24.320
+MOUSE 1 29.120 24.480
+MOUSE 1 29.280 24.800
+MOUSE 1 29.440 24.800
+MOUSE 1 29.600 24.960
+MOUSE 1 29.760 25.120
+MOUSE 1 29.920 25.440
+MOUSE 1 30.080 25.440
+MOUSE 1 30.400 25.600
+MOUSE 1 30.560 25.760
+MOUSE 1 30.720 25.920
+MOUSE 1 31.040 26.080
+MOUSE 1 31.200 26.240
+MOUSE 1 31.520 26.400
+MOUSE 1 31.680 26.560
+MOUSE 1 31.840 26.560
+MOUSE 1 32.160 26.720
+MOUSE 1 32.320 26.880
+MOUSE 1 32.480 26.880
+MOUSE 1 32.640 26.880
+MOUSE 1 32.640 27.040
+MOUSE 1 32.800 27.040
+MOUSE 1 32.960 27.200
+MOUSE 1 33.280 27.360
+MOUSE 1 33.600 27.520
+MOUSE 1 33.760 27.680
+MOUSE 1 33.920 27.680
+MOUSE 1 34.080 27.840
+MOUSE 1 34.240 28.000
+MOUSE 1 34.400 28.000
+MOUSE 1 34.560 28.000
+CLEAR
+MESSAGE
+When the left mouse button would be pressed, the mouse cursor appears to flash and the hollow arrow is replaced by a solid red arrow. While the left button is pressed the mouse cursor will be a solid arrow.
+
+Note: these color changes occur only during the demo to simulate mouse button presses.
+END
+STEP
+MOUSE 2 34.560 28.000
+RESET
+BIGPAUSE
+MESSAGE
+_________________________________________
+
+Moving the mouse while a mouse button is pressed is called 'dragging'.
+END
+BIGPAUSE
+MOUSE 3 34.400 28.000
+MOUSE 3 36.160 4.000
+RESET
+MESSAGE
+_________________________________________
+
+When the left mouse button is released, the mouse cursor flashes and the hollow arrow is restored.
+END
+STEP
+MOUSE 4 36.160 4.000
+MESSAGE
+_________________________________________
+
+Dragging with the right button is simulated by a blue solid cursor.
+END
+BIGPAUSE
+MOUSE 5 36.160 4.000
+BIGPAUSE
+MOUSE 6 3.680 4.800
+BIGPAUSE
+MOUSE 7 3.680 4.800
+RESET
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
+MESSAGE
+Sometimes the Shift key is held down while using the mouse for a Shift-Click or a Shift-Drag.
+
+This is indicated by an outline drawn around the solid arrow.
+END
+STEP
+KEYSTATE 2
+MOUSE 2 3.680 4.800
+KEYSTATE 2
+MOUSE 4 7.520 26.080
+RESET
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmmovabt.xtr b/app/lib/demos/dmmovabt.xtr
new file mode 100644
index 0000000..a1125f2
--- /dev/null
+++ b/app/lib/demos/dmmovabt.xtr
@@ -0,0 +1,75 @@
+VERSION 2
+DEMOINIT
+ORIG 8.000 0.000 0.000
+CURVE 1 DEMO 1 24.000000 24.000000 18.000000
+ T 4 37.512875 12.108734 41.347736
+ T 3 37.546349 35.853119 138.813964
+ END
+CURVE 2 DEMO 1 72.000000 24.000000 18.000000
+ T 4 58.487157 35.891302 221.347736
+ T 3 58.453619 12.146917 318.813964
+ END
+STRAIGHT 3 DEMO 1
+ T 1 37.546349 35.853119 318.589846
+ T 2 58.453619 12.146917 138.589846
+ END
+STRAIGHT 4 DEMO 1
+ T 1 37.512875 12.108734 221.409543
+ T 2 58.487157 35.891302 41.409543
+ END
+REDRAW
+RESET
+MESSAGE
+The main drawing area shows a portion of total layout. You can zoom in or zoom out by choosing 'Zoom In' or 'Zoom Out' in the 'Edit' menu, by using the Zoom buttons on the toolbar or by using the 'Page Down' and 'Page Up' keys.
+
+You can see the entire layout in the Map window.
+END
+STEP
+ORIG 12.000 0.000 0.000
+BIGPAUSE
+BIGPAUSE
+ORIG 16.000 0.000 0.000
+MESSAGE
+_________________________________________
+
+As you Zoom Out tracks are drawn with one line instead of two.
+END
+STEP
+ORIG 32.000 0.000 0.000
+BIGPAUSE
+BIGPAUSE
+ORIG 16.000 3.500 13.500
+BIGPAUSE
+BIGPAUSE
+ORIG 8.000 26.625 22.125
+BIGPAUSE
+BIGPAUSE
+ORIG 4.000 38.188 26.438
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
+MESSAGE
+You can change what portion of the layout is shown by using the 'Map' window which shows a compressed version of the entire layout. A hilighted area of the 'Map' (in reverse video) shows what portion of the layout is displayed in the main drawing area.
+
+You can Left-Drag the hilighted area in the Map window to change the displayed portion of the layout.
+END
+STEP
+BIGPAUSE
+PARAMETER map canvas 2 48.000 34.000
+PARAMETER map canvas 4 46.000 26.000
+MESSAGE
+_________________________________________
+
+You can also Right-Drag on the Map window to set the scale and position of the Main window.
+END
+STEP
+PARAMETER map canvas 5 18.667 8.667
+PARAMETER map canvas 7 21.333 6.000
+ORIG 2.000 18.667 4.354
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmnotes.xtr b/app/lib/demos/dmnotes.xtr
new file mode 100644
index 0000000..35c3d6a
--- /dev/null
+++ b/app/lib/demos/dmnotes.xtr
@@ -0,0 +1,43 @@
+VERSION 2
+DEMOINIT
+ORIG 8.000 0.000 0.000
+REDRAW
+RESET
+MESSAGE
+The <Note> command lets you attach notes to various spots on the layout.
+END
+STEP
+COMMAND Note
+MOUSE 2 15.167 7.833
+MOUSE 3 9.917 7.167
+MOUSE 4 9.917 7.167
+MESSAGE
+_________________________________________
+
+When you place a note, the Note editor window is displayed which lets you enter the note.
+END
+STEP
+RESET
+MOUSE 6920 9.917 7.167
+MESSAGE
+_________________________________________
+
+If you click on a note in <Describe> mode the Note editor displays the note.
+END
+STEP
+COMMAND Describe
+MOUSE 2 9.917 7.167
+MOUSE 4 9.917 7.167
+STEP
+MOUSE 6920 9.917 7.167
+CLEAR
+MESSAGE
+This is the end of the XTrackCAD Demos.
+
+Click Step to return to XTrackCAD.
+
+Thanks for watching.
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmparall.xtr b/app/lib/demos/dmparall.xtr
new file mode 100644
index 0000000..7b99b58
--- /dev/null
+++ b/app/lib/demos/dmparall.xtr
@@ -0,0 +1,183 @@
+VERSION 2
+DEMOINIT
+ORIG 6.000 0.000 0.000
+PARAMETER display labelenable 4
+STRAIGHT 1 DEMO 1
+ E 1.883333 2.883333 270.000000
+ T 2 16.966667 2.883353 90.000000
+ END
+TURNOUT 2 DEMO 1 16.966667 2.883353 0.000000 "Peco-55 Medium Left SL-E396F"
+ T 1 16.966667 2.883353 270.000000
+ T 3 22.371667 2.883353 90.000000
+ E 22.336667 3.405353 80.314000
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0 0.000000 0.000000 0.353000 0.000000
+ S 0 0 0.353000 0.000000 5.405000 0.000000
+ C 0 0 -23.136000 0.351000 23.136000 170.297000 9.700000
+ S 0 0 4.251000 0.331000 5.370000 0.522000
+ END
+STRAIGHT 3 DEMO 1
+ T 4 26.550000 2.883322 90.000262
+ T 2 22.371667 2.883336 270.000262
+ END
+CURVE 4 DEMO 1 26.550055 14.883322 12.000000
+ E 38.427321 13.171435 8.201723
+ T 3 26.550000 2.883322 270.000110
+ END
+REDRAW
+PARAMETER parallel separation 0.0
+RESET
+MESSAGE
+This example shows how to create parallel tracks.
+END
+STEP
+COMMAND Parallel
+MESSAGE
+_________________________________________
+
+The separation is set in the <Parallel Separation> window. You should set this value before you begin to select tracks.
+END
+STEP
+PARAMETER parallel separation 1.250000
+BIGPAUSE
+MOUSE 2 10.167 2.800
+PAUSE 50
+MOUSE 3 10.167 2.750
+MOUSE 3 10.167 2.667
+MESSAGE
+_________________________________________
+
+You control which side the parallel track will be on by moving the cursor from one side of the track centerline to the other.
+END
+STEP
+PAUSE 60
+MOUSE 3 10.083 2.583
+MOUSE 3 10.083 2.417
+PAUSE 50
+MOUSE 3 10.000 2.417
+PAUSE 60
+MOUSE 3 10.000 2.250
+PAUSE 1040
+MOUSE 3 10.000 2.333
+PAUSE 60
+MOUSE 3 10.000 2.417
+MOUSE 3 10.000 2.500
+PAUSE 50
+MOUSE 3 10.000 2.667
+PAUSE 60
+MOUSE 3 10.000 3.000
+MOUSE 3 10.000 3.083
+PAUSE 50
+MOUSE 3 10.000 3.250
+PAUSE 60
+MOUSE 3 10.000 3.333
+MOUSE 3 10.000 3.417
+PAUSE 50
+MOUSE 3 10.000 3.500
+PAUSE 60
+MOUSE 3 10.000 3.583
+MESSAGE
+_________________________________________
+
+When you release the mouse button the new parallel track is created.
+
+Note that the <Parallel> command remains active after you created the track. This is controlled by the Sticky dialog in the Options menu.
+END
+BIGPAUSE
+MOUSE 4 10.000 3.583
+STEP
+#PARAMETER parallel separation 1.250
+MESSAGE
+_________________________________________
+
+You cannot create a track parallel to a turnout.
+END
+STEP
+MOUSE 2 19.500 2.917
+PAUSE 440
+MOUSE 3 19.500 2.917
+MOUSE 4 19.500 2.917
+MOUSE 2 25.167 2.917
+PAUSE 60
+MOUSE 3 25.167 2.917
+PAUSE 1200
+MOUSE 3 25.167 2.833
+MOUSE 3 25.167 2.750
+PAUSE 60
+MOUSE 3 25.167 2.583
+MOUSE 3 25.167 2.083
+PAUSE 50
+MOUSE 3 25.167 1.500
+PAUSE 60
+MOUSE 3 25.167 1.333
+PAUSE 66086
+MOUSE 3 25.167 1.417
+PAUSE 50
+MOUSE 3 25.167 1.500
+PAUSE 60
+MOUSE 3 25.167 1.583
+MOUSE 3 25.250 2.083
+PAUSE 50
+MOUSE 3 25.333 2.167
+MOUSE 3 25.333 2.500
+PAUSE 60
+MOUSE 3 25.417 2.667
+PAUSE 50
+MOUSE 3 25.417 2.750
+MOUSE 3 25.417 2.833
+PAUSE 60
+MOUSE 3 25.417 2.917
+PAUSE 50
+MOUSE 3 25.417 3.000
+MOUSE 3 25.417 3.083
+PAUSE 60
+MOUSE 3 25.333 3.167
+PAUSE 50
+MOUSE 3 25.333 3.250
+MOUSE 3 25.333 3.333
+PAUSE 65596
+MOUSE 3 25.333 3.417
+MOUSE 3 25.333 3.500
+MOUSE 4 25.333 3.500
+#PARAMETER parallel separation 1.250
+MOUSE 2 32.833 4.833
+PAUSE 60
+MOUSE 3 32.833 4.833
+PAUSE 50
+MOUSE 3 32.833 4.750
+PAUSE 60
+MOUSE 3 32.833 4.667
+PAUSE 66416
+MOUSE 3 32.833 4.583
+PAUSE 110
+MOUSE 3 33.167 4.333
+PAUSE 50
+MOUSE 3 33.417 4.000
+PAUSE 60
+MOUSE 3 33.500 4.000
+PAUSE 65866
+MOUSE 3 33.417 4.000
+PAUSE 160
+MOUSE 3 33.333 4.000
+PAUSE 110
+MOUSE 3 33.167 4.167
+PAUSE 60
+MOUSE 3 31.667 5.833
+PAUSE 50
+MOUSE 3 31.500 6.000
+PAUSE 60
+MOUSE 3 31.500 6.167
+MESSAGE
+_________________________________________
+
+Note that the new curved track is automatically connected to the short parallel track.
+END
+STEP
+MOUSE 4 31.500 6.167
+#PARAMETER parallel separation 1.250
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmplymod.xtr b/app/lib/demos/dmplymod.xtr
new file mode 100644
index 0000000..2c66bc0
--- /dev/null
+++ b/app/lib/demos/dmplymod.xtr
@@ -0,0 +1,76 @@
+VERSION 7
+DEMOINIT
+ORIG 8.000 0.000 0.000
+PARAMETER display description-fontsize 24
+DRAW 1 0 0 0 0 0.000000 0.000000 0.000000
+ Y 255 0.333333 3
+ 3.888889 4.333333
+ 11.333333 18.888889
+ 18.888889 4.333333
+ END
+DRAW 2 0 0 0 0 0.000000 0.000000 0.000000
+ F 255 0.333333 3
+ 23.888889 4.333333
+ 31.000000 19.000000
+ 39.000000 4.444444
+ END
+REDRAW
+RESET
+MESSAGE
+Polylines and Polygons (created with the <Draw> command) can be modified by dragging on their Corners or Edges.
+END
+STEP
+COMMAND Modify
+MOUSE 2 11.333 18.889
+MOUSE 3 18.889 19.333
+MOUSE 4 18.889 19.333
+MOUSE 2 4.000 4.444
+MOUSE 3 4.111 19.333
+MOUSE 4 4.111 19.333
+MOUSE 2 31.222 18.889
+MOUSE 3 38.889 19.667
+MOUSE 4 38.889 19.667
+MOUSE 2 24.222 4.667
+MOUSE 3 24.778 19.667
+MOUSE 4 24.778 19.667
+MESSAGE
+_________________________________________
+
+If you select the middle of an Edge a new Corner is created.
+END
+STEP
+MOUSE 2 10.556 12.667
+MOUSE 3 4.111 4.333
+MOUSE 4 4.111 4.333
+MOUSE 2 31.556 12.333
+MOUSE 3 24.889 4.333
+MOUSE 4 24.889 4.333
+MESSAGE
+_________________________________________
+
+If you drag a Corner to another Corner the two are merged and the Edge between them is removed.
+END
+STEP
+MOUSE 2 4.333 19.222
+MOUSE 3 4.000 4.444
+MOUSE 4 4.000 4.444
+MOUSE 2 25.111 19.667
+MOUSE 3 25.111 4.444
+MOUSE 4 25.111 4.444
+MESSAGE
+_________________________________________
+
+But you cannot have a Poly-shape with less than 3 sides.
+END
+STEP
+MOUSE 2 4.000 4.444
+MOUSE 3 18.900 4.333
+MOUSE 4 18.900 4.333
+MOUSE 2 25.111 4.444
+MOUSE 3 39.111 4.778
+MOUSE 4 39.111 4.778
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmprof.xtr b/app/lib/demos/dmprof.xtr
new file mode 100644
index 0000000..3cbe1b0
--- /dev/null
+++ b/app/lib/demos/dmprof.xtr
@@ -0,0 +1,330 @@
+VERSION 7
+DEMOINIT
+ORIG 9.000 23.000 2.000
+PARAMETER display description-fontsize 96
+PARAMETER display labelenable 4
+PARAMETER display labelscale 12
+CURVE 1 0 0 0 0 N -1 12.666667 13.666667 10.000000
+ T 3 11.809617 3.703461 94.916566
+ T 21 22.410419 15.915955 167.001307
+ END
+STRAIGHT 2 0 0 0 0 N -1
+ T 22 27.376540 8.227390 232.674480 10 1.103460 -0.387390
+ T 6 29.448408 9.807189 52.674480
+ END
+CURVE 3 0 0 0 0 N -1 13.737465 26.114701 22.494005
+ T 22 24.278245 6.243309 62.056285 11 0.401755 -0.563309
+ T 1 11.809617 3.703461 274.916566
+ END
+STRAIGHT 4 0 0 0 0 N -1
+ T 5 37.111111 4.222222 270.000000
+ T 9 38.222222 4.222222 90.000000 9 0.001462 -0.748538 0.500000
+ END
+CURVE 5 0 0 0 0 N -1 37.111111 19.309524 15.087302
+ T 4 37.111111 4.222222 90.000000
+ T 21 26.521963 8.562588 314.576286 10 -1.201963 -0.162588
+ END
+TURNOUT 6 0 0 0 0 N -1 29.448408 9.807189 322.674480 "Peco-55 Medium Right SL-E395F"
+ T 2 29.448408 9.807189 232.674480
+ T 7 33.746482 13.084471 52.674480
+ T 8 34.035161 12.648152 62.360480
+ D 0.000000 0.000000
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0.000000 0.000000 0.000000 0.353000 0.000000
+ S 0 0.000000 0.353000 0.000000 5.405000 0.000000
+ C 0 0.000000 23.136000 0.351000 -23.136000 0.004000 9.700000
+ S 0 0.000000 4.251000 -0.331000 5.370000 -0.522000
+ END
+STRAIGHT 7 0 0 0 0 N -1
+ T 19 42.270123 19.583746 52.674480
+ T 6 33.746482 13.084471 232.674480
+ END
+CURVE 8 0 0 0 0 N -1 45.574853 -9.388207 24.875000
+ T 6 34.035161 12.648152 242.360480
+ T 18 51.462480 14.779984 103.691177
+ END
+TURNOUT 9 0 0 0 0 N -1 38.222222 4.222222 0.000000 "Peco-55 Medium Left SL-E396F"
+ T 4 38.222222 4.222222 270.000000 9 0.000000 0.000000 0.500000
+ T 15 43.627222 4.222222 90.000000
+ T 13 43.592222 4.744222 80.314000
+ D 0.000000 0.000000
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0.000000 0.000000 0.000000 0.353000 0.000000
+ S 0 0.000000 0.353000 0.000000 5.405000 0.000000
+ C 0 0.000000 -23.136000 0.351000 23.136000 170.297000 9.700000
+ S 0 0.000000 4.251000 0.331000 5.370000 0.522000
+ END
+STRAIGHT 10 0 0 0 0 N -1
+ E 76.446137 4.222222 90.000000
+ T 14 72.333333 4.222222 270.000000 9 -0.017544 -0.722222 1.000000
+ END
+STRAIGHT 11 0 0 0 0 N -1
+ T 23 55.000000 5.472222 270.000000 13 -0.040000 0.647778 "New York City"
+ T 16 60.777778 5.472222 90.000000
+ END
+CURVE 12 0 0 0 0 N -1 49.777778 -17.192082 22.664304
+ T 13 45.964542 5.149134 260.314000
+ T 23 49.777778 5.472222 90.000000
+ END
+STRAIGHT 13 0 0 0 0 N -1
+ T 9 43.592222 4.744222 260.314000
+ T 12 45.964542 5.149134 80.314000
+ END
+TURNOUT 14 0 0 0 0 N -1 72.333333 4.222222 180.000000 "Peco-55 Medium Right SL-E395F"
+ T 10 72.333333 4.222222 90.000000 9 0.000000 0.000000 1.000000
+ T 15 66.928333 4.222222 270.000000
+ T 17 66.963333 4.744222 279.686000
+ D 0.000000 0.000000
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0.000000 0.000000 0.000000 0.353000 0.000000
+ S 0 0.000000 0.353000 0.000000 5.405000 0.000000
+ C 0 0.000000 23.136000 0.351000 -23.136000 0.004000 9.700000
+ S 0 0.000000 4.251000 -0.331000 5.370000 -0.522000
+ END
+STRAIGHT 15 0 0 0 0 N -1
+ T 9 43.627222 4.222222 270.000000
+ T 14 66.928333 4.222222 90.000000
+ END
+CURVE 16 0 0 0 0 N -1 60.777778 -17.192082 22.664304
+ T 11 60.777778 5.472222 270.000000
+ T 17 64.591013 5.149134 99.686000
+ END
+STRAIGHT 17 0 0 0 0 N -1
+ T 14 66.963333 4.744222 99.686000
+ T 16 64.591013 5.149134 279.686000
+ END
+CURVE 18 0 0 0 0 N -1 64.332420 67.609950 54.375000
+ E 74.352464 14.166154 79.381036 9 -0.128780 -0.718786 2.000000
+ T 8 51.462480 14.779984 283.691177
+ END
+CURVE 19 0 0 0 0 N -1 49.773613 9.743103 12.375000
+ T 7 42.270123 19.583746 232.674480
+ T 20 56.175027 20.333784 121.150374
+ END
+CURVE 20 0 0 0 0 N -1 64.968888 34.882599 17.000000
+ E 74.032528 20.500303 57.781104 9 0.099051 -0.789777 4.000000
+ T 19 56.175027 20.333784 301.150374
+ END
+CURVE 21 0 0 0 0 N -1 37.111111 19.309524 15.087302
+ T 5 26.521963 8.562588 134.576286 10 0.000000 0.000000
+ T 1 22.410418 15.915955 347.001307
+ END
+CURVE 22 0 0 0 0 N -1 13.737465 26.114701 22.494005
+ T 2 27.376540 8.227390 52.674480 10 0.000000 0.000000
+ T 3 24.278245 6.243309 242.056285 11 0.000000 0.000000
+ END
+STRAIGHT 23 0 0 0 0 N -1
+ T 12 49.777778 5.472222 270.000000
+ T 11 55.000000 5.472222 90.000000 13 0.000000 0.000000 "New York City"
+ END
+REDRAW
+RESET
+COMMAND Profile
+MESSAGE
+To use the <Profile> command you first need to define Elevations on your layout.
+
+In this example we'll use the Elevations defined in the last example.
+
+You can move or resize the Profile dialog now if you want.
+END
+STEP
+#PARAMETER action profile-setpath 0
+MESSAGE
+_________________________________________
+
+To show the Profile you need to select a Path on the tracks of your layout.
+
+Select a Defined Elevation point (marked by Gold dots).
+
+We will start with the right end of the siding.
+END
+STEP
+#ORIG 4.000 70.000 3.000
+MOUSE 2 72.347 4.227
+MOUSE 4 72.347 4.227
+MESSAGE
+_________________________________________
+
+The second Point is at the left end of the siding. The Path will be drawn in Purple on the layout.
+END
+STEP
+#ORIG 4.000 36.000 3.000
+MOUSE 2 38.240 4.200
+MOUSE 4 38.240 4.200
+#ORIG 4.000 72.000 13.000
+BIGPAUSE
+#ORIG 8.000 25.000 3.000
+MESSAGE
+_________________________________________
+
+Now select the end of one of the Branches
+
+END
+STEP
+MOUSE 2 73.63 20.25
+MOUSE 4 73.63 20.25
+MESSAGE
+_________________________________________
+
+The Profile line is drawn in Red. This indicates that there some turnouts on that section of the Path which have more than 2 connections.
+
+The grade on this part of the Path is the average and may be affected by other Elevations, such the end of the lower branch.
+
+END
+STEP
+MESSAGE
+_________________________________________
+
+Now try to select the End-Point of the other branch.
+You will get an error message because there is no route to one of the ends of the existing Path.
+END
+STEP
+MOUSE 2 74.0 14.0
+MOUSE 4 74.0 14.0
+MESSAGE
+_________________________________________
+
+In this case remove the last part of the Path by clicking on current end of the Path and reselect the End-Point.
+END
+STEP
+MOUSE 2 73.63 20.25
+MOUSE 4 73.63 20.25
+BIGPAUSE
+MOUSE 2 74.0 14.0
+MOUSE 4 74.0 14.0
+MESSAGE
+_________________________________________
+
+Notice that the Grade has changed on the Profile.
+END
+STEP
+#ORIG 4 30 11
+MESSAGE
+_________________________________________
+
+You can Ignore End-Points on the Path by using Shift-Right-Click to display the Profile Options popup menu and chosing Ignore.
+
+Note: We can't show the menu in demo mode but we will show the effect of a Shift Right Click and selecting ignore. We will be Ignoring the End-Point of the Turnout that is not on the Path.
+END
+STEP
+BIGPAUSE
+#PARAMETER action profile-setpath 1
+#MOUSE 1 33.789 13.158
+MENU 33.789 13.158 "Profile Mode" "Ignore"
+MESSAGE
+_________________________________________
+
+Notice that part of the Profile line is redrawn in Blue.
+Also, the Computed Elevations and Grade marker on the right side of the layout have been updated.
+END
+STEP
+#ORIG 4 48 12
+MESSAGE
+_________________________________________
+
+You can set additional Defined Elevation points using the Profile Options popup menu. These points are added to the Profile if they are on the Path.
+
+We do this by Shift Right Click to display the Profile Options popup menu and selecting Define.
+END
+STEP
+#MOUSE 1 51.526 14.737
+MENU 51.526 14.737 "Profile Mode" "Define"
+#MOUSE 2 51.526 14.737
+#MOUSE 4 51.526 14.737
+MESSAGE
+_________________________________________
+
+We've just added a Defined Elevation point to the middle of the lower branch. Notice the addition on the Profile dialog.
+=========================================
+END
+STEP
+CLEAR
+#ORIG 4 40 2
+MESSAGE
+For the siding we defined a Station name but it's not on the Path, since the Path takes the shortest distance between points.
+
+We can Ignore one of the End-Points on a Turnout to force the Path to take the other route.
+
+Again we use Shift-Right-Click to display the Profile Options menu and select ignore.
+END
+STEP
+#MOUSE 1 43.737 4.158
+MENU 43.737 4.158 "Profile Mode" "Ignore"
+BIGPAUSE
+#ORIG 4 70 2
+MESSAGE
+_________________________________________
+
+Now remove the First section of the Path,
+END
+STEP
+#PARAMETER action profile-setpath 0
+MOUSE 2 72.211 4.316
+MOUSE 4 72.211 4.316
+BIGPAUSE
+MESSAGE
+
+and reselect it.
+END
+STEP
+MOUSE 2 72.368 4.158
+MOUSE 4 72.368 4.158
+BIGPAUSE
+#ORIG 8 24 2
+MESSAGE
+_________________________________________
+
+Now the Path goes through the Station End-Point and the name appears on the Profile dialog.
+=========================================
+END
+STEP
+CLEAR
+ORIG 2 20 5
+MESSAGE
+Now we need to increase the separation where the tracks cross.
+
+The two Elevations you see here are Computed Elevations which means XTrackCAD dynamically computes the Elevation based on the Elevations of connecting tracks.
+
+First make the lower End-Point a Defined Elevation point using Shift-Right-Click and the Profile Options menu. You will see the End-Point marked by a Gold dot and a new line is added to the Profile dialog.
+END
+STEP
+#PARAMETER action profile-setpath 1
+#MOUSE 1 26.421 8.684
+MENU 26.421 8.684 "Profile Mode" "Define"
+MESSAGE
+_________________________________________
+
+Now, drag the point on the Profile Dialog to change the Elevation.
+
+Note the grade on each side of the point will be displayed at the bottom of the Profile dialog.
+END
+STEP
+PARAMETER profile canvas 2 48.028 0.733
+PAUSE 100
+PARAMETER profile canvas 3 48.028 0.70
+PAUSE 100
+PARAMETER profile canvas 3 48.028 0.67
+PAUSE 100
+PARAMETER profile canvas 3 48.028 0.63
+PAUSE 100
+PARAMETER profile canvas 3 48.028 0.60
+PAUSE 100
+PARAMETER profile canvas 3 48.028 0.57
+PAUSE 100
+PARAMETER profile canvas 3 48.028 0.53
+PAUSE 100
+MESSAGE
+_________________________________________
+
+After we release the Profile is updated to show the new Elevation and Grade.
+END
+PARAMETER profile canvas 4 48.028 0.50
+BIGPAUSE
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmrescal.xtr b/app/lib/demos/dmrescal.xtr
new file mode 100644
index 0000000..6758f5d
--- /dev/null
+++ b/app/lib/demos/dmrescal.xtr
@@ -0,0 +1,180 @@
+# XTrkCad Version: 3.0.1, Date: Sat Sep 23 22:27:13 2000
+
+VERSION 10
+DEMOINIT
+ORIG 4.000 0.000 0.000
+PARAMETER display description-fontsize 64
+STRUCTURE 1 0 0 0 0 N 2 6.210395 3.915802 0 236.697715 "Walthers Interstate Fuel - Loading Rack 933-32000a"
+ D 0.000000 0.000000
+ L3 0 0.000000 0.750000 0.000000 0 3.750000 0.000000 0
+ L3 0 0.000000 3.750000 0.000000 0 3.750000 3.125000 0
+ L3 0 0.000000 3.750000 3.125000 0 0.750000 3.125000 0
+ L3 0 0.000000 3.687500 0.062500 0 1.687500 0.062500 0
+ L3 0 0.000000 1.687500 0.062500 0 1.687500 0.812500 0
+ L3 0 0.000000 1.687500 0.812500 0 3.687500 0.812500 0
+ L3 0 0.000000 3.687500 0.812500 0 3.687500 0.062500 0
+ L3 0 0.000000 3.687500 3.062500 0 1.687500 3.062500 0
+ L3 0 0.000000 1.687500 3.062500 0 1.687500 2.312500 0
+ L3 0 0.000000 1.687500 2.312500 0 3.687500 2.312500 0
+ L3 0 0.000000 3.687500 2.312500 0 3.687500 3.062500 0
+ L3 0 0.000000 3.687500 1.187500 0 1.687500 1.187500 0
+ L3 0 0.000000 1.687500 1.187500 0 1.687500 1.937500 0
+ L3 0 0.000000 1.687500 1.937500 0 3.687500 1.937500 0
+ L3 0 0.000000 3.687500 1.937500 0 3.687500 1.187500 0
+ A3 0 0.000000 0.088388 3.000000 2.687500 0 0.000000 360.000000
+ A3 0 0.000000 0.088388 3.000000 1.562500 0 0.000000 360.000000
+ A3 0 0.000000 0.088388 3.000000 0.437500 0 0.000000 360.000000
+ L3 0 0.000000 0.750000 2.875000 0 0.000000 2.875000 0
+ L3 0 0.000000 0.000000 2.875000 0 0.000000 0.250000 0
+ L3 0 0.000000 0.000000 0.250000 0 0.750000 0.250000 0
+ L3 0 0.000000 1.500000 2.187500 0 0.437500 2.187500 0
+ L3 0 0.000000 0.437500 2.187500 0 0.437500 0.937500 0
+ L3 0 0.000000 0.437500 0.937500 0 1.500000 0.937500 0
+ L3 0 0.000000 1.500000 0.937500 0 1.500000 2.187500 0
+ L3 0 0.000000 0.750000 3.125000 0 0.750000 2.187500 0
+ L3 0 0.000000 0.750000 0.000000 0 0.750000 0.937500 0
+ END
+STRAIGHT 2 0 0 0 0 N 2
+ E 0.105826 -1.346082 236.697715
+ T 5 3.511000 0.890894 56.697715
+ END
+STRUCTURE 3 0 0 0 0 N 2 15.697638 4.710368 0 326.697715 "Walthers Shady Jct Water Tower 933-3205a"
+ D 0.000000 0.000000
+ L3 0 0.000000 0.000000 0.000000 0 1.562500 0.000000 0
+ L3 0 0.000000 1.562500 0.000000 0 1.562500 1.562500 0
+ L3 0 0.000000 1.562500 1.562500 0 0.000000 1.562500 0
+ L3 0 0.000000 0.000000 1.562500 0 0.000000 0.000000 0
+ L3 0 0.000000 0.000000 0.375000 0 1.250000 0.375000 0
+ L3 0 0.000000 1.250000 0.375000 0 1.250000 1.562500 0
+ L3 0 0.000000 0.625000 1.000000 0 0.625000 0.375000 0
+ L3 0 0.000000 0.625000 1.000000 0 1.250000 1.000000 0
+ L3 0 0.000000 0.625000 1.000000 0 0.000000 1.000000 0
+ L3 0 0.000000 0.625000 1.000000 0 0.625000 1.562500 0
+ L3 0 0.000000 0.625000 1.000000 0 1.062500 1.437500 0
+ L3 0 0.000000 0.625000 1.000000 0 1.062500 0.562500 0
+ L3 0 0.000000 0.625000 1.000000 0 0.187500 0.562500 0
+ L3 0 0.000000 0.625000 1.000000 0 0.187500 1.437500 0
+ L3 0 0.000000 0.625000 1.562500 0 1.062500 1.437500 0
+ L3 0 0.000000 1.062500 1.437500 0 1.250000 1.000000 0
+ L3 0 0.000000 1.250000 1.000000 0 1.062500 0.562500 0
+ L3 0 0.000000 1.062500 0.562500 0 0.625000 0.375000 0
+ L3 0 0.000000 0.625000 0.375000 0 0.187500 0.562500 0
+ L3 0 0.000000 0.187500 0.562500 0 0.000000 1.000000 0
+ L3 0 0.000000 0.000000 1.000000 0 0.187500 1.437500 0
+ L3 0 0.000000 0.187500 1.437500 0 0.625000 1.562500 0
+ L3 0 0.000000 1.250000 1.500000 0 1.750000 1.500000 0
+ L3 0 0.000000 1.750000 1.500000 0 1.750000 1.062500 0
+ L3 0 0.000000 1.750000 1.062500 0 1.250000 1.062500 0
+ END
+STRAIGHT 4 0 0 0 0 N 2
+ E 22.026067 13.054077 56.697715
+ T 5 8.028421 3.858543 236.697715
+ END
+TURNOUT 5 0 0 0 0 N 2 3.511000 0.890894 0 326.697715 "Peco-55 Medium Right SL-E395F"
+ T 2 3.511000 0.890894 236.697715
+ T 4 8.028421 3.858543 56.697715
+ T 8 8.285775 3.403046 66.383715
+ D 0.000000 0.000000
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0.000000 0.000000 0.000000 0.353000 0.000000
+ S 0 0.000000 0.353000 0.000000 5.405000 0.000000
+ C 0 0.000000 23.136000 0.351000 -23.136000 0.004000 9.700000
+ S 0 0.000000 4.251000 -0.331000 5.370000 -0.522000
+ END
+STRAIGHT 6 0 0 0 0 N 2
+ E 22.690715 11.995108 56.697715
+ T 7 13.433501 5.913726 236.697715
+ END
+CURVE 7 0 0 0 0 N 2 4.259807 19.878127 0 16.708116 0 0.000000 0.000000
+ T 6 13.433501 5.913726 56.697715
+ T 8 10.953237 4.569334 246.383715
+ END
+STRAIGHT 8 0 0 0 0 N 2
+ T 5 8.285775 3.403046 246.383715
+ T 7 10.953237 4.569334 66.383715
+ END
+STRUCTURE 9 0 0 0 0 N 2 16.897495 6.987885 0 326.697715 "Walthers 2-Stall Engine House 933-3204"
+ D 0.000000 0.000000
+ L3 0 0.000000 0.000000 0.000000 0 7.625000 0.000000 0
+ L3 0 0.000000 7.625000 0.000000 0 7.625000 3.250000 0
+ L3 0 0.000000 7.625000 3.250000 0 0.000000 3.250000 0
+ L3 0 0.000000 0.000000 3.250000 0 0.000000 0.000000 0
+ L3 0 0.000000 0.000000 1.625000 0 7.625000 1.625000 0
+ L3 0 0.000000 0.000000 2.000000 0 7.625000 2.000000 0
+ L3 0 0.000000 0.000000 1.250000 0 7.625000 1.250000 0
+ A3 0 0.000000 0.225347 6.625000 0.875000 0 0.000000 360.000000
+ A3 0 0.000000 0.139754 6.625000 0.875000 0 0.000000 360.000000
+ A3 0 0.000000 0.225347 1.000000 0.875000 0 0.000000 360.000000
+ A3 0 0.000000 0.139754 1.000000 0.875000 0 0.000000 360.000000
+ A3 0 0.000000 0.225347 1.000000 2.375000 0 0.000000 360.000000
+ A3 0 0.000000 0.139754 1.000000 2.375000 0 0.000000 360.000000
+ A3 0 0.000000 0.225347 6.625000 2.375000 0 0.000000 360.000000
+ A3 0 0.000000 0.139754 6.625000 2.375000 0 0.000000 360.000000
+ END
+REDRAW
+RESET
+PARAMETER misc cmdSelectAll
+PARAMETER misc cmdRescale
+MESSAGE
+The <Rescale> command will change the size of the selected objects.
+
+First we will try rescaling by ratio.
+END
+STEP
+PARAMETER rescale toggle 1
+MESSAGE
+_________________________________________
+
+We are going to make everything 150% bigger.
+
+END
+STEP
+PARAMETER rescale ratio 150.000000
+STEP
+PARAMETER rescale ok
+MESSAGE
+Note the track gauge did not change.
+END
+STEP
+PARAMETER misc cmdUndo
+RESET
+PARAMETER misc cmdRescale
+MESSAGE
+_________________________________________
+
+Let's try that again.
+
+Now we are going to convert from one scale to another.
+END
+STEP
+PARAMETER rescale toggle 0
+PARAMETER rescale toS 4 HO
+MESSAGE
+_________________________________________
+
+We will convert everything from N scale to HO scale...
+END
+STEP
+#PARAMETER rescale change-gauge 1
+MESSAGE
+and change the track gauge as well.
+END
+STEP
+PARAMETER rescale ok
+COMMAND Describe
+MOUSE 2 10.750 6.688
+MOUSE 4 10.750 6.688
+MESSAGE
+_________________________________________
+
+Note that the Title of the turnout did not change.
+END
+STEP
+#DESCRIBE OK
+PARAMETER describe ok
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmrotate.xtr b/app/lib/demos/dmrotate.xtr
new file mode 100644
index 0000000..074aea5
--- /dev/null
+++ b/app/lib/demos/dmrotate.xtr
@@ -0,0 +1,504 @@
+VERSION 10
+DEMOINIT
+ORIG 4.000 0.000 0.000
+STRUCTURE 1 0 0 0 0 N 2 2.000000 3.062500 0 0.000000 "Walthers Interstate Fuel - Loading Rack 933-32000a"
+ D 0.000000 0.000000
+ L3 0 0.000000 0.750000 0.000000 0 3.750000 0.000000 0
+ L3 0 0.000000 3.750000 0.000000 0 3.750000 3.125000 0
+ L3 0 0.000000 3.750000 3.125000 0 0.750000 3.125000 0
+ L3 0 0.000000 3.687500 0.062500 0 1.687500 0.062500 0
+ L3 0 0.000000 1.687500 0.062500 0 1.687500 0.812500 0
+ L3 0 0.000000 1.687500 0.812500 0 3.687500 0.812500 0
+ L3 0 0.000000 3.687500 0.812500 0 3.687500 0.062500 0
+ L3 0 0.000000 3.687500 3.062500 0 1.687500 3.062500 0
+ L3 0 0.000000 1.687500 3.062500 0 1.687500 2.312500 0
+ L3 0 0.000000 1.687500 2.312500 0 3.687500 2.312500 0
+ L3 0 0.000000 3.687500 2.312500 0 3.687500 3.062500 0
+ L3 0 0.000000 3.687500 1.187500 0 1.687500 1.187500 0
+ L3 0 0.000000 1.687500 1.187500 0 1.687500 1.937500 0
+ L3 0 0.000000 1.687500 1.937500 0 3.687500 1.937500 0
+ L3 0 0.000000 3.687500 1.937500 0 3.687500 1.187500 0
+ A3 0 0.000000 0.088388 3.000000 2.687500 0 0.000000 360.000000
+ A3 0 0.000000 0.088388 3.000000 1.562500 0 0.000000 360.000000
+ A3 0 0.000000 0.088388 3.000000 0.437500 0 0.000000 360.000000
+ L3 0 0.000000 0.750000 2.875000 0 0.000000 2.875000 0
+ L3 0 0.000000 0.000000 2.875000 0 0.000000 0.250000 0
+ L3 0 0.000000 0.000000 0.250000 0 0.750000 0.250000 0
+ L3 0 0.000000 1.500000 2.187500 0 0.437500 2.187500 0
+ L3 0 0.000000 0.437500 2.187500 0 0.437500 0.937500 0
+ L3 0 0.000000 0.437500 0.937500 0 1.500000 0.937500 0
+ L3 0 0.000000 1.500000 0.937500 0 1.500000 2.187500 0
+ L3 0 0.000000 0.750000 3.125000 0 0.750000 2.187500 0
+ L3 0 0.000000 0.750000 0.000000 0 0.750000 0.937500 0
+ END
+STRAIGHT 2 0 0 0 0 N 2
+ E 2.250000 0.062500 236.697715
+ E 19.375000 11.312500 56.697715
+ END
+CURVE 3 0 0 0 0 N 2 22.859949 -1.206745 0 11.250000 0 0.000000 0.000000
+ E 11.625000 -0.625000 182.964125
+ E 20.250359 9.736405 76.587298
+ END
+STRUCTURE 4 0 0 0 0 N 2 8.625000 7.750000 0 0.000000 "Walthers Shady Jct Water Tower 933-3205a"
+ D 0.000000 0.000000
+ L3 0 0.000000 0.000000 0.000000 0 1.562500 0.000000 0
+ L3 0 0.000000 1.562500 0.000000 0 1.562500 1.562500 0
+ L3 0 0.000000 1.562500 1.562500 0 0.000000 1.562500 0
+ L3 0 0.000000 0.000000 1.562500 0 0.000000 0.000000 0
+ L3 0 0.000000 0.000000 0.375000 0 1.250000 0.375000 0
+ L3 0 0.000000 1.250000 0.375000 0 1.250000 1.562500 0
+ L3 0 0.000000 0.625000 1.000000 0 0.625000 0.375000 0
+ L3 0 0.000000 0.625000 1.000000 0 1.250000 1.000000 0
+ L3 0 0.000000 0.625000 1.000000 0 0.000000 1.000000 0
+ L3 0 0.000000 0.625000 1.000000 0 0.625000 1.562500 0
+ L3 0 0.000000 0.625000 1.000000 0 1.062500 1.437500 0
+ L3 0 0.000000 0.625000 1.000000 0 1.062500 0.562500 0
+ L3 0 0.000000 0.625000 1.000000 0 0.187500 0.562500 0
+ L3 0 0.000000 0.625000 1.000000 0 0.187500 1.437500 0
+ L3 0 0.000000 0.625000 1.562500 0 1.062500 1.437500 0
+ L3 0 0.000000 1.062500 1.437500 0 1.250000 1.000000 0
+ L3 0 0.000000 1.250000 1.000000 0 1.062500 0.562500 0
+ L3 0 0.000000 1.062500 0.562500 0 0.625000 0.375000 0
+ L3 0 0.000000 0.625000 0.375000 0 0.187500 0.562500 0
+ L3 0 0.000000 0.187500 0.562500 0 0.000000 1.000000 0
+ L3 0 0.000000 0.000000 1.000000 0 0.187500 1.437500 0
+ L3 0 0.000000 0.187500 1.437500 0 0.625000 1.562500 0
+ L3 0 0.000000 1.250000 1.500000 0 1.750000 1.500000 0
+ L3 0 0.000000 1.750000 1.500000 0 1.750000 1.062500 0
+ L3 0 0.000000 1.750000 1.062500 0 1.250000 1.062500 0
+ END
+REDRAW
+RESET
+MESSAGE
+The <Rotate> command will pivot the Selected objects. First Click on the pivot point and then drag to Rotate the objects.
+In this example we will rotate the selected structure about it's center.
+END
+STEP
+RESET
+COMMAND Select
+MOUSE 2 5.562 5.000
+MOUSE 4 5.562 5.000
+COMMAND Rotate
+MOUSE 5 4.062 4.500
+MOUSE 6 4.062 4.438
+MOUSE 7 4.062 4.438
+MOUSE 2 4.062 4.625
+MOUSE 3 4.062 4.625
+MOUSE 3 4.062 4.688
+MOUSE 3 4.062 4.812
+MOUSE 3 4.125 4.938
+MOUSE 3 4.125 5.000
+MOUSE 3 4.125 5.000
+MOUSE 3 4.125 5.062
+MOUSE 3 4.125 5.125
+MOUSE 3 4.125 5.188
+MOUSE 3 4.125 5.250
+MOUSE 3 4.188 5.312
+MOUSE 3 4.188 5.312
+MOUSE 3 4.188 5.375
+MOUSE 3 4.188 5.438
+MOUSE 3 4.188 5.500
+MOUSE 3 4.250 5.500
+MOUSE 3 4.250 5.562
+MOUSE 3 4.250 5.625
+MOUSE 3 4.312 5.625
+MOUSE 3 4.312 5.688
+MOUSE 3 4.312 5.750
+MOUSE 3 4.312 5.812
+MOUSE 3 4.312 5.812
+MOUSE 3 4.312 5.875
+MOUSE 3 4.312 5.938
+MOUSE 3 4.375 5.938
+MOUSE 3 4.375 6.000
+MOUSE 3 4.375 6.000
+MOUSE 3 4.438 6.000
+MOUSE 3 4.500 6.000
+MOUSE 3 4.562 6.000
+MOUSE 3 4.562 6.062
+MOUSE 3 4.625 6.062
+MOUSE 3 4.625 6.062
+MOUSE 3 4.688 6.062
+MOUSE 3 4.688 6.125
+MOUSE 3 4.750 6.125
+MOUSE 3 4.812 6.125
+MOUSE 3 4.938 6.125
+MOUSE 3 5.000 6.125
+MOUSE 4 5.000 6.125
+MESSAGE
+_________________________________________
+
+The <Rotate> command will restrict the rotation to increments of 15° if you hold down the Control key.
+END
+STEP
+PARAMETER misc cmdUndo
+RESET
+COMMAND Rotate
+KEYSTATE 4
+MOUSE 2 4.125 4.625
+KEYSTATE 4
+MOUSE 3 4.125 4.688
+KEYSTATE 4
+MOUSE 3 4.188 4.688
+KEYSTATE 4
+MOUSE 3 4.188 4.750
+KEYSTATE 4
+MOUSE 3 4.188 4.812
+KEYSTATE 4
+MOUSE 3 4.188 4.875
+KEYSTATE 4
+MOUSE 3 4.125 4.875
+KEYSTATE 4
+MOUSE 3 4.125 4.938
+KEYSTATE 4
+MOUSE 3 4.125 5.000
+KEYSTATE 4
+MOUSE 3 4.125 5.000
+KEYSTATE 4
+MOUSE 3 4.125 5.062
+KEYSTATE 4
+MOUSE 3 4.125 5.125
+KEYSTATE 4
+MOUSE 3 4.125 5.188
+KEYSTATE 4
+MOUSE 3 4.125 5.312
+KEYSTATE 4
+MOUSE 3 4.125 5.312
+KEYSTATE 4
+MOUSE 3 4.188 5.438
+KEYSTATE 4
+MOUSE 3 4.188 5.500
+KEYSTATE 4
+MOUSE 3 4.188 5.562
+KEYSTATE 4
+MOUSE 3 4.188 5.625
+KEYSTATE 4
+MOUSE 3 4.188 5.625
+KEYSTATE 4
+MOUSE 3 4.188 5.688
+KEYSTATE 4
+MOUSE 3 4.188 5.750
+KEYSTATE 4
+MOUSE 3 4.250 5.812
+KEYSTATE 4
+MOUSE 3 4.250 5.875
+KEYSTATE 4
+MOUSE 3 4.250 6.000
+KEYSTATE 4
+MOUSE 3 4.312 6.000
+KEYSTATE 4
+MOUSE 3 4.312 6.062
+KEYSTATE 4
+MOUSE 3 4.312 6.125
+KEYSTATE 4
+MOUSE 3 4.312 6.188
+KEYSTATE 4
+MOUSE 3 4.312 6.250
+KEYSTATE 4
+MOUSE 3 4.375 6.250
+KEYSTATE 4
+MOUSE 3 4.438 6.250
+KEYSTATE 4
+MOUSE 3 4.500 6.250
+KEYSTATE 4
+MOUSE 3 4.562 6.312
+KEYSTATE 4
+MOUSE 3 4.625 6.312
+KEYSTATE 4
+MOUSE 3 4.625 6.375
+KEYSTATE 4
+MOUSE 3 4.688 6.375
+KEYSTATE 4
+MOUSE 3 4.750 6.375
+KEYSTATE 4
+MOUSE 3 4.750 6.438
+KEYSTATE 4
+MOUSE 3 4.750 6.500
+KEYSTATE 4
+MOUSE 3 4.812 6.500
+KEYSTATE 4
+MOUSE 3 4.812 6.562
+KEYSTATE 4
+MOUSE 3 4.875 6.562
+KEYSTATE 4
+MOUSE 3 4.938 6.562
+KEYSTATE 4
+MOUSE 3 5.000 6.562
+KEYSTATE 4
+MOUSE 3 5.000 6.562
+KEYSTATE 4
+MOUSE 3 5.062 6.562
+KEYSTATE 4
+MOUSE 3 5.125 6.562
+KEYSTATE 4
+MOUSE 3 5.188 6.562
+KEYSTATE 4
+MOUSE 3 5.250 6.562
+KEYSTATE 4
+MOUSE 3 5.312 6.562
+KEYSTATE 4
+MOUSE 3 5.312 6.500
+KEYSTATE 4
+MOUSE 3 5.312 6.438
+KEYSTATE 4
+MOUSE 3 5.312 6.375
+KEYSTATE 4
+MOUSE 3 5.375 6.375
+KEYSTATE 4
+MOUSE 3 5.438 6.375
+KEYSTATE 4
+MOUSE 3 5.438 6.312
+KEYSTATE 4
+MOUSE 3 5.438 6.312
+KEYSTATE 4
+MOUSE 3 5.500 6.312
+KEYSTATE 4
+MOUSE 3 5.500 6.250
+KEYSTATE 4
+MOUSE 3 5.562 6.250
+KEYSTATE 4
+MOUSE 3 5.562 6.188
+KEYSTATE 4
+MOUSE 3 5.562 6.125
+KEYSTATE 4
+MOUSE 3 5.625 6.125
+KEYSTATE 4
+MOUSE 3 5.625 6.062
+KEYSTATE 4
+MOUSE 3 5.625 6.062
+KEYSTATE 4
+MOUSE 3 5.625 6.000
+KEYSTATE 4
+MOUSE 3 5.625 6.000
+KEYSTATE 4
+MOUSE 3 5.688 6.000
+KEYSTATE 4
+MOUSE 3 5.688 5.938
+KEYSTATE 4
+MOUSE 3 5.750 5.938
+KEYSTATE 4
+MOUSE 3 5.750 5.875
+KEYSTATE 4
+MOUSE 3 5.812 5.875
+KEYSTATE 4
+MOUSE 3 5.812 5.812
+KEYSTATE 4
+MOUSE 3 5.875 5.750
+KEYSTATE 4
+MOUSE 3 5.875 5.688
+KEYSTATE 4
+MOUSE 3 5.938 5.688
+KEYSTATE 4
+MOUSE 3 5.938 5.625
+KEYSTATE 4
+MOUSE 3 5.938 5.625
+KEYSTATE 4
+MOUSE 3 6.000 5.625
+KEYSTATE 4
+MOUSE 4 6.000 5.625
+MESSAGE
+_________________________________________
+
+Shift-Right-Click will display a popup-menu that you can use to rotate by fixed amount (15°, 30°, 45°, 90° or 180°). The demonstration cannot show the popup-menu but it can show the effects.
+
+Here we will rotate by 90° clockwise (CW).
+END
+STEP
+KEYSTATE 2
+MOUSE 5 3.812 4.688
+KEYSTATE 2
+MOUSE 7 3.812 4.688
+MENU 3.812 4.688 "Move Draw Mode " "90 CW"
+MESSAGE
+_________________________________________
+
+Another option of the <Rotate> command popup-menu is to Align the Selected object with some other object.
+
+First we will click on one line of the Selected object. The angle of this part of the object will be Aligned.
+END
+STEP
+KEYSTATE 2
+MOUSE 5 5.875 5.000
+KEYSTATE 2
+MOUSE 7 5.875 5.000
+MENU 5.875 5.000 "Move Draw Mode " "Align"
+MOUSE 2 5.812 5.125
+MOUSE 4 5.812 5.125
+MESSAGE
+_________________________________________
+
+Next, we click on an Unselected object. The Selected structure will be rotated so that the line we clicked on will be parallel to the straight track.
+END
+STEP
+MOUSE 2 6.625 3.062
+MESSAGE
+_________________________________________
+
+If we drag the mouse across the track, we can flip the structure by 180°. This is similar to how we place turnouts.
+END
+STEP
+MOUSE 3 6.750 2.750
+BIGPAUSE
+MOUSE 3 6.625 3.062
+BIGPAUSE
+MOUSE 3 6.750 2.750
+MESSAGE
+_________________________________________
+
+We can also align to curved shapes. The Selected object will be rotated to be parallel to the curve under the cursor.
+END
+STEP
+MOUSE 3 12.250 3.250
+MESSAGE
+_________________________________________
+
+As we drag along the curved track the Selected object rotates to follow the curve.
+END
+STEP
+MOUSE 3 12.250 3.312
+MOUSE 3 12.312 3.312
+MOUSE 3 12.312 3.438
+MOUSE 3 12.312 3.562
+MOUSE 3 12.312 3.625
+MOUSE 3 12.312 3.750
+MOUSE 3 12.375 3.812
+MOUSE 3 12.375 3.938
+MOUSE 3 12.500 4.000
+MOUSE 3 12.562 4.062
+MOUSE 3 12.625 4.125
+MOUSE 3 12.688 4.250
+MOUSE 3 12.750 4.312
+MOUSE 3 12.812 4.312
+MOUSE 3 12.875 4.375
+MOUSE 3 12.938 4.438
+MOUSE 3 13.000 4.500
+MOUSE 3 13.062 4.625
+MOUSE 3 13.125 4.625
+MOUSE 3 13.188 4.688
+MOUSE 3 13.250 4.812
+MOUSE 3 13.312 4.875
+MOUSE 3 13.312 4.938
+MOUSE 3 13.312 5.000
+MOUSE 3 13.375 5.125
+MOUSE 3 13.438 5.250
+MOUSE 3 13.500 5.312
+MOUSE 3 13.500 5.438
+MOUSE 3 13.562 5.500
+MOUSE 3 13.625 5.562
+MOUSE 3 13.625 5.625
+MOUSE 3 13.625 5.688
+MOUSE 3 13.625 5.812
+MOUSE 3 13.688 5.938
+MOUSE 3 13.750 6.000
+MOUSE 3 13.812 6.125
+MOUSE 3 13.812 6.250
+MOUSE 3 13.875 6.312
+MOUSE 3 13.938 6.312
+MOUSE 3 14.000 6.375
+MOUSE 3 14.062 6.375
+MOUSE 3 14.188 6.438
+MOUSE 3 14.250 6.500
+MOUSE 3 14.312 6.562
+MOUSE 3 14.438 6.562
+MESSAGE
+_________________________________________
+
+Again, if we drag across the track we can flip the stucture.
+END
+STEP
+MOUSE 3 14.600 6.200
+BIGPAUSE
+MESSAGE
+_________________________________________
+
+We can also Align to another Structure or any object.
+
+END
+STEP
+MOUSE 3 8.500 7.812
+MOUSE 3 8.500 7.875
+MOUSE 3 8.500 7.938
+MOUSE 3 8.500 8.000
+MOUSE 3 8.500 8.000
+MOUSE 3 8.500 8.062
+MOUSE 3 8.500 8.125
+MOUSE 3 8.500 8.188
+MOUSE 3 8.500 8.250
+MOUSE 3 8.500 8.312
+MOUSE 3 8.500 8.312
+MOUSE 3 8.500 8.375
+MOUSE 3 8.500 8.438
+MOUSE 3 8.500 8.500
+MOUSE 3 8.500 8.562
+MOUSE 3 8.500 8.625
+MOUSE 3 8.500 8.625
+MOUSE 3 8.500 8.688
+MOUSE 3 8.500 8.750
+MOUSE 3 8.562 8.812
+MOUSE 3 8.562 8.875
+MOUSE 3 8.562 8.938
+MOUSE 3 8.562 9.000
+MOUSE 3 8.625 9.000
+MOUSE 3 8.625 9.000
+MOUSE 3 8.625 9.062
+MOUSE 3 8.625 9.125
+MOUSE 3 8.625 9.188
+MOUSE 3 8.625 9.250
+MOUSE 3 8.625 9.312
+MOUSE 3 8.625 9.312
+MOUSE 3 8.625 9.375
+MOUSE 3 8.625 9.438
+MOUSE 3 8.625 9.375
+MOUSE 3 8.625 9.375
+MOUSE 3 8.688 9.312
+MOUSE 3 8.750 9.312
+MOUSE 3 8.750 9.312
+MOUSE 3 8.875 9.312
+MOUSE 3 8.938 9.312
+MOUSE 3 9.000 9.312
+MOUSE 3 9.000 9.312
+MOUSE 3 9.062 9.312
+MOUSE 3 9.062 9.312
+MOUSE 3 9.125 9.312
+MOUSE 3 9.188 9.312
+MOUSE 3 9.250 9.312
+MOUSE 3 9.312 9.312
+MOUSE 3 9.312 9.312
+MOUSE 3 9.375 9.312
+MOUSE 3 9.438 9.312
+MOUSE 3 9.500 9.312
+MOUSE 3 9.562 9.312
+MOUSE 3 9.625 9.312
+MOUSE 3 9.625 9.312
+MOUSE 3 9.688 9.312
+MOUSE 3 9.750 9.312
+MOUSE 3 9.812 9.312
+MOUSE 3 9.875 9.312
+MOUSE 3 9.938 9.312
+MOUSE 3 10.000 9.312
+MOUSE 3 10.000 9.312
+MOUSE 3 10.062 9.312
+MOUSE 3 10.125 9.312
+MOUSE 3 10.125 9.312
+MOUSE 3 10.125 9.250
+MOUSE 3 10.125 9.188
+MOUSE 3 10.125 9.125
+MOUSE 3 10.125 9.062
+MOUSE 3 10.062 9.062
+MOUSE 3 10.062 9.000
+MOUSE 3 10.062 9.000
+MOUSE 3 10.062 8.938
+MOUSE 3 10.062 8.875
+MOUSE 3 10.062 8.812
+MOUSE 3 10.125 8.812
+MOUSE 3 10.125 8.750
+MOUSE 3 10.125 8.688
+MOUSE 3 10.125 8.625
+MOUSE 3 10.125 8.625
+MOUSE 3 10.125 8.562
+MOUSE 3 10.125 8.500
+MOUSE 4 10.125 8.500
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmruler.xtr b/app/lib/demos/dmruler.xtr
new file mode 100644
index 0000000..7c24ef9
--- /dev/null
+++ b/app/lib/demos/dmruler.xtr
@@ -0,0 +1,46 @@
+VERSION 2
+DEMOINIT
+ORIG 5.000 5.000 0.000
+STRAIGHT 1 DEMO 1
+ E 5.916667 3.166667 270.000000
+ E 29.166667 3.166667 90.000000
+ END
+STRAIGHT 2 DEMO 1
+ E 6.000000 6.916667 270.000000
+ E 29.166667 6.916667 90.000000
+ END
+REDRAW
+RESET
+MESSAGE
+The <Ruler> command draws a Ruler on the layout you can use to measure distances.
+
+END
+STEP
+COMMAND Ruler
+MOUSE 2 29.000 6.917
+MOUSE 3 29.083 3.167
+BIGPAUSE
+MOUSE 4 29.083 3.167
+MESSAGE
+_________________________________________
+
+If you press the <Ruler> command again the Ruler is removed.
+END
+BIGPAUSE
+COMMAND Ruler
+BIGPAUSE
+MESSAGE
+_________________________________________
+
+But you can place it somewhere else.
+END
+BIGPAUSE
+MOUSE 2 6.000 5.583
+MOUSE 3 29.250 5.750
+BIGPAUSE
+MOUSE 4 29.250 5.750
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmselect.xtr b/app/lib/demos/dmselect.xtr
new file mode 100644
index 0000000..99fecc3
--- /dev/null
+++ b/app/lib/demos/dmselect.xtr
@@ -0,0 +1,412 @@
+VERSION 2
+DEMOINIT
+ORIG 8.000 0.000 0.000
+PARAMETER pref dragtimeout 2000
+STRAIGHT 1 DEMO 1
+ T 2 7.466667 2.666667 270.000000
+ T 3 8.000000 2.666667 90.000000
+ END
+CURVE 2 DEMO 1 7.466667 7.916667 5.250000
+ T 1 7.466667 2.666667 90.000000
+ T 8 7.471737 13.166664 90.055338
+ END
+TURNOUT 3 DEMO 1 8.000000 2.666667 0.000000 "Peco-55 Medium Right SL-E395F"
+ T 1 8.000000 2.666667 270.000000
+ T 4 13.405000 2.666667 90.000000
+ T 5 13.370000 2.144667 99.686000
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0 0.000000 0.000000 0.353000 0.000000
+ S 0 0 0.353000 0.000000 5.405000 0.000000
+ C 0 0 23.136000 0.351000 -23.136000 0.004000 9.700000
+ S 0 0 4.251000 -0.331000 5.370000 -0.522000
+ END
+STRAIGHT 4 DEMO 1
+ T 9 22.720000 2.666667 90.000000
+ T 3 13.405000 2.666667 270.000000
+ END
+STRAIGHT 5 DEMO 1
+ T 3 13.370000 2.144667 279.686000
+ T 7 17.844750 1.380909 99.686000
+ END
+STRAIGHT 6 DEMO 1
+ E 32.964238 1.166667 90.000000
+ T 7 20.373333 1.166667 270.000000
+ END
+CURVE 7 DEMO 1 20.373333 16.195525 15.028859
+ T 6 20.373333 1.166667 90.000000
+ T 5 17.844750 1.380909 279.686000
+ END
+STRAIGHT 8 DEMO 1
+ T 2 7.471737 13.166664 270.055338
+ T 10 8.533996 13.165638 90.055338
+ END
+CURVE 9 DEMO 1 22.720000 7.909299 5.242633
+ T 11 22.720000 13.151932 270.000000
+ T 4 22.720000 2.666667 270.000000
+ END
+TURNOUT 10 DEMO 1 8.533996 13.165638 0.055338 "Peco-55 Medium Left SL-E396F"
+ T 8 8.533996 13.165638 270.055338
+ T 11 13.938993 13.160418 90.055338
+ T 12 13.904497 13.682451 80.369338
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0 0.000000 0.000000 0.353000 0.000000
+ S 0 0 0.353000 0.000000 5.405000 0.000000
+ C 0 0 -23.136000 0.351000 23.136000 170.297000 9.700000
+ S 0 0 4.251000 0.331000 5.370000 0.522000
+ END
+STRAIGHT 11 DEMO 1
+ T 9 22.720000 13.151932 90.055357
+ T 10 13.938993 13.160416 270.055357
+ END
+STRAIGHT 12 DEMO 1
+ T 10 13.904497 13.682451 260.369338
+ T 13 15.746779 13.995064 80.369338
+ END
+TURNOUT 13 DEMO 1 15.746779 13.995064 350.369338 "Peco-55 Medium Right SL-E395F"
+ T 12 15.746779 13.995064 260.369338
+ T 14 21.075605 14.899301 80.369338
+ T 15 21.128427 14.378802 90.055338
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0 0.000000 0.000000 0.353000 0.000000
+ S 0 0 0.353000 0.000000 5.405000 0.000000
+ C 0 0 23.136000 0.351000 -23.136000 0.004000 9.700000
+ S 0 0 4.251000 -0.331000 5.370000 -0.522000
+ END
+STRAIGHT 14 DEMO 1
+ T 17 26.016207 15.737661 80.369338
+ T 13 21.075605 14.899301 260.369338
+ END
+STRAIGHT 15 DEMO 1
+ T 13 21.128427 14.378802 270.055338
+ E 35.757013 14.364673 90.055338
+ END
+STRAIGHT 16 DEMO 1
+ T 17 27.626441 15.872527 270.055338
+ E 35.735615 15.864695 90.055338
+ END
+CURVE 17 DEMO 1 27.617198 6.302742 9.569789
+ T 14 26.016207 15.737661 260.369338
+ T 16 27.626441 15.872527 90.055338
+ END
+STRUCTURE 18 N 1 29.120000 8.853333 0.000000 "Walthers 933-3212 Red Wing Milling Co"
+ L 0 0 4.500000 0.000000 4.500000 0.375000
+ L 0 0 6.625000 0.375000 4.500000 0.375000
+ L 0 0 6.625000 4.875000 2.062500 4.875000
+ L 0 0 2.062500 4.875000 2.062500 4.500000
+ L 0 0 2.062500 4.437500 0.000000 4.437500
+ L 0 0 0.375000 0.750000 3.250000 0.750000
+ L 0 0 3.250000 0.750000 3.250000 1.625000
+ L 0 0 3.250000 1.625000 0.375000 1.625000
+ L 0 0 0.375000 1.625000 0.375000 0.750000
+ L 0 0 3.062500 1.437500 2.625000 1.437500
+ L 0 0 2.625000 1.437500 2.625000 1.062500
+ L 0 0 2.625000 1.062500 3.062500 1.062500
+ L 0 0 3.062500 1.062500 3.062500 1.437500
+ L 0 0 4.500000 0.000000 4.500000 -0.687500
+ L 0 0 4.500000 -0.687500 2.000000 -0.687500
+ L 0 0 2.000000 -0.687500 2.000000 0.375000
+ L 0 0 2.000000 0.375000 0.000000 0.375000
+ L 0 0 4.500000 0.375000 2.000000 0.375000
+ L 0 0 2.000000 0.000000 0.000000 0.000000
+ L 0 0 2.250000 0.375000 2.250000 -0.062500
+ L 0 0 2.250000 -0.062500 4.062500 -0.062500
+ L 0 0 4.062500 -0.062500 4.062500 0.375000
+ A 0 0 0.139754 3.187500 0.125000 0.000000 360.000000
+ A 0 0 0.139754 3.812500 0.125000 0.000000 360.000000
+ A 0 0 0.139754 2.625000 0.125000 0.000000 360.000000
+ A 0 0 0.062500 3.812500 0.125000 0.000000 360.000000
+ A 0 0 0.062500 3.187500 0.125000 0.000000 360.000000
+ A 0 0 0.000000 2.625000 0.125000 0.000000 360.000000
+ A 0 0 0.062500 2.625000 0.125000 0.000000 360.000000
+ L 0 0 6.625000 4.875000 6.625000 0.375000
+ L 0 0 2.062500 4.437500 6.625000 4.437500
+ L 0 4 2.937500 -0.062500 2.937500 -0.562500
+ L 0 4 1.312500 0.375000 1.312500 -0.062500
+ L 0 0 0.000000 4.437500 0.000000 4.437500
+ L 0 0 0.000000 4.437500 0.000000 0.000000
+ END
+DRAW 19 0.347235 -1.465099 356.869391
+ L 0 0 23.293333 3.226667 25.933333 4.400000
+ L 0 0 25.933333 4.400000 25.880000 4.746667
+ L 0 0 23.300000 3.226667 23.020000 3.466667
+ L 0 0 23.453333 1.973333 23.533333 2.346667
+ L 0 0 23.506667 2.346667 26.440000 3.440000
+ L 0 0 26.413333 3.440000 26.680000 3.146667
+ END
+DRAW 20 0.000000 0.000000 0.000000
+ L 255 0 24.026667 2.186667 24.666667 1.653333
+ L 255 0 24.666667 1.653333 25.573333 1.973333
+ L 255 0 25.573333 1.973333 26.693333 1.760000
+ L 255 0 26.693333 1.760000 27.706667 2.026667
+ L 255 0 27.706667 2.026667 28.720000 1.920000
+ L 255 0 28.720000 1.920000 29.573333 1.920000
+ L 255 0 29.573333 1.920000 29.946667 2.346667
+ L 255 0 29.946667 2.346667 30.160000 3.840000
+ L 255 0 30.160000 3.840000 29.626667 4.266667
+ L 255 0 29.626667 4.266667 28.400000 3.946667
+ L 255 0 28.400000 3.946667 28.133333 3.040000
+ L 255 0 28.133333 3.040000 27.120000 2.613333
+ L 255 0 27.120000 2.613333 26.320000 2.826667
+ L 255 0 26.320000 2.826667 25.413333 2.826667
+ L 255 0 23.653333 3.253333 23.066667 4.320000
+ L 255 0 23.066667 4.320000 22.266667 4.960000
+ L 255 0 22.266667 4.960000 20.720000 5.173333
+ L 255 0 20.720000 5.173333 19.706667 5.226667
+ L 255 0 19.706667 5.226667 18.746667 5.333333
+ L 255 0 18.746667 5.333333 18.266667 5.653333
+ L 255 0 18.266667 5.653333 17.893333 6.080000
+ L 255 0 17.893333 6.080000 18.320000 5.813333
+ L 255 0 18.320000 5.813333 19.280000 5.440000
+ L 255 0 19.280000 5.440000 20.506667 5.653333
+ L 255 0 20.506667 5.653333 22.480000 5.386667
+ L 255 0 22.480000 5.386667 23.813333 5.066667
+ L 255 0 23.813333 5.066667 24.293333 4.533333
+ L 255 0 24.293333 4.533333 24.613333 3.786667
+ END
+REDRAW
+RESET
+MESSAGE
+The <Select> command is used to select tracks.
+
+Selected tracks can be moved or rotated during the <Select> command.
+
+Selected tracks can also be deleted, hidden, listed and exported.
+END
+BIGPAUSE
+MESSAGE
+_________________________________________
+
+A single Left-Click selects tracks.
+END
+STEP
+MOUSE 2 18.347 2.773
+MOUSE 4 18.347 2.773
+MOUSE 2 27.733 6.613
+MOUSE 4 27.733 6.613
+MOUSE 2 30.720 9.920
+MOUSE 4 30.720 9.920
+MOUSE 2 12.373 13.013
+MOUSE 4 12.373 13.013
+BIGPAUSE
+MESSAGE
+_________________________________________
+
+Selecting a selected track de-selects it.
+END
+STEP
+MOUSE 2 27.840 8.213
+MOUSE 4 27.840 8.213
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
+MESSAGE
+Shift-Left-Click on a track will select all unselected tracks connected to the track. Selection stops at a previously selected track.
+END
+STEP
+KEYSTATE 2
+MOUSE 2 27.627 14.400
+KEYSTATE 2
+MOUSE 4 27.627 14.400
+MESSAGE
+_________________________________________
+
+Be careful with this because its easy to select all tracks this way.
+END
+STEP
+KEYSTATE 2
+MOUSE 2 19.840 2.560
+KEYSTATE 2
+MOUSE 4 19.840 2.560
+MESSAGE
+_________________________________________
+
+The <esc> key will deselect all objects.
+END
+STEP
+MOUSE 6920 19.840 2.560
+RESET
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
+MESSAGE
+Left-Drag is used to select all objects within an area.
+END
+STEP
+RESET
+MOUSE 2 12.907 14.293
+MOUSE 3 37.480 -1.600
+MOUSE 4 37.480 -1.600
+MESSAGE
+_________________________________________
+
+And Right-Drag de-selects all tracks within an area.
+END
+STEP
+MOUSE 5 12.480 2.453
+MOUSE 7 37.707 0.107
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
+MESSAGE
+Shift-Left-Drag is used to move selected tracks.
+
+When you move selected tracks that are connected to unselected tracks, the tracks will be disconnected. These points are marked by a Red cross on the layout.
+END
+STEP
+KEYSTATE 2
+MOUSE 2 14.827 8.960
+KEYSTATE 2
+MOUSE 3 21.653 8.640
+KEYSTATE 2
+MOUSE 4 21.653 8.640
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
+MESSAGE
+Drawing the tracks while moving can be very time-consuming. We had just used the "Normal" method of drawing tracks.
+
+The Command Options dialog (from the Options menu) contains a Radio button group which you can use to pick the drawing method.
+
+You can also popup the Command Options Menu by pressing Shift-Right-Click which includes options for setting the drawing method. These options are also available for the Move and Rotate Command Options Menu.
+END
+STEP
+PARAMETER misc cmdCmdopt
+MESSAGE
+_________________________________________
+
+The next method is "Simple" draws. Here tracks are drawn using one line, no End-Points are drawn, lines are not drawn and structures are drawn using a box outline.
+
+Note: you can move the Command Options dialog if it obscures the main window.
+END
+STEP
+PARAMETER cmdopt move-quick 1
+BIGPAUSE
+KEYSTATE 2
+MOUSE 2 24.533 2.027
+KEYSTATE 2
+MOUSE 3 20.267 2.453
+KEYSTATE 2
+MOUSE 4 20.267 2.453
+MESSAGE
+_________________________________________
+
+The next method is to just draw the End-Points of the selected tracks.
+
+Unconnected End-Points are indicated by Red crosses, and connected End-Points are indicated by Red lines.
+END
+STEP
+PARAMETER cmdopt move-quick 2
+BIGPAUSE
+KEYSTATE 2
+MOUSE 2 17.493 0.427
+KEYSTATE 2
+MOUSE 3 17.493 3.427
+KEYSTATE 2
+MOUSE 4 15.787 1.600
+MESSAGE
+_________________________________________
+
+Now we will go back to using the Normal method again.
+END
+STEP
+PARAMETER cmdopt move-quick 0
+BIGPAUSE
+PARAMETER cmdopt ok
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
+MESSAGE
+Shift-Right-Drag rotates the selected tracks about the pivot point (which is where you started the drag)
+END
+STEP
+KEYSTATE 2
+MOUSE 5 25.280 9.387
+PAUSE 200
+KEYSTATE 2
+MOUSE 6 24.960 9.387
+PAUSE 200
+KEYSTATE 2
+MOUSE 6 24.960 9.813
+PAUSE 200
+KEYSTATE 2
+MOUSE 6 25.067 10.240
+KEYSTATE 2
+MOUSE 6 25.173 10.453
+KEYSTATE 2
+MOUSE 6 25.280 10.773
+KEYSTATE 2
+MOUSE 6 25.387 11.093
+KEYSTATE 2
+MOUSE 6 25.493 11.520
+KEYSTATE 2
+MOUSE 6 25.813 11.947
+KEYSTATE 2
+MOUSE 6 26.133 12.480
+KEYSTATE 2
+MOUSE 6 26.453 12.800
+KEYSTATE 2
+MOUSE 6 26.987 12.907
+KEYSTATE 2
+MOUSE 6 27.627 13.227
+KEYSTATE 2
+MOUSE 6 28.053 13.227
+KEYSTATE 2
+MOUSE 6 28.267 13.227
+KEYSTATE 2
+MOUSE 6 28.480 13.227
+KEYSTATE 2
+MOUSE 6 28.267 13.227
+KEYSTATE 2
+MOUSE 6 28.373 13.227
+KEYSTATE 2
+MOUSE 7 28.373 13.227
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
+MESSAGE
+Next we select the <Join Tracks> command. You can use Shift-Left-Click to move an End-Point of a selected track to join with an unselected track.
+
+Note: because of differing display resolutions the next mouse click may not be positioned correctly in this demo and the Move-To-Join operation may not be demonstrated.
+END
+STEP
+COMMAND Join
+BIGPAUSE
+#MOUSE 5 14.40 12.37
+#MOUSE 7 14.40 12.37
+#MOUSE 5 14.40 14.61
+#MOUSE 7 14.40 14.61
+#MOUSE 5 13.90 14.287
+#MOUSE 7 13.90 14.287
+#MOUSE 5 14.21 13.95
+#MOUSE 7 14.21 13.95
+KEYSTATE 2
+MOUSE 2 13.077 10.857
+#MOUSE 2 16.39 14.51
+KEYSTATE 2
+MOUSE 4 13.077 10.857
+#MOUSE 4 16.39 14.51
+BIGPAUSE
+KEYSTATE 2
+MOUSE 2 13.333 2.773
+KEYSTATE 2
+MOUSE 4 13.333 2.773
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmsplit.xtr b/app/lib/demos/dmsplit.xtr
new file mode 100644
index 0000000..52ce3f6
--- /dev/null
+++ b/app/lib/demos/dmsplit.xtr
@@ -0,0 +1,100 @@
+VERSION 2
+DEMOINIT
+ORIG 6.000 6.000 1.000
+REDRAW
+STRAIGHT 1 DEMO 1
+ E 2.466667 2.633333 270.000000
+ T 2 17.550000 2.633353 90.000000
+ END
+TURNOUT 2 DEMO 1 17.550000 2.633353 0.000000 "Peco-55 Medium Left SL-E396F"
+ T 1 17.550000 2.633353 270.000000
+ T 3 22.955000 2.633353 90.000000
+ T 4 22.920000 3.155353 80.314000
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0 0.000000 0.000000 0.353000 0.000000
+ S 0 0 0.353000 0.000000 5.405000 0.000000
+ C 0 0 -23.136000 0.351000 23.136000 170.297000 9.700000
+ S 0 0 4.251000 0.331000 5.370000 0.522000
+ END
+STRAIGHT 3 DEMO 1
+ E 40.800000 2.633333 90.000125
+ T 2 22.955000 2.633349 270.000125
+ END
+CURVE 4 DEMO 1 20.249057 18.804049 15.875000
+ E 34.679895 12.188421 24.628563
+ T 2 22.920000 3.155353 260.314152
+ END
+REDRAW
+RESET
+MESSAGE
+The <Split> command is used to split and disconnect tracks.
+END
+STEP
+COMMAND SplitTrack
+MESSAGE
+_________________________________________
+
+Simply select the spot on the track you want to split.
+
+You cannot split turnouts (unless you hold down the Shift key).
+END
+BIGPAUSE
+MOUSE 2 10.000 2.750
+MOUSE 4 10.000 2.750
+MOUSE 2 30.917 7.250
+MOUSE 4 30.917 7.250
+MOUSE 1 31 5
+MESSAGE
+_________________________________________
+
+If you split at spot that is already an End-Point between two tracks, or split twice at the same spot, the track is disconnected.
+END
+STEP
+MOUSE 2 33.417 2.667
+MOUSE 4 33.417 2.667
+BIGPAUSE
+MOUSE 2 33.417 2.250
+MOUSE 4 33.417 2.250
+MOUSE 1 36 1
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
+MESSAGE
+The <Tunnel> command marks selected tracks as hidden.
+
+A tunnel portal is drawn at the boundary between hidden and normal track.
+
+How the hidden tracks are drawn (solid, dashed or invisible) is controlled by the Draw EndPts radio button group on the Setup dialog.
+END
+STEP
+COMMAND Select
+MOUSE 2 27.333 4.750
+MOUSE 4 27.333 4.750
+MOUSE 2 21.333 3.000
+MOUSE 4 21.333 3.000
+MOUSE 2 16.250 2.667
+MOUSE 4 16.250 2.667
+BIGPAUSE
+PARAMETER misc cmdTunnel
+MESSAGE
+_________________________________________
+
+To 'un-hide' a track just Select it again and click the Tunnel button.
+END
+STEP
+MOUSE 6920 16.250 2.667
+BIGPAUSE
+MOUSE 2 16.250 2.667
+MOUSE 4 16.250 2.667
+BIGPAUSE
+PARAMETER misc cmdTunnel
+BIGPAUSE
+MOUSE 6920 16.250 2.667
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmstrtrk.xtr b/app/lib/demos/dmstrtrk.xtr
new file mode 100644
index 0000000..a37b90c
--- /dev/null
+++ b/app/lib/demos/dmstrtrk.xtr
@@ -0,0 +1,31 @@
+VERSION 2
+DEMOINIT
+ORIG 8.000 0.000 0.000
+REDRAW
+RESET
+MESSAGE
+Straight tracks are created by selecting the first End-Point of the track.
+END
+STEP
+COMMAND Straight
+MOUSE 2 6.833 3.667
+MESSAGE
+_________________________________________
+
+Then the other End-Point is dragged to its final postion.
+END
+PAUSE 2000
+MOUSE 3 6.833 3.750
+MOUSE 3 36.000 9.667
+MESSAGE
+_________________________________________
+
+The left mouse button is released at the final end postion.
+END
+BIGPAUSE
+MOUSE 4 36.000 9.667
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmtbledg.xtr b/app/lib/demos/dmtbledg.xtr
new file mode 100644
index 0000000..d2caf81
--- /dev/null
+++ b/app/lib/demos/dmtbledg.xtr
@@ -0,0 +1,213 @@
+VERSION 7
+DEMOINIT
+ORIG 10.000 0.000 0.000
+PARAMETER display description-fontsize 24
+CURVE 1 0 0 0 0 DEMO -1 12.000000 14.555556 10.000000
+ T 4 18.000000 6.555556 53.130102
+ T 3 18.207029 22.396014 128.367485
+ END
+CURVE 2 0 0 0 0 DEMO -1 44.666667 14.333333 10.000000
+ T 4 38.666667 22.333333 233.130102
+ T 3 38.459637 6.492875 308.367485
+ END
+STRAIGHT 3 0 0 0 0 DEMO -1
+ T 1 18.207029 22.396014 308.140387
+ T 2 38.459637 6.492875 128.140387
+ END
+STRAIGHT 4 0 0 0 0 DEMO -1
+ T 1 18.000000 6.555556 232.640407
+ T 2 38.666667 22.333333 52.640407
+ END
+REDRAW
+RESET
+MESSAGE
+Table Edges are used to mark the edges of the layout, either for aisles or room walls.
+END
+STEP
+COMMAND DrawTableEdge
+MOUSE 2 0.000 2.667
+MOUSE 3 19.833 2.667
+MOUSE 4 19.833 2.667
+MOUSE 2 19.333 2.667
+MOUSE 3 28.167 9.500
+MOUSE 4 28.167 9.500
+MOUSE 2 28.167 9.333
+MOUSE 3 36.500 2.667
+MOUSE 4 36.500 2.667
+MOUSE 2 36.500 2.667
+MOUSE 3 58.000 2.667
+MOUSE 4 58.000 2.667
+BIGPAUSE
+MOUSE 2 0.000 26.167
+MOUSE 3 58.000 26.167
+MOUSE 4 58.000 26.167
+MESSAGE
+_________________________________________
+
+A Table Edge is attracted to the ends of other Table Edges.
+END
+STEP
+MOUSE 2 58.000 26.167
+MOUSE 3 57.833 26.000
+MOUSE 3 57.833 25.500
+MOUSE 3 58.167 24.167
+MOUSE 3 58.500 22.833
+MOUSE 3 58.833 21.500
+MOUSE 3 59.167 20.167
+MOUSE 3 59.167 18.833
+MOUSE 3 59.167 18.333
+MOUSE 3 59.167 17.833
+MOUSE 3 59.167 17.333
+MOUSE 3 59.167 16.833
+MOUSE 3 59.167 15.500
+MOUSE 3 59.167 13.833
+MOUSE 3 59.167 12.500
+MOUSE 3 58.833 11.167
+MOUSE 3 58.500 10.167
+MOUSE 3 58.167 9.167
+MOUSE 3 58.000 8.833
+MOUSE 3 58.000 8.500
+MOUSE 3 58.000 8.167
+MOUSE 3 57.833 7.833
+MOUSE 3 57.833 7.500
+MOUSE 3 57.833 7.333
+MOUSE 3 57.833 7.167
+MOUSE 3 57.833 6.833
+MOUSE 3 57.833 6.500
+MOUSE 3 57.833 6.167
+MOUSE 3 57.833 5.833
+MOUSE 3 57.833 5.500
+MOUSE 3 57.833 5.333
+MOUSE 3 57.833 5.167
+MOUSE 3 57.833 5.000
+MOUSE 3 57.833 4.833
+MOUSE 3 57.667 4.667
+MOUSE 3 57.667 4.500
+MOUSE 3 57.667 4.167
+MOUSE 3 57.667 3.833
+MOUSE 3 57.833 3.667
+MOUSE 3 57.833 3.500
+MOUSE 3 57.833 3.333
+MOUSE 3 57.833 3.167
+MOUSE 3 57.833 2.833
+MOUSE 3 57.667 2.667
+MOUSE 3 57.667 2.500
+MOUSE 3 57.500 2.500
+MOUSE 3 57.333 2.333
+MOUSE 3 57.167 2.167
+MOUSE 3 57.000 2.167
+MOUSE 3 56.833 2.167
+MOUSE 3 56.667 2.000
+MOUSE 3 56.500 1.833
+MOUSE 3 56.167 1.833
+MOUSE 3 56.000 1.667
+MOUSE 3 56.167 1.833
+MOUSE 3 56.500 1.833
+MOUSE 3 56.667 2.000
+MOUSE 3 56.833 2.167
+MOUSE 3 57.000 2.167
+MOUSE 3 57.167 2.167
+MOUSE 3 57.500 2.000
+MOUSE 3 57.667 2.000
+MOUSE 3 57.833 1.833
+MOUSE 3 58.000 1.833
+MOUSE 3 58.333 1.833
+BIGPAUSE
+MOUSE 3 58.333 1.667
+MOUSE 3 58.500 1.667
+MOUSE 3 58.667 1.667
+MOUSE 3 58.667 1.500
+MOUSE 3 58.833 1.500
+MOUSE 3 58.667 1.500
+MOUSE 3 58.500 1.500
+MOUSE 3 58.167 1.667
+MOUSE 3 58.167 1.833
+MOUSE 3 58.000 1.833
+MOUSE 3 57.833 1.833
+MOUSE 3 57.667 1.833
+MOUSE 4 57.667 1.833
+MESSAGE
+_________________________________________
+
+Table Edges can be modified by dragging on their ends.
+
+END
+STEP
+COMMAND Modify
+MOUSE 2 27.667 9.333
+MOUSE 3 28.333 8.667
+MOUSE 3 29.000 8.000
+MOUSE 3 29.167 7.667
+MOUSE 3 29.167 7.333
+MOUSE 3 29.167 6.000
+MOUSE 3 28.833 5.000
+MOUSE 3 28.833 4.833
+MOUSE 3 28.667 4.500
+MOUSE 3 28.000 3.500
+MOUSE 3 28.000 3.167
+MOUSE 3 28.000 3.000
+MOUSE 3 28.000 2.833
+MOUSE 3 28.000 2.667
+MOUSE 3 27.833 2.500
+MOUSE 3 27.833 2.333
+MOUSE 3 27.833 2.167
+MOUSE 3 27.833 2.000
+MOUSE 3 27.833 1.833
+MOUSE 3 27.833 1.667
+MOUSE 3 27.667 1.833
+MOUSE 3 27.667 2.167
+MOUSE 3 28.333 2.833
+MOUSE 3 28.500 3.167
+MOUSE 3 28.667 3.500
+MOUSE 3 28.833 3.833
+MOUSE 3 29.000 4.167
+MOUSE 3 29.000 4.333
+MOUSE 3 28.833 4.667
+MOUSE 3 28.667 4.833
+MOUSE 3 28.500 5.000
+MOUSE 3 28.333 5.333
+MOUSE 3 28.333 5.500
+MOUSE 3 28.333 5.667
+MOUSE 3 28.333 5.833
+MOUSE 3 28.333 6.000
+MOUSE 4 28.333 6.000
+MESSAGE
+_________________________________________
+
+If you hold down the Control key while dragging then the Table Edge will be attracted to other objects.
+END
+STEP
+KEYSTATE 4
+MOUSE 2 28.167 9.333
+KEYSTATE 4
+MOUSE 3 28.167 9.000
+KEYSTATE 4
+MOUSE 3 28.167 8.667
+KEYSTATE 4
+MOUSE 3 28.500 7.667
+KEYSTATE 4
+MOUSE 3 28.500 7.500
+KEYSTATE 4
+MOUSE 3 28.500 7.167
+KEYSTATE 4
+MOUSE 3 28.500 6.833
+KEYSTATE 4
+MOUSE 3 28.500 6.667
+KEYSTATE 4
+MOUSE 3 28.500 6.500
+KEYSTATE 4
+MOUSE 3 28.500 6.333
+KEYSTATE 4
+MOUSE 3 28.500 6.167
+KEYSTATE 4
+MOUSE 3 28.333 6.167
+KEYSTATE 4
+MOUSE 3 28.333 6.000
+KEYSTATE 4
+MOUSE 4 28.167 5.667
+STEP
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmtodes.xtr b/app/lib/demos/dmtodes.xtr
new file mode 100644
index 0000000..1119654
--- /dev/null
+++ b/app/lib/demos/dmtodes.xtr
@@ -0,0 +1,52 @@
+VERSION 2
+DEMOINIT
+ORIG 8.000 0.000 0.000
+REDRAW
+RESET
+MESSAGE
+These examples shows some of the various Turnout Designer windows. Each window defines a different type of turnout.
+
+In each window there are a number of parameters to fill in and one or two description lines.
+
+You can print the design to check the dimensions before saving them.
+END
+STEP
+CTURNOUT DESIGNER SHOW Regular Turnout
+#PARAMETER turnoutNew anglemode 0
+MESSAGE
+_________________________________________
+
+This is the regular turnout.
+
+In addition to the dimensions, you also enter the Title (Manufacturer, Description and Part Number). For Turnouts with Left and Right hand versions there are separate Descriptions and Part Numbers.
+
+Some Turnouts and Sectional track are pre-mounted on roadbed. For these parts you can specify the width of the roadbed, the thickness of the lines drawn for the edge of the roadbed and the color.
+END
+STEP
+#CTURNOUT DESIGNER HIDE Regular Turnout
+PARAMETER turnoutNew cancel
+CTURNOUT DESIGNER SHOW Double Slipswitch
+#PARAMETER turnoutNew anglemode 0
+MESSAGE
+_________________________________________
+
+The double slip switch is described by only a few parameters.
+END
+STEP
+#CTURNOUT DESIGNER HIDE Double Slipswitch
+PARAMETER turnoutNew cancel
+CTURNOUT DESIGNER SHOW Double Crossover
+#PARAMETER turnoutNew anglemode 0
+MESSAGE
+_________________________________________
+
+The double crossover only needs length and track separation.
+END
+STEP
+#CTURNOUT DESIGNER HIDE Double Crossover
+PARAMETER turnoutNew cancel
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmtosel.xtr b/app/lib/demos/dmtosel.xtr
new file mode 100644
index 0000000..953d43b
--- /dev/null
+++ b/app/lib/demos/dmtosel.xtr
@@ -0,0 +1,283 @@
+VERSION 2
+DEMOINIT
+ORIG 8.000 0.000 0.000
+PARAMETER turnout hide 1
+STRAIGHT 1 DEMO 1
+ E 2.050000 1.050000 270.000000
+ T 3 14.883333 1.050017 90.000000
+ END
+CURVE 2 DEMO 1 20.993080 13.050025 12.000000
+ E 32.991545 13.241946 359.083680
+ T 4 20.993048 1.050025 270.000000
+ END
+TURNOUT 3 DEMO 1 14.883333 1.050017 0.000000 "Peco-55 Medium Left SL-E396F"
+ T 1 14.883333 1.050017 270.000000
+ T 4 20.288333 1.050017 90.000000
+ E 20.253333 1.572017 80.314000
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0 0.000000 0.000000 0.353000 0.000000
+ S 0 0 0.353000 0.000000 5.405000 0.000000
+ C 0 0 -23.136000 0.351000 23.136000 170.297000 9.700000
+ S 0 0 4.251000 0.331000 5.370000 0.522000
+ END
+STRAIGHT 4 DEMO 1
+ T 2 20.993080 1.050025 90.000000
+ T 3 20.288333 1.050024 270.000000
+ END
+REDRAW
+RESET
+MESSAGE
+Pressing the turnout button displays the Turnout Selection window to let you choose a turnout to place.
+
+Note that once you start to place the turnout on the Main window the Turnout Selection window disappears. This feature is enabled by the Hide toggle button on the dialog.
+END
+STEP
+COMMAND Turnout
+MOUSE 2 5.750 6.583
+MESSAGE
+_________________________________________
+
+You can place the turnout on a arbitrary position on the layout. Left-drag the turnout into place...
+END
+STEP
+MOUSE 3 5.833 6.583
+PAUSE 110
+MOUSE 3 6.333 6.583
+PAUSE 110
+MOUSE 3 6.750 6.583
+PAUSE 270
+MOUSE 3 6.833 6.583
+PAUSE 60
+MOUSE 3 7.417 6.583
+PAUSE 110
+MOUSE 3 7.917 6.667
+PAUSE 100
+MOUSE 3 8.333 6.750
+PAUSE 110
+MOUSE 3 8.750 6.917
+PAUSE 110
+MOUSE 3 9.250 6.917
+PAUSE 110
+MOUSE 3 9.750 6.917
+PAUSE 160
+MOUSE 3 10.250 6.917
+PAUSE 60
+MOUSE 3 10.667 6.917
+PAUSE 110
+MOUSE 3 10.917 7.083
+PAUSE 100
+MOUSE 3 11.417 7.250
+PAUSE 110
+MOUSE 3 11.917 7.583
+PAUSE 100
+MOUSE 3 12.250 7.917
+PAUSE 110
+MOUSE 3 12.583 8.083
+PAUSE 110
+MOUSE 3 12.917 8.250
+PAUSE 110
+MOUSE 3 13.167 8.417
+PAUSE 110
+MOUSE 3 13.250 8.417
+MOUSE 4 13.250 8.417
+BIGPAUSE
+MESSAGE
+_________________________________________
+
+Then you can rotate the turnout by Right dragging.
+
+You can also use Shift-Right-Click to display a popup menu that lets you rotate the Turnout by specific angles.
+END
+STEP
+MOUSE 5 13.250 8.500
+PAUSE 390
+MOUSE 6 13.250 8.583
+PAUSE 110
+MOUSE 6 13.250 8.750
+PAUSE 110
+MOUSE 6 13.250 8.917
+PAUSE 110
+MOUSE 6 13.417 9.250
+PAUSE 100
+MOUSE 6 13.417 9.333
+PAUSE 170
+MOUSE 6 13.583 9.750
+PAUSE 110
+MOUSE 6 13.667 9.917
+PAUSE 160
+MOUSE 6 13.750 10.167
+PAUSE 170
+MOUSE 6 13.750 10.583
+PAUSE 160
+MOUSE 6 13.667 10.583
+PAUSE 100
+MOUSE 6 13.417 10.750
+PAUSE 110
+MOUSE 6 13.000 10.917
+PAUSE 160
+MOUSE 6 11.667 11.250
+PAUSE 160
+MOUSE 6 11.500 11.250
+PAUSE 170
+MOUSE 6 11.333 11.083
+PAUSE 110
+MOUSE 6 11.167 11.083
+PAUSE 160
+MOUSE 6 11.000 10.917
+PAUSE 100
+MOUSE 6 10.667 10.583
+PAUSE 160
+MOUSE 6 10.667 10.417
+PAUSE 170
+MOUSE 6 10.500 10.250
+MOUSE 7 10.500 10.250
+MESSAGE
+_________________________________________
+
+When you are satisfied with the position and orientation of the turnout press Space bar or the Return key on the keyboard to finish placing the turnout.
+
+Pressing the Ok button on the Turnout dialog will end the <Turnout> command as well as placing the turnout.
+END
+STEP
+MOUSE 3336 10.500 10.250
+#PARAMETER turnout ok
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
+MESSAGE
+If you drag along an existing track the new turnout will be attached to the track.
+
+Note that the status line tells you the number of End-Points that would be connected and, the maximum displacement of the End-Points. This will be useful when building complex track, as we will see later.
+END
+STEP
+MOUSE 2 4.667 1.083
+MOUSE 3 4.750 1.083
+PAUSE 110
+MOUSE 3 5.250 1.083
+PAUSE 110
+MOUSE 3 5.333 1.083
+PAUSE 170
+MOUSE 3 5.417 1.083
+PAUSE 160
+MOUSE 3 8.417 0.917
+PAUSE 100
+MOUSE 3 9.083 0.833
+PAUSE 110
+MOUSE 3 9.250 0.833
+PAUSE 490
+MOUSE 3 9.333 0.833
+PAUSE 110
+MOUSE 3 9.917 0.833
+PAUSE 100
+MOUSE 3 10.000 0.833
+PAUSE 170
+MOUSE 3 10.500 0.833
+PAUSE 1420
+MOUSE 3 10.583 0.833
+PAUSE 170
+MESSAGE
+_________________________________________
+
+By moving the cursor from one side to the other of the track centerline you can flip the turnout 180°.
+END
+STEP
+MOUSE 3 10.667 1.333
+BIGPAUSE
+MOUSE 3 10.667 0.833
+BIGPAUSE
+MOUSE 3 10.667 1.333
+BIGPAUSE
+MOUSE 3 10.667 0.833
+BIGPAUSE
+MOUSE 3 14.500 0.833
+PAUSE 110
+MESSAGE
+_________________________________________
+
+If you try to drag across another turnout the new turnout will placed at the nearest End-Point of the existing turnout.
+END
+STEP
+#ORIG 2.000 14.0 0.0
+MOUSE 3 15.333 0.950
+BIGPAUSE
+MOUSE 3 16.083 0.950
+BIGPAUSE
+MOUSE 3 16.750 0.950
+BIGPAUSE
+MOUSE 3 17.667 0.950
+BIGPAUSE
+MOUSE 3 18.750 0.950
+BIGPAUSE
+MOUSE 3 19.583 0.950
+#ORIG 8.000 0.000 0.000
+MOUSE 3 20.833 0.950
+PAUSE 110
+MOUSE 3 21.250 0.950
+PAUSE 170
+MOUSE 3 22.000 0.950
+PAUSE 100
+MOUSE 3 22.333 0.950
+PAUSE 220
+MOUSE 3 22.917 1.000
+PAUSE 170
+MOUSE 3 23.333 1.167
+PAUSE 160
+MOUSE 3 23.833 1.333
+PAUSE 170
+MOUSE 3 24.333 1.500
+PAUSE 160
+MOUSE 3 24.750 1.667
+PAUSE 100
+MOUSE 3 25.083 1.833
+PAUSE 170
+MOUSE 3 25.667 2.000
+PAUSE 220
+MOUSE 3 26.000 2.167
+PAUSE 160
+MOUSE 3 26.167 2.167
+PAUSE 160
+MOUSE 3 26.500 2.333
+PAUSE 100
+MOUSE 3 26.917 2.500
+PAUSE 220
+MOUSE 3 27.417 2.667
+PAUSE 160
+MOUSE 3 27.917 3.000
+PAUSE 170
+MOUSE 3 28.500 3.333
+PAUSE 160
+MOUSE 3 29.167 3.833
+PAUSE 100
+MOUSE 3 30.000 4.333
+PAUSE 170
+MOUSE 3 30.667 4.833
+PAUSE 160
+MOUSE 3 31.083 5.167
+MOUSE 4 31.667 5.833
+MESSAGE
+_________________________________________
+
+When you press Space or Return while the turnout is on a track, the track will be split and the new turnout attached automatically.
+END
+BIGPAUSE
+#PARAMETER turnout ok
+MOUSE 3336 10.500 10.250
+MESSAGE
+=========================================
+END
+BIGPAUSE
+CLEAR
+MESSAGE
+
+Pressing Close ends the <Turnout> command.
+END
+STEP
+PARAMETER turnout ok
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmtotrim.xtr b/app/lib/demos/dmtotrim.xtr
new file mode 100644
index 0000000..6ec656f
--- /dev/null
+++ b/app/lib/demos/dmtotrim.xtr
@@ -0,0 +1,96 @@
+# XTrkCad Version: 3.0.1, Date: Sat Sep 23 14:10:40 2000
+
+VERSION 10
+DEMOINIT
+ORIG 1.000 0.000 0.000
+PARAMETER display labelenable 4
+TURNOUT 2 0 0 0 0 N 2 0.218750 1.390625 0 0.000000 "Peco-55 Medium Left SL-E396F"
+ E 0.218750 1.390625 270.000000
+ E 5.623750 1.390625 90.000000
+ E 5.588750 1.912625 80.314000
+ D -0.015000 -1.136000
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0.000000 0.000000 0.000000 0.353000 0.000000
+ S 0 0.000000 0.353000 0.000000 5.405000 0.000000
+ C 0 0.000000 -23.136000 0.351000 23.136000 170.297000 9.700000
+ S 0 0.000000 4.251000 0.331000 5.370000 0.522000
+ END
+REDRAW
+RESET
+MESSAGE
+Sometimes it's useful to modify turnouts triming one of the ends.
+
+We use the <Split> command for this.
+END
+STEP
+COMMAND SplitTrack
+MESSAGE
+_________________________________________
+
+Normally, if we try to Split a turnout we get an error message.
+END
+STEP
+MOUSE 2 4.922 1.406
+MOUSE 4 4.922 1.406
+RESET
+MESSAGE
+_________________________________________
+
+Hold down the Shift key and try again.
+END
+STEP
+COMMAND SplitTrack
+#KEYSTATE 2
+#MOUSE 2 4.906 1.391
+#KEYSTATE 2
+#MOUSE 4 4.906 1.391
+KEYSTATE 2
+MOUSE 2 5.094 1.375
+KEYSTATE 2
+MOUSE 4 5.094 1.375
+MESSAGE
+_________________________________________
+
+The end of the turnout has been replaced by a piece of straight flex track which we can modify.
+END
+STEP
+COMMAND Modify
+KEYSTATE 2
+MOUSE 2 5.562 1.344
+KEYSTATE 2
+MOUSE 4 5.938 1.359
+MESSAGE
+_________________________________________
+
+We can try splitting the diverging leg.
+END
+STEP
+COMMAND SplitTrack
+KEYSTATE 2
+MOUSE 2 3.453 1.672
+KEYSTATE 2
+MOUSE 4 3.453 1.672
+MESSAGE
+_________________________________________
+
+Notice that the tail of the diverging leg has been changed to a curved track...
+END
+STEP
+COMMAND Describe
+MOUSE 2 4.078 1.672
+MOUSE 4 4.078 1.672
+STEP
+MESSAGE
+and a straight track.
+END
+STEP
+MOUSE 2 5.453 1.875
+MOUSE 4 5.453 1.875
+#DESCRIBE OK
+PARAMETER describe ok
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmtoyard.xtr b/app/lib/demos/dmtoyard.xtr
new file mode 100644
index 0000000..a6d3de0
--- /dev/null
+++ b/app/lib/demos/dmtoyard.xtr
@@ -0,0 +1,204 @@
+VERSION 2
+DEMOINIT
+ORIG 8.000 0.000 0.000
+PARAMETER display description-fontsize 24
+PARAMETER turnout hide 1
+STRAIGHT 1 DEMO 1
+ E 3.666667 1.833333 270.000000
+ E 41.833333 1.833333 90.000000
+ END
+REDRAW
+RESET
+MESSAGE
+This example show how to layout a yard using the <Turnout> and <Parallel> commands.
+END
+STEP
+COMMAND Turnout
+MESSAGE
+_________________________________________
+
+You can resize and move the Turnout Selection dialog if it obscures the other windows.
+
+First we place a turnout on the main line.
+END
+STEP
+PARAMETER turnout list 0 Peco-55 SL-E395F Medium Right
+MOUSE 2 35.417 1.917
+BIGPAUSE
+MOUSE 3 36.417 1.917
+BIGPAUSE
+MOUSE 4 36.417 1.917
+PARAMETER turnout ok
+RESET
+MESSAGE
+_________________________________________
+
+Next extend the turnout with the <Modify> command.
+END
+STEP
+COMMAND Modify
+MOUSE 2 31.167 2.417
+MOUSE 3 8.167 5.833
+BIGPAUSE
+MOUSE 4 8.167 5.833
+MESSAGE
+_________________________________________
+
+Now create a track parallel to the main line. Make sure the separation is reasonable for your scale.
+END
+STEP
+COMMAND Parallel
+PARAMETER parallel separation 1.25
+MOUSE 2 23.083 1.917
+PARAMETER parallel separation 1.250000
+MOUSE 3 23.083 1.917
+MOUSE 3 22.917 2.500
+BIGPAUSE
+MOUSE 4 22.917 2.500
+RESET
+MESSAGE
+_________________________________________
+
+And place a turnout to connect the new track.
+
+We'll zoom in here to see what's going on.
+END
+STEP
+#PAN 5 21.333 6.667
+#PAN 7 23.333 1.000
+ORIG 2.000 21.333 1.000
+BIGPAUSE
+COMMAND Turnout
+PARAMETER turnout list 0 Peco-55 SL-E396F Medium Left
+MOUSE 2 29.500 2.542
+MESSAGE
+_________________________________________
+
+Notice how we control which way the turnout is facing by moving the mouse across the center line of the track.
+
+END
+STEP
+MOUSE 3 29.500 2.563
+#MOUSE 3 29.500 2.604
+#MOUSE 3 29.521 2.604
+#MOUSE 3 29.542 2.583
+#MOUSE 3 29.542 2.521
+#MOUSE 3 29.500 2.438
+MOUSE 3 29.500 2.438
+#MOUSE 3 29.604 2.583
+BIGPAUSE
+MOUSE 3 29.625 2.667
+BIGPAUSE
+MOUSE 3 29.500 2.438
+BIGPAUSE
+MOUSE 3 29.625 2.667
+MESSAGE
+_________________________________________
+
+The Status bar displays the number of auto-connections that will be made and the maximum offset.
+
+XTrackCAD adjusts the turnout position for the best fit to minimize any connection offset
+END
+STEP
+MOUSE 4 29.625 2.667
+PARAMETER turnout ok
+#RESET
+MESSAGE
+_________________________________________
+
+Note that placing the turnout splits the parallel track.
+
+We have to delete the leftover piece by Selecting and Deleting it.
+END
+STEP
+#COMMAND Select
+MOUSE 2 30.229 3.042
+MOUSE 4 30.229 3.042
+PARAMETER misc cmdDelete
+BIGPAUSE
+ORIG 8.000 0.000 0.000
+MESSAGE
+_________________________________________
+
+Repeat the process for the other tracks in the yard.
+END
+STEP
+BIGPAUSE
+COMMAND Parallel
+PARAMETER parallel separation 1.250
+MOUSE 2 16.667 3.167
+MOUSE 3 16.417 3.583
+MOUSE 4 16.417 3.583
+RESET
+BIGPAUSE
+ORIG 2.000 16.000 2.000
+COMMAND Turnout
+PARAMETER turnout list 0 Peco-55 SL-E396F Medium Left
+MOUSE 2 22.167 3.938
+MOUSE 3 21.750 4.000
+BIGPAUSE
+MOUSE 4 21.750 4.000
+PARAMETER turnout ok
+#RESET
+#COMMAND Select
+MOUSE 2 22.688 4.438
+MOUSE 4 22.688 4.438
+PARAMETER misc cmdDelete
+BIGPAUSE
+ORIG 8.000 0.000 0.000
+MESSAGE
+_________________________________________
+
+For the last track we will join with a curve instead of a turnout.
+END
+STEP
+BIGPAUSE
+COMMAND Parallel
+PARAMETER parallel separation 1.250
+MOUSE 2 10.750 4.333
+MOUSE 3 10.750 5.000
+MOUSE 4 10.750 5.000
+RESET
+#PAN 5 11.333 5.667
+#PAN 6 12.000 5.667
+#PAN 6 12.667 5.667
+#PAN 7 12.667 6.667
+BIGPAUSE
+ORIG 2.0 5.0 4.0
+COMMAND Join
+MOUSE 2 10.354 5.604
+MOUSE 4 10.354 5.604
+MOUSE 2 12.417 5.521
+MOUSE 3 12.438 5.521
+MOUSE 3 12.458 5.521
+MOUSE 3 12.583 5.479
+MOUSE 3 12.646 5.479
+MOUSE 3 12.813 5.458
+MOUSE 3 13.021 5.438
+MOUSE 3 13.042 5.438
+MOUSE 3 13.104 5.438
+MOUSE 3 13.125 5.438
+MOUSE 3 13.146 5.438
+MOUSE 3 13.188 5.438
+MOUSE 3 13.208 5.438
+MOUSE 3 13.583 5.396
+MOUSE 3 13.604 5.396
+MOUSE 3 13.646 5.375
+MOUSE 3 13.708 5.354
+MOUSE 3 13.729 5.354
+MOUSE 3 13.750 5.354
+MOUSE 3 13.771 5.354
+MOUSE 3 13.813 5.354
+MOUSE 3 13.875 5.354
+MOUSE 3 13.875 5.333
+MOUSE 3 13.896 5.333
+MOUSE 3 13.917 5.313
+MOUSE 3 13.979 5.313
+MOUSE 4 14.000 5.313
+BIGPAUSE
+ORIG 8.000 0.000 0.000
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmtrkwid.xtr b/app/lib/demos/dmtrkwid.xtr
new file mode 100644
index 0000000..20c5261
--- /dev/null
+++ b/app/lib/demos/dmtrkwid.xtr
@@ -0,0 +1,136 @@
+# XTrkCad Version: 3.0.1, Date: Sat Sep 23 20:43:53 2000
+VERSION 10
+DEMOINIT
+ORIG 8.000 0.000 0.000
+STRAIGHT 1 0 0 0 0 N 2
+ T 3 42.054708 20.137016 244.163246
+ E 51.919948 24.913870 64.163246
+ END
+STRAIGHT 2 0 0 0 0 N 2
+ T 5 34.508258 16.482946 244.163246
+ T 3 37.189995 17.781471 64.163246
+ END
+TURNOUT 3 0 0 0 0 N 2 42.054708 20.137016 0 154.163246 "Peco-55 Medium Right SL-E395F"
+ T 1 42.054708 20.137016 64.163246
+ T 2 37.189995 17.781471 244.163246
+ T 8 36.994004 18.266545 253.849246
+ D 0.000000 0.000000
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0.000000 0.000000 0.000000 0.353000 0.000000
+ S 0 0.000000 0.353000 0.000000 5.405000 0.000000
+ C 0 0.000000 23.136000 0.351000 -23.136000 0.004000 9.700000
+ S 0 0.000000 4.251000 -0.331000 5.370000 -0.522000
+ END
+STRAIGHT 4 0 0 0 0 N 2
+ E 0.187643 -0.135457 244.163246
+ T 13 3.966453 1.694282 64.163246
+ END
+TURNOUT 5 0 0 0 0 N 2 34.508258 16.482946 0 154.163246 "Peco-55 Medium Left SL-E396F"
+ T 2 34.508258 16.482946 64.163246
+ T 12 29.643545 14.127401 244.163246
+ T 11 29.902538 13.672833 234.477246
+ D 0.000000 0.000000
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0.000000 0.000000 0.000000 0.353000 0.000000
+ S 0 0.000000 0.353000 0.000000 5.405000 0.000000
+ C 0 0.000000 -23.136000 0.351000 23.136000 170.297000 9.700000
+ S 0 0.000000 4.251000 0.331000 5.370000 0.522000
+ END
+STRAIGHT 6 0 0 0 0 N 2
+ T 14 13.474033 7.686781 244.163246
+ T 7 31.510368 16.420164 64.163246
+ END
+CURVE 7 0 0 0 0 N 2 39.096711 0.752716 0 17.407514 0 0.000000 0.000000
+ T 6 31.510368 16.420164 244.163246
+ T 8 34.254539 17.473210 73.849246
+ END
+STRAIGHT 8 0 0 0 0 N 2
+ T 3 36.994004 18.266545 73.849246
+ T 7 34.254539 17.473210 253.849246
+ END
+STRAIGHT 9 0 0 0 0 N 2
+ E 10.161432 3.305128 244.163246
+ T 10 25.105135 10.541027 64.163246
+ END
+CURVE 10 0 0 0 0 N 2 17.814223 25.598343 0 16.729620 0 0.000000 0.000000
+ T 11 27.534571 11.982359 54.477246
+ T 9 25.105135 10.541027 244.163246
+ END
+STRAIGHT 11 0 0 0 0 N 2
+ T 5 29.902538 13.672833 54.477246
+ T 10 27.534571 11.982359 234.477246
+ END
+STRAIGHT 12 0 0 0 0 N 2
+ T 5 29.643545 14.127401 64.163246
+ T 13 8.831166 4.049828 244.163246
+ END
+TURNOUT 13 0 0 0 0 N 2 3.966453 1.694282 0 334.163246 "Peco-55 Medium Left SL-E396F"
+ T 4 3.966453 1.694282 244.163246
+ T 12 8.831166 4.049828 64.163246
+ T 15 8.572172 4.504395 54.477246
+ D 0.000000 0.000000
+ P "Normal" 1 2
+ P "Reverse" 1 3 4
+ S 0 0.000000 0.000000 0.000000 0.353000 0.000000
+ S 0 0.000000 0.353000 0.000000 5.405000 0.000000
+ C 0 0.000000 -23.136000 0.351000 23.136000 170.297000 9.700000
+ S 0 0.000000 4.251000 0.331000 5.370000 0.522000
+ END
+CURVE 14 0 0 0 0 N 2 21.361899 -8.603379 0 18.099385 0 0.000000 0.000000
+ T 15 10.845682 6.127436 234.477246
+ T 6 13.474033 7.686781 64.163246
+ END
+STRAIGHT 15 0 0 0 0 N 2
+ T 13 8.572172 4.504395 234.477246
+ T 14 10.845682 6.127436 54.477246
+ END
+REDRAW
+RESET
+MESSAGE
+We can indicate the mainline by making the rails wider.
+
+First we select the mainline tracks...
+END
+STEP
+COMMAND Select
+MOUSE 2 2.500 0.125
+MOUSE 4 2.500 0.125
+MOUSE 2 6.000 3.000
+MOUSE 4 6.000 3.000
+MOUSE 2 16.750 7.625
+MOUSE 4 16.750 7.625
+MOUSE 3 32.500 15.500
+MOUSE 2 32.500 15.500
+MOUSE 4 32.500 15.500
+MOUSE 2 36.125 17.750
+MOUSE 3 36.250 17.750
+MOUSE 4 36.375 17.625
+MOUSE 2 39.500 19.125
+MOUSE 4 39.500 19.125
+MOUSE 2 47.000 22.750
+MOUSE 4 47.000 22.750
+MESSAGE
+_________________________________________
+
+And then select Medium Tracks from the Edit menu.
+END
+STEP
+PARAMETER misc cmdWidth2
+MESSAGE
+_________________________________________
+
+We can make the rail thicker by selecting Thick Tracks.
+END
+STEP
+PARAMETER misc cmdWidth3
+BIGPAUSE
+MOUSE 6920 17.188 13.938
+ORIG 4.000 13.000 6.000
+RESET
+MESSAGE
+=========================================
+END
+STEP
+CLEAR
diff --git a/app/lib/demos/dmtrntab.xtr b/app/lib/demos/dmtrntab.xtr
new file mode 100644
index 0000000..22f8d42
--- /dev/null
+++ b/app/lib/demos/dmtrntab.xtr
@@ -0,0 +1,26 @@
+VERSION 2
+DEMOINIT
+ORIG 8.000 0.000 0.000
+REDRAW
+RESET
+MESSAGE
+Turntables are created by specifying the radius in a dialog box on the Status Bar. The radius in the dialog can be changed before proceeding.
+END
+STEP
+COMMAND Turntable
+BIGPAUSE
+PARAMETER turntable diameter 7.5
+MOUSE 2 18.0 9.000
+MOUSE 3 6.0 6.0
+MESSAGE
+_________________________________________
+
+Then the turntable is dragged to its final location.
+END
+BIGPAUSE
+MOUSE 4 6.0 6.0
+MESSAGE
+=========================================
+END
+STEP
+CLEAR