next up previous
Next: More Examples Up: An MHEG Player Java Previous: MHEG Example

MHEG Example -- The Demo MHEG Presentation

The Demo example produces the output shown in Fig 8.6.

MHEG Demo application Example

As can be seen many of the key features of MHEG are illustrated in further sub-windows (click on button to move to respective window). Try these out for yourself.

The following MHEG modules are used:

startup
-- intial module
main.mhg
-- Called by startup
disp1.mhg
-- input from numeric keys 1 and 2 to tile rectangles (Fig 8.7)

MHEG Demo application Display1 Example

disp2.mhg
-- input from numeric keys 1 and 2 to tile rectangles (different display) (Fig 8.8)

MHEG Demo application Display2 Example

text.mhg
-- illustrates MHEG control of text display (Fig 8.9)

MHEG Demo application Text Example

intact.mhg
-- illustrates MHEG interactive objects (Fig 8.10)

MHEG Demo application Interactive Objects Example

bitmap1.mhg
-- illustraes MHEG display of bitmaps
bitmap2.mhg
-- illustraes MHEG display of bitmaps
ea.mhg
-- illustraes MHEG elementary actions (Fig 8.11)

MHEG Demo application Elementary Actions Example

allcl.mhg
-- MHEG conctrete classes and elementary actions (Fig 8.12)

MHEG Demo application Conctrete Classes Example

token.mhg
-- MHEG token groups example (Fig 8.13)

MHEG Demo application Token Groups Example

The MHEG code for the modules is as follows:

Startup:

{:Application  ("demo/startup" 0)
  // :OnStartUp    (:TransitionTo(("demo/main.mhg" 0)))
  :Items(
	  {:Link 1
	   :EventSource 1
	   :EventType IsRunning
	   :LinkEffect (:TransitionTo(("demo/main.mhg" 0)))
          }
	)
}

main.mhg:

{:Scene ( "demo/main.mhg" 0 )

 :Items
 (
   {:Text 100
    :OrigContent  'An application for presenting a Mheg-5-Engine'
    :OrigBoxSize 320 80
    :OrigPosition 90 10
    :FontAttributes Bold.24 :FontName Proportional
    :HJustification centre
    :TextWrapping true
   }

   {:Bitmap 101
    :OrigContent :ContentRef ( "demo/tu_klein.gif" )
	     :OrigBoxSize 51 39     // 0 0
	     :OrigPosition 10 15
	     :Tiling false
	     }

   {:Bitmap 102
    :OrigContent :ContentRef ( "demo/fsp_pv.gif")
             :OrigBoxSize 48 43
	     :OrigPosition 420 15
	     :Tiling false
	     }

   {:Bitmap 103
    :OrigContent :ContentRef ( "demo/prz.gif" )
             :OrigBoxSize 48 43
	     :OrigPosition 470 15
	     :Tiling false
	     }

   {:Link  110
    :EventSource 0
    :EventType UserInput
    :EventData 16
    :LinkEffect (
                  :Quit (( "demo/startup" 0 ))
                )
   }


   // ----------------------------------------------------------------	

   {:Text 1000
    :OrigContent  'Test the Displaystack, 1.Test:'
    :OrigBoxSize 300 30
    :OrigPosition 10 100
    :FontAttributes Bold.18 :FontName Proportional 
   }

   {:PushButton 1001
    :OrigBoxSize   85  30
    :OrigPosition 420 95 
    :ButtonRefColour gray
    :OrigLabel "Go!"
   }

   {:Link 1002
    :EventSource 1001 :EventType IsSelected
    :LinkEffect (  :TransitionTo( ( "demo/disp1.mhg" 0) )
                )
   }

   {:Link 1003
    :EventSource 1001 :EventType CursorEnter
    :LinkEffect ( :Activate(1005) )
   }
   {:Link 1004
    :EventSource 1001 :EventType CursorLeave
    :LinkEffect ( :DeActivate(1005) )
   }
   {:Link 1005
      :InitiallyActive false
      :EventSource 0
      :EventType UserInput
      :EventData 15
      :LinkEffect ( :TransitionTo( ( "demo/disp1.mhg" 0) )
		  )
   }

 
   // ----------------------------------------------------------------	

   {:Text 2000
    :OrigContent  'Test the Displaystack, 2.Test:'
    :OrigBoxSize 300 30
    :OrigPosition 10 150
    :FontAttributes Bold.18 :FontName Proportional 
   }

   {:PushButton 2001
    :OrigBoxSize   85  30
    :OrigPosition 420 145 
    :ButtonRefColour gray
    :OrigLabel "Go!"
   }

   {:Link 2002
    :EventSource 2001 :EventType IsSelected
    :LinkEffect (  :TransitionTo( ( "demo/disp2.mhg" 0) )
                )
   }


   {:Link 2003
    :EventSource 2001 :EventType CursorEnter
    :LinkEffect ( :Activate( 2005 ) )
   }
   {:Link 2004
    :EventSource 2001 :EventType CursorLeave
    :LinkEffect ( :DeActivate( 2005 ) )
   }
   {:Link 2005
      :InitiallyActive false
      :EventSource 0
      :EventType UserInput
      :EventData 15
      :LinkEffect ( :TransitionTo( ( "demo/disp2.mhg" 0) )
		  )
   }


   // ----------------------------------------------------------------	

   {:Text 3000
    :OrigContent  'Test Text features:'
    :OrigBoxSize 300 30
    :OrigPosition 10 200
    :FontAttributes Bold.18 :FontName Proportional 
   }

   {:PushButton 3001
    :OrigBoxSize   85  30
    :OrigPosition 420 195 
    :ButtonRefColour gray
    :OrigLabel "Go!"
   }

   {:Link 3002
    :EventSource 3001 :EventType IsSelected
    :LinkEffect (  :TransitionTo( ( "demo/text.mhg" 0) )
                )
   }
   {:Link 3003
    :EventSource 3001 :EventType CursorEnter
    :LinkEffect ( :Activate( 3005 ) )
   }
   {:Link 3004
    :EventSource 3001 :EventType CursorLeave
    :LinkEffect ( :DeActivate( 3005 ) )
   }
   {:Link 3005
      :InitiallyActive false
      :EventSource 0
      :EventType UserInput
      :EventData 15
      :LinkEffect ( :TransitionTo( ( "demo/text.mhg" 0) )
		  )
   }

   // ----------------------------------------------------------------	

   {:Text 4000
    :OrigContent  'Test interactible Objects:'
    :OrigBoxSize 300 30
    :OrigPosition 10 250
    :FontAttributes Bold.18 :FontName Proportional 
   }

   {:PushButton 4001
    :OrigBoxSize   85  30
    :OrigPosition 420 245 
    :ButtonRefColour gray
    :OrigLabel "Go!"
   }

   {:Link 4002
    :EventSource 4001 :EventType IsSelected
    :LinkEffect (  :TransitionTo( ( "demo/intact.mhg" 0) )
                )
   } 
   {:Link 4003
    :EventSource 4001 :EventType CursorEnter
    :LinkEffect ( :Activate( 4005 ) )
   }
   {:Link 4004
    :EventSource 4001 :EventType CursorLeave
    :LinkEffect ( :DeActivate( 4005 ) )
   }
   {:Link 4005
      :InitiallyActive false
      :EventSource 0
      :EventType UserInput
      :EventData 15
      :LinkEffect ( :TransitionTo( ( "demo/intact.mhg" 0) )
		  )
   }

  // ----------------------------------------------------------------	

   {:Text 5000
    :OrigContent  'Test Bitmaps, 1.Test:'
    :OrigBoxSize 300 30
    :OrigPosition 10 300
    :FontAttributes Bold.18 :FontName Proportional 
   }

   {:PushButton 5001
    :OrigBoxSize   85  30
    :OrigPosition 420 295 
    :ButtonRefColour gray
    :OrigLabel "Go!"
   }

   {:Link 5002
    :EventSource 5001 :EventType IsSelected
    :LinkEffect (  :TransitionTo( ( "demo/bitmap1.mhg" 0) )
                )
   }

   {:Link 5003
    :EventSource 5001 :EventType CursorEnter
    :LinkEffect ( :Activate( 5005 ) )
   }
   {:Link 5004
    :EventSource 5001 :EventType CursorLeave
    :LinkEffect ( :DeActivate( 5005 ) )
   }
   {:Link 5005
      :InitiallyActive false
      :EventSource 0
      :EventType UserInput
      :EventData 15
      :LinkEffect ( :TransitionTo( ( "demo/bitmap1.mhg" 0) )
		  )
   }



   // ----------------------------------------------------------------	

   {:Text 6000
    :OrigContent  'Test Bitmaps, 2.Test:'
    :OrigBoxSize 300 30
    :OrigPosition 10 350
    :FontAttributes Bold.18 :FontName Proportional 
   }

   {:PushButton 6001
    :OrigBoxSize   85  30
    :OrigPosition 420 345 
    :ButtonRefColour gray
    :OrigLabel "Go!"
   }

   {:Link 6002
    :EventSource 6001 :EventType IsSelected
    :LinkEffect (  :TransitionTo( ( "demo/bitmap2.mhg" 0) )
                )
   }

   {:Link 6003
    :EventSource 6001 :EventType CursorEnter
    :LinkEffect ( :Activate( 6005 ) )
   }
   {:Link 6004
    :EventSource 6001 :EventType CursorLeave
    :LinkEffect ( :DeActivate( 6005 ) )
   }
   {:Link 6005
      :InitiallyActive false
      :EventSource 0
      :EventType UserInput
      :EventData 15
      :LinkEffect ( :TransitionTo( ( "demo/bitmap2.mhg" 0) )
		  )
   }


  // ----------------------------------------------------------------	

   {:Text 7000
    :OrigContent  'Test some Elementary Actions'
    :OrigBoxSize 300 30
    :OrigPosition 10 400
    :FontAttributes Bold.18 :FontName Proportional 
   }

   {:PushButton 7001
    :OrigBoxSize   85  30
    :OrigPosition 420 395 
    :ButtonRefColour gray
    :OrigLabel "Go!"
   }

   {:Link 7002
    :EventSource 7001 :EventType IsSelected
    :LinkEffect (  :TransitionTo( ( "demo/ea.mhg" 0) )
                )
   }
   {:Link 7003
    :EventSource 7001 :EventType CursorEnter
    :LinkEffect ( :Activate( 7005 ) )
   }
   {:Link 7004
    :EventSource 7001 :EventType CursorLeave
    :LinkEffect ( :DeActivate( 7005 ) )
   }
   {:Link 7005
      :InitiallyActive false
      :EventSource 0
      :EventType UserInput
      :EventData 15
      :LinkEffect ( :TransitionTo( ( "demo/ea.mhg" 0) )
		  )
   }

   // ----------------------------------------------------------------
   {:Text 8000
    :OrigContent  'Test many Classes and Elementary Actions'
    :OrigBoxSize 400 30
    :OrigPosition 10 450
    :FontAttributes Bold.18 :FontName Proportional 
   }

   {:PushButton 8001
    :OrigBoxSize   85  30
    :OrigPosition 420 445 
    :ButtonRefColour gray
    :OrigLabel "Go!"
   }

   {:Link 8002
    :EventSource 8001 :EventType IsSelected
    :LinkEffect (  :TransitionTo( ( "demo/allcl.mhg" 0) )
                )
   }

   {:Link 8003
    :EventSource 8001 :EventType CursorEnter
    :LinkEffect ( :Activate( 8005 ) )
   }
   {:Link 8004
    :EventSource 8001 :EventType CursorLeave
    :LinkEffect ( :DeActivate( 8005 ) )
   }
   {:Link 8005
      :InitiallyActive false
      :EventSource 0
      :EventType UserInput
      :EventData 15
      :LinkEffect ( :TransitionTo( ( "demo/allcl.mhg" 0) )
		  )
   }

   // ----------------------------------------------------------------

   {:Text 9000
    :OrigContent  'Test Tokengroup'
    :OrigBoxSize 400 30
    :OrigPosition 10 500
    :FontAttributes Bold.18 :FontName Proportional 
   }

   {:PushButton 9001
    :OrigBoxSize   85  30
    :OrigPosition 420 495 
    :ButtonRefColour gray
    :OrigLabel "Go!"
   }

   {:Link 9002
    :EventSource 9001 :EventType IsSelected
    :LinkEffect (  :TransitionTo( ( "demo/token.mhg" 0) )
                )
   }
   {:Link 9003
    :EventSource 9001 :EventType CursorEnter
    :LinkEffect ( :Activate( 9005 ) )
   }
   {:Link 9004
    :EventSource 9001 :EventType CursorLeave
    :LinkEffect ( :DeActivate( 9005 ) )
   }
   {:Link 9005
      :InitiallyActive false
      :EventSource 0
      :EventType UserInput
      :EventData 15
      :LinkEffect ( :TransitionTo( ( "demo/token.mhg" 0) )
		  )
   }
       
 
 )
 :InputEventReg 1
 :SceneCS 520 550
 :MovingCursor true
}

disp1.mhg:

{:Scene ( "demo/disp1.mhg" 0 )

 :Items
 (
  {:Link  110
    :EventSource 0
    :EventType UserInput
    :EventData 16
    :LinkEffect (
                  :Quit (( "demo/startup" 0 ))
                )
   }


   {:Text 1000
    :OrigContent  'Testing the Displaystack, 1.Test:'     
    :OrigBoxSize 500 30
    :OrigPosition 90 20
    :FontAttributes Bold.24 :FontName Proportional
   }

   {:Text 1001
    :OrigContent  'key1: put the magenta rect behind the red rect
key2: put the yellow rect behind the red rect
key3: put the blue rect behind the red rect
key4: put the magenta rect before the red rect
key5: put the yellow rect before the red rect
key6: put the blue rect before the red rect.'
    :OrigBoxSize 400 200 
    :OrigPosition 250 100
    :FontAttributes Plain.18 :FontName Proportional
    :TextWrapping false	
   }

   {:Bitmap 1010
    :OrigContent :ContentRef ( "demo/tu_klein.gif" )
	     :OrigBoxSize 51 39     // 0 0
	     :OrigPosition 10 15
	     :Tiling false
	     }

   {:Bitmap 1011
    :OrigContent :ContentRef ( "demo/fsp_pv.gif")
             :OrigBoxSize 48 43
	     :OrigPosition 540 15
	     :Tiling false
	     }

   {:Bitmap 1012
    :OrigContent :ContentRef ( "demo/prz.gif" )
             :OrigBoxSize 48 43
	     :OrigPosition 590 15
	     :Tiling false
	     }



   // -----------------------------------------------------------------

   {:Rectangle 4000
    :OrigBoxSize 100 100 :OrigPosition 20 130
    :OrigLineWidth 5 :OrigLineStyle 1
    :OrigRefLineColour Red :OrigRefFillColour DarkRed
   }
   {:Rectangle 4001
    :OrigBoxSize 100 100 :OrigPosition 60 170
    :OrigLineWidth 5 :OrigLineStyle 1
    :OrigRefLineColour Blue :OrigRefFillColour DarkBlue
   }
   {:Rectangle 4002
    :OrigBoxSize 100 100 :OrigPosition 100 150
    :OrigLineWidth 5 :OrigLineStyle 1
    :OrigRefLineColour Yellow :OrigRefFillColour DarkYellow
   }
   {:Rectangle 4003
    :OrigBoxSize 100 100 :OrigPosition 70 100
    :OrigLineWidth 5 :OrigLineStyle 1
    :OrigRefLineColour Magenta :OrigRefFillColour DarkMagenta
   }

   // ----------------------------------------------------------

   {:Link 2000
    :EventSource 0 :EventType UserInput :EventData 6
    :LinkEffect ( :PutBehind ( 4003 4000 ) )
   }
   {:Link 2001
    :EventSource 0 :EventType UserInput :EventData 7
    :LinkEffect ( :PutBehind ( 4002 4000 ) )
   }
   {:Link 2002
    :EventSource 0 :EventType UserInput :EventData 8
    :LinkEffect ( :PutBehind ( 4001 4000 ) )
   }

   {:Link 2003
    :EventSource 0 :EventType UserInput :EventData 9
    :LinkEffect ( :PutBefore ( 4003 4000 ) )
   }
   {:Link 2004
    :EventSource 0 :EventType UserInput :EventData 10
    :LinkEffect ( :PutBefore ( 4002 4000 ) )
   }
   {:Link 2005
    :EventSource 0 :EventType UserInput :EventData 11
    :LinkEffect ( :PutBefore ( 4001 4000 ) )
   }

   // ----------------------------------------------------------

   {:PushButton 9001
    :OrigBoxSize   100  60
    :OrigPosition  540 280 
    :ButtonRefColour gray
    :OrigLabel "back to main"
   }

   {:Link 9002
    :EventSource 9001 :EventType IsSelected
    :LinkEffect (  :TransitionTo( ( "demo/main.mhg" 0) ) )
   }

   {:Link 9003
    :EventSource 9001 :EventType CursorEnter
    :LinkEffect ( :Activate( 9005 ) )
   }
   {:Link 9004
    :EventSource 9001 :EventType CursorLeave
    :LinkEffect ( :DeActivate( 9005 ) )
   }
   {:Link 9005
      :InitiallyActive false
      :EventSource 0
      :EventType UserInput
      :EventData 15
      :LinkEffect ( :TransitionTo( ( "demo/main.mhg" 0) )
		  )
   }
  
 )

 :InputEventReg 1
 :SceneCS 650 350
 :MovingCursor true
}

disp2.mhg:

{:Scene ( "demo/disp2.mhg" 0 )

 :Items
 (
  {:Link  110
    :EventSource 0
    :EventType UserInput
    :EventData 16
    :LinkEffect (
                  :Quit (( "demo/startup" 0 ))
                )
   }

   {:Text 1000
    :OrigContent  'Testing the Displaystack, 2.Test:'
    :OrigBoxSize 500 30
    :OrigPosition 90 20
    :FontAttributes Bold.24 :FontName Proportional
   }

   {:Text 1001
    :OrigContent  'key1: bring to front: green rectangle
key2: bring to front: gray rectangle
key3: bring to front: blue rectangle
key4: bring to front: red rectangle
key5: bring to front: yellow rectangle
key6: send to back: green rectangle
key7: send to back: gray rectangle
key8: send to back: blue rectangle
key9: send to back: red rectangle
key0: send to back: yellow rectangle'
    :OrigBoxSize 300 220 
    :OrigPosition 330 60
    :FontAttributes Plain.18 :FontName Proportional
    :TextWrapping false	
   }

   {:Bitmap 101
    :OrigContent :ContentRef ( "demo/tu_klein.gif" )
	     :OrigBoxSize 51 39     // 0 0
	     :OrigPosition 10 15
	     :Tiling false
	     }

   {:Bitmap 102
    :OrigContent :ContentRef ( "demo/fsp_pv.gif")
             :OrigBoxSize 48 43
	     :OrigPosition 540 15
	     :Tiling false
	     }

   {:Bitmap 103
    :OrigContent :ContentRef ( "demo/prz.gif" )
             :OrigBoxSize 48 43
	     :OrigPosition 590 15
	     :Tiling false
	     }


   // -----------------------------------------------------------------

   {:Rectangle 4000
    :OrigBoxSize 80 260 :OrigPosition 110 70
    :OrigLineWidth 5 :OrigLineStyle 1
    :OrigRefLineColour Green :OrigRefFillColour transparent
   }
   {:Rectangle 4001
    :OrigBoxSize 200 200 :OrigPosition 50 100
    :OrigLineWidth 5 :OrigLineStyle 1
    :OrigRefLineColour DarkGray :OrigRefFillColour Gray
   }
   {:Rectangle 4002
    :OrigBoxSize 100 100 :OrigPosition 100 150
    :OrigLineWidth 5 :OrigLineStyle 1
    :OrigRefLineColour Blue :OrigRefFillColour transparent
   }
   {:Rectangle 4003
    :OrigBoxSize 150 150 :OrigPosition 150 190
    :OrigLineWidth 5 :OrigLineStyle 1
    :OrigRefLineColour Red :OrigRefFillColour DarkRed
   }
   {:Rectangle 4004
    :OrigBoxSize 280 170 :OrigPosition 10 60
    :OrigLineWidth 5 :OrigLineStyle 1
    :OrigRefLineColour Yellow :OrigRefFillColour transparent
   }

   // -----------------------------------------------------------------

  
   {:Link 1005
    :EventSource 0 :EventType UserInput :EventData 6
    :LinkEffect ( :BringToFront ( 4000 ) )
   }
   {:Link 1006
    :EventSource 0 :EventType UserInput :EventData 7
    :LinkEffect ( :BringToFront ( 4001 ) )
   }
   {:Link 1007
    :EventSource 0 :EventType UserInput :EventData 8
    :LinkEffect ( :BringToFront ( 4002 ) )
   }
   {:Link 1008
    :EventSource 0 :EventType UserInput :EventData 9
    :LinkEffect ( :BringToFront ( 4003 ) )
   }
   {:Link 1009
    :EventSource 0 :EventType UserInput :EventData 10
    :LinkEffect ( :BringToFront ( 4004 ) )
   }

   {:Link 1010
    :EventSource 0 :EventType UserInput :EventData 11
    :LinkEffect ( :SendToBack ( 4000 ) )
   }
   {:Link 1011
    :EventSource 0 :EventType UserInput :EventData 12
    :LinkEffect ( :SendToBack ( 4001 ) )
   }
   {:Link 1012
    :EventSource 0 :EventType UserInput :EventData 13
    :LinkEffect ( :SendToBack ( 4002 ) )
   }
   {:Link 1013
    :EventSource 0 :EventType UserInput :EventData 14
    :LinkEffect ( :SendToBack ( 4003 ) )
   }
   {:Link 1014
    :EventSource 0 :EventType UserInput :EventData 5
    :LinkEffect ( :SendToBack ( 4004 ) )
   }   

   // ----------------------------------------------------------

   {:PushButton 9001
    :OrigBoxSize   100  60
    :OrigPosition  540 280 
    :ButtonRefColour gray
    :OrigLabel "back to main"
   }

   {:Link 9002
    :EventSource 9001 :EventType IsSelected
    :LinkEffect (  :TransitionTo( ( "demo/main.mhg" 0) ) )
   }

   {:Link 9003
    :EventSource 9001 :EventType CursorEnter
    :LinkEffect ( :Activate( 9005 ) )
   }
   {:Link 9004
    :EventSource 9001 :EventType CursorLeave
    :LinkEffect ( :DeActivate( 9005 ) )
   }
   {:Link 9005
      :InitiallyActive false
      :EventSource 0
      :EventType UserInput
      :EventData 15
      :LinkEffect ( :TransitionTo( ( "demo/main.mhg" 0) )
		  )
   }
  
 )

 :InputEventReg 1
 :SceneCS 650 350
 :MovingCursor true
}

text.mhg:

{:Scene ( "demo/text.mhg" 0 )

 :Items
 (
   {:Text 1000
    :OrigContent  'Testing the Text Features:' 
    :OrigBoxSize 500 30
    :OrigPosition 80 10
    :FontAttributes Bold.24 :FontName Proportional
   }


   {:Text 3000
    :OrigContent  'Text 1: Plain.18
TextWrapping = false'
    :OrigBoxSize 220 110
    :OrigPosition 10 50 
    :OrigFont 'OctetString in OriginalFont'
    :FontAttributes Plain.18
    :FontName Proportional
    :TextColour black
    :BackgroundColour white
    :CharacterSet 1848
    :HJustification start
    :VJustification start
    :LineOrientation horizontal
    :StartCorner upper-left
    :TextWrapping false
   }

  {:Bitmap 101
    :OrigContent :ContentRef ( "demo/tu_klein.gif" )
	     :OrigBoxSize 51 39     // 0 0
	     :OrigPosition 10 5
	     :Tiling false
	     }

   {:Bitmap 102
    :OrigContent :ContentRef ( "demo/fsp_pv.gif")
             :OrigBoxSize 48 43
	     :OrigPosition 625 5
	     :Tiling false
	     }

   {:Bitmap 103
    :OrigContent :ContentRef ( "demo/prz.gif" )
             :OrigBoxSize 48 43
	     :OrigPosition 675 5
	     :Tiling false
	     }


  {:Link  110
    :EventSource 0
    :EventType UserInput
    :EventData 16
    :LinkEffect (
                  :Quit (( "demo/startup" 0 ))
                )
   }

   {:HotSpot 3100
    :OrigBoxSize 220 110
    :OrigPosition 10 50 
   }

   {:Text 3001
    :OrigContent  'Text 2: Bold.18, 
                   HJustification = end,
                   VJustification = end.'
    :OrigBoxSize 220 110
    :OrigPosition 250 50
    :OrigFont 'OctetString in OriginalFont'
    :FontAttributes Bold.18
    :TextColour black
    :BackgroundColour white
    :CharacterSet 1848
    :HJustification end
    :VJustification end
    :LineOrientation horizontal
    :StartCorner upper-left
    :TextWrapping true
   }
   {:HotSpot 3101
    :OrigBoxSize 220 110
    :OrigPosition 250 50
   }

   {:Text 3002
    :OrigContent  'Text 3: Italic.18, 
                   HJustification = centre, 
                   StartCorner = upper-left'
    :OrigBoxSize 220 110
    :OrigPosition 490 50
    :OrigFont 'OctetString in OriginalFont'
    :FontAttributes Italic.18
    :TextColour black
    :BackgroundColour white
    :CharacterSet 1848
    :HJustification centre
    :VJustification end
    :LineOrientation horizontal
    :StartCorner upper-left
    :TextWrapping true
   }
   {:HotSpot 3102
    :OrigBoxSize 220 110
    :OrigPosition 490 50
   }

   {:Text 3003
    :OrigContent  :ContentRef ( "demo/to_load.txt" )
    :OrigBoxSize 220 110
    :OrigPosition 10 180
    :OrigFont 'OctetString in OriginalFont'
    :FontAttributes Bold-Italic.18
    :TextColour black
    :BackgroundColour white
    :CharacterSet 1848
    :HJustification centre
    :VJustification end
    :LineOrientation horizontal
    :StartCorner upper-left
    :TextWrapping true
   }
   {:HotSpot 3103
    :OrigBoxSize 220 110
    :OrigPosition 10 180
   }

   {:Text 3004
    :OrigContent  'Text 5: Emphasis.18,
                   HJustification = justified, 
                   VJustification = justified.'
    :OrigBoxSize 220 110
    :OrigPosition 250 180
    :OrigFont 'OctetString in OriginalFont'
    :FontAttributes Emphasis.18
    :TextColour black
    :BackgroundColour white
    :CharacterSet 1848
    :HJustification justified
    :VJustification justified
    :LineOrientation horizontal
    :StartCorner upper-left
    :TextWrapping true
   }
   {:HotSpot 3104
    :OrigBoxSize 220 110
    :OrigPosition 250 180
    }

   {:Text 3005
    :OrigContent  'Text 6: black on white, Strong.18, 
                   horizontally and vertically centered.'
    :OrigBoxSize 220 110
    :OrigPosition 490 180
    :FontAttributes Strong.18
    :TextColour black
    :BackgroundColour white
    :HJustification centre
    :VJustification centre
    :TextWrapping true 
   }
   {:HotSpot 3105
    :OrigBoxSize 220 110
    :OrigPosition 490 180
   }

   {:Text 3006
    :OrigContent  'Text 7: black on white, Plain.10, 
                   horizontally and vertically centered.'
    :OrigBoxSize 220 110
    :OrigPosition 10 310
    :FontAttributes Plain.10
    :TextColour black
    :BackgroundColour white
    :HJustification centre
    :VJustification centre
    :TextWrapping true 
   }
   {:HotSpot 3106
    :OrigBoxSize 220 110
    :OrigPosition 10 310
   }

   {:Text 3007
    :OrigContent  'Text 8: black on white, Italic.24, 
                   horizontally and vertically centered.'
    :OrigBoxSize 220 110
    :OrigPosition 250 310
    :FontAttributes Italic.24
    :TextColour black
    :BackgroundColour white
    :HJustification centre
    :VJustification centre
    :TextWrapping true 
   }
   {:HotSpot 3107
    :OrigBoxSize 220 110
    :OrigPosition 250 310
   }

   {:Text 3008
    :OrigContent  'Text 9: black on white, Bold.12, Fixed, 
                   horizontally and vertically centered.'
    :OrigBoxSize 220 110
    :OrigPosition 490 310
    :FontAttributes Bold.12
    :FontName Fixed 
    :TextColour black
    :BackgroundColour white
    :HJustification centre
    :VJustification centre
    :TextWrapping true 
   }
   {:HotSpot 3108
    :OrigBoxSize 220 110
    :OrigPosition 490 310
   }
   
   // ----------------------------------------------------------

   {:Rectangle 2000
    :OrigBoxSize 224 114 :OrigPosition 8 48
    :OrigLineWidth 2 :OrigLineStyle 1
    :OrigRefLineColour Red
    :OrigRefFillColour transparent
   }

   {:IntegerVar 32000 :OrigValue 350 }                   
   {:IntegerVar 32001 :OrigValue 120 }   
   {:ObjectRefVar 32002 :OrigValue :ObjectRef 3000 }   // the text
   {:ObjectRefVar 32003 :OrigValue :ObjectRef 3100 }   // the hotspot
   
   {:IntegerVar 2001  :OrigValue 8 }
   {:IntegerVar 2002  :OrigValue 48 }
   {:IntegerVar 2003  :OrigValue 224 }
   {:IntegerVar 2004  :OrigValue 114 }


   {:Link 1004
    :EventSource 0 :EventType UserInput :EventData 1
    :LinkEffect ( :GetBoxSize (:IndirectRef 32002 32000 32001 )
                  :GetBoxSize (:IndirectRef 32002 2003 2004 )
                  :Subtract ( 32001 1 )
                  :Add       ( 2003 4 )                  
                  :Add       ( 2004 3 )
                  :SetBoxSize (:IndirectRef 32002 :IndirectRef 32000 :IndirectRef 32001 )
                  :SetBoxSize (:IndirectRef 32003 :IndirectRef 32000 :IndirectRef 32001 )
                  :SetBoxSize (2000  :IndirectRef 2003 :IndirectRef 2004)
                  :BringToFront (2000)
                  :BringToFront (:IndirectRef 32003)
                )
   }
   {:Link 1005
    :EventSource 0 :EventType UserInput :EventData 2
    :LinkEffect ( :GetBoxSize (:IndirectRef 32002 32000 32001 )
                  :GetBoxSize (:IndirectRef 32002 2003 2004 )
                  :Add ( 32001 1 )
                  :Add       ( 2003 4 )                  
                  :Add       ( 2004 5 )
                  :SetBoxSize (:IndirectRef 32002 :IndirectRef 32000 :IndirectRef 32001 )
                  :SetBoxSize (:IndirectRef 32003 :IndirectRef 32000 :IndirectRef 32001 )
                  :SetBoxSize (2000  :IndirectRef 2003 :IndirectRef 2004)
                  :BringToFront (2000)
                  :BringToFront (:IndirectRef 32003)
                )
   }
   {:Link 1006
    :EventSource 0 :EventType UserInput :EventData 3
    :LinkEffect ( :GetBoxSize (:IndirectRef 32002  32000 32001 )
                  :GetBoxSize (:IndirectRef 32002 2003 2004 )
                  :Subtract ( 32000 1 )
                  :Add       ( 2003 3 )                  
                  :Add       ( 2004 4 )
                  :SetBoxSize (:IndirectRef 32002 :IndirectRef 32000 :IndirectRef 32001 )
                  :SetBoxSize (:IndirectRef 32003 :IndirectRef 32000 :IndirectRef 32001 ) 
                  :SetBoxSize (2000  :IndirectRef 2003 :IndirectRef 2004)
                  :BringToFront (2000)
                  :BringToFront (:IndirectRef 32003)
                )
   }
   {:Link 1007
    :EventSource 0 :EventType UserInput :EventData 4
    :LinkEffect ( :GetBoxSize (:IndirectRef 32002 32000 32001 )
                  :GetBoxSize (:IndirectRef 32002 2003 2004 )
                  :Add ( 32000 1 )
                  :Add       ( 2003 5 )                  
                  :Add       ( 2004 4 )
                  :SetBoxSize (:IndirectRef 32002 :IndirectRef 32000 :IndirectRef 32001 )
                  :SetBoxSize (:IndirectRef 32003 :IndirectRef 32000 :IndirectRef 32001 )
                  :SetBoxSize (2000  :IndirectRef 2003 :IndirectRef 2004)
                  :BringToFront (2000)
                  :BringToFront (:IndirectRef 32003)

                )
   }


   // ----------------------------------------------------------

   {:Link 1008
    :EventSource 0 :EventType UserInput :EventData 6
    :LinkEffect (  :SetVariable ( 32002  :GObjectRef 3000 ) 
                   :SetVariable ( 32003  :GObjectRef 3100 ) 
		       :GetPosition ( :IndirectRef 32002 2001 2002 )
		       :GetBoxSize     ( :IndirectRef 32002 2003 2004 )
		       :Subtract ( 2001 2 )
		       :Subtract ( 2002 2 )                  
		       :Add      ( 2003 4 )
		       :Add      ( 2004 4 )
		       :SetPosition (2000 :IndirectRef 2001 :IndirectRef 2002 )
		       :SetBoxSize (2000 :IndirectRef 2003 :IndirectRef 2004 )
		       :BringToFront ( 2000 )
		       :BringToFront ( :IndirectRef 32002 )	
		       :BringToFront ( :IndirectRef 32003 )	

                )
   }
   {:Link 1108
    :EventSource 3100 :EventType IsSelected 
    :LinkEffect (  :SetVariable ( 32002  :GObjectRef 3000 ) 
                   :SetVariable ( 32003  :GObjectRef 3100 ) 
		       :GetPosition ( :IndirectRef 32002 2001 2002 )
		       :GetBoxSize     ( :IndirectRef 32002 2003 2004 )
		       :Subtract ( 2001 2 )
		       :Subtract ( 2002 2 )                  
		       :Add      ( 2003 4 )
		       :Add      ( 2004 4 )
		       :SetPosition (2000 :IndirectRef 2001 :IndirectRef 2002 )
		       :SetBoxSize (2000 :IndirectRef 2003 :IndirectRef 2004 )
		       :BringToFront ( 2000 )
		       :BringToFront ( :IndirectRef 32002 )	
		       :BringToFront ( :IndirectRef 32003 )	
                )
   }
 
   // ---  

   {:Link 1009
    :EventSource 0 :EventType UserInput :EventData 7
    :LinkEffect (  :SetVariable ( 32002  :GObjectRef 3001 ) 
                   :SetVariable ( 32003  :GObjectRef 3101 ) 
		       :GetPosition ( :IndirectRef 32002 2001 2002 )
		       :GetBoxSize     ( :IndirectRef 32002 2003 2004 )
		       :Subtract ( 2001 2 )
		       :Subtract ( 2002 2 )                  
		       :Add      ( 2003 4 )
		       :Add      ( 2004 4 )
		       :SetPosition (2000 :IndirectRef 2001 :IndirectRef 2002 )
		       :SetBoxSize (2000 :IndirectRef 2003 :IndirectRef 2004 )
		       :BringToFront ( 2000 )
		       :BringToFront ( :IndirectRef 32002 )	
		       :BringToFront ( :IndirectRef 32003 )	
                )
   }
   {:Link 1109
    :EventSource 3101 :EventType IsSelected 
    :LinkEffect (  :SetVariable ( 32002  :GObjectRef 3001 ) 
                   :SetVariable ( 32003  :GObjectRef 3101 ) 
		       :GetPosition ( :IndirectRef 32002 2001 2002 )
		       :GetBoxSize     ( :IndirectRef 32002 2003 2004 )
		       :Subtract ( 2001 2 )
		       :Subtract ( 2002 2 )                  
		       :Add      ( 2003 4 )
		       :Add      ( 2004 4 )
		       :SetPosition (2000 :IndirectRef 2001 :IndirectRef 2002 )
		       :SetBoxSize (2000 :IndirectRef 2003 :IndirectRef 2004 )
		       :BringToFront ( 2000 )
		       :BringToFront ( :IndirectRef 32002 )	
		       :BringToFront ( :IndirectRef 32003 )	
                )
   }
  
   // ---

   {:Link 1010
    :EventSource 0 :EventType UserInput :EventData 8
    :LinkEffect (  :SetVariable ( 32002  :GObjectRef 3002 ) 
                   :SetVariable ( 32003  :GObjectRef 3102 ) 
		       :GetPosition ( :IndirectRef 32002 2001 2002 )
		       :GetBoxSize     ( :IndirectRef 32002 2003 2004 )
		       :Subtract ( 2001 2 )
		       :Subtract ( 2002 2 )                  
		       :Add      ( 2003 4 )
		       :Add      ( 2004 4 )
		       :SetPosition (2000 :IndirectRef 2001 :IndirectRef 2002 )
		       :SetBoxSize (2000 :IndirectRef 2003 :IndirectRef 2004 )
		       :BringToFront ( 2000 )
		       :BringToFront ( :IndirectRef 32002 )	
		       :BringToFront ( :IndirectRef 32003 )	
                ) 
   }
   {:Link 1110
    :EventSource 3102 :EventType IsSelected 
    :LinkEffect (  :SetVariable ( 32002  :GObjectRef 3002 ) 
                   :SetVariable ( 32003  :GObjectRef 3102 ) 
		       :GetPosition ( :IndirectRef 32002 2001 2002 )
		       :GetBoxSize     ( :IndirectRef 32002 2003 2004 )
		       :Subtract ( 2001 2 )
		       :Subtract ( 2002 2 )                  
		       :Add      ( 2003 4 )
		       :Add      ( 2004 4 )
		       :SetPosition (2000 :IndirectRef 2001 :IndirectRef 2002 )
		       :SetBoxSize (2000 :IndirectRef 2003 :IndirectRef 2004 )
		       :BringToFront ( 2000 )
		       :BringToFront ( :IndirectRef 32002 )	
		       :BringToFront ( :IndirectRef 32003 )	
                )
   }
    
   // ---

   {:Link 1011
    :EventSource 0 :EventType UserInput :EventData 9
    :LinkEffect (  :SetVariable ( 32002  :GObjectRef 3003 ) 
                   :SetVariable ( 32003  :GObjectRef 3103 ) 
		       :GetPosition ( :IndirectRef 32002 2001 2002 )
		       :GetBoxSize     ( :IndirectRef 32002 2003 2004 )
		       :Subtract ( 2001 2 )
		       :Subtract ( 2002 2 )                  
		       :Add      ( 2003 4 )
		       :Add      ( 2004 4 )
		       :SetPosition (2000 :IndirectRef 2001 :IndirectRef 2002 )
		       :SetBoxSize (2000 :IndirectRef 2003 :IndirectRef 2004 )
		       :BringToFront ( 2000 )
		       :BringToFront ( :IndirectRef 32002 )	
		       :BringToFront ( :IndirectRef 32003 )	
                )
   }
   {:Link 1111
    :EventSource 3103 :EventType IsSelected 
    :LinkEffect (  :SetVariable ( 32002  :GObjectRef 3003 ) 
                   :SetVariable ( 32003  :GObjectRef 3103 ) 
		       :GetPosition ( :IndirectRef 32002 2001 2002 )
		       :GetBoxSize     ( :IndirectRef 32002 2003 2004 )
		       :Subtract ( 2001 2 )
		       :Subtract ( 2002 2 )                  
		       :Add      ( 2003 4 )
		       :Add      ( 2004 4 )
		       :SetPosition (2000 :IndirectRef 2001 :IndirectRef 2002 )
		       :SetBoxSize (2000 :IndirectRef 2003 :IndirectRef 2004 )
		       :BringToFront ( 2000 )
		       :BringToFront ( :IndirectRef 32002 )	
		       :BringToFront ( :IndirectRef 32003 )	
                )
   }
  
   // ---

   {:Link 1012
    :EventSource 0 :EventType UserInput :EventData 10
    :LinkEffect (  :SetVariable ( 32002  :GObjectRef 3004 ) 
                   :SetVariable ( 32003  :GObjectRef 3104 ) 
		       :GetPosition ( :IndirectRef 32002 2001 2002 )
		       :GetBoxSize     ( :IndirectRef 32002 2003 2004 )
		       :Subtract ( 2001 2 )
		       :Subtract ( 2002 2 )                  
		       :Add      ( 2003 4 )
		       :Add      ( 2004 4 )
		       :SetPosition (2000 :IndirectRef 2001 :IndirectRef 2002 )
		       :SetBoxSize (2000 :IndirectRef 2003 :IndirectRef 2004 )
		       :BringToFront ( 2000 )
		       :BringToFront ( :IndirectRef 32002 )	
		       :BringToFront ( :IndirectRef 32003 )	
                )
   }
   {:Link 1112
    :EventSource 3104 :EventType IsSelected 
    :LinkEffect (  :SetVariable ( 32002  :GObjectRef 3004 ) 
                   :SetVariable ( 32003  :GObjectRef 3104 ) 
		       :GetPosition ( :IndirectRef 32002 2001 2002 )
		       :GetBoxSize     ( :IndirectRef 32002 2003 2004 )
		       :Subtract ( 2001 2 )
		       :Subtract ( 2002 2 )                  
		       :Add      ( 2003 4 )
		       :Add      ( 2004 4 )
		       :SetPosition (2000 :IndirectRef 2001 :IndirectRef 2002 )
		       :SetBoxSize (2000 :IndirectRef 2003 :IndirectRef 2004 )
		       :BringToFront ( 2000 )
		       :BringToFront ( :IndirectRef 32002 )	
		       :BringToFront ( :IndirectRef 32003 )	
                )
   }
  
   // ---

   {:Link 1013
    :EventSource 0 :EventType UserInput :EventData 11
    :LinkEffect (  :SetVariable ( 32002  :GObjectRef 3005 ) 
                   :SetVariable ( 32003  :GObjectRef 3105 ) 
		       :GetPosition ( :IndirectRef 32002 2001 2002 )
		       :GetBoxSize     ( :IndirectRef 32002 2003 2004 )
		       :Subtract ( 2001 2 )
		       :Subtract ( 2002 2 )                  
		       :Add      ( 2003 4 )
		       :Add      ( 2004 4 )
		       :SetPosition (2000 :IndirectRef 2001 :IndirectRef 2002 )
		       :SetBoxSize (2000 :IndirectRef 2003 :IndirectRef 2004 )
		       :BringToFront ( 2000 )
		       :BringToFront ( :IndirectRef 32002 )	
		       :BringToFront ( :IndirectRef 32003 )	
                )	 
   }
   {:Link 1113
    :EventSource 3105 :EventType IsSelected 
    :LinkEffect (  :SetVariable ( 32002  :GObjectRef 3005 ) 
                   :SetVariable ( 32003  :GObjectRef 3105 ) 
		       :GetPosition ( :IndirectRef 32002 2001 2002 )
		       :GetBoxSize     ( :IndirectRef 32002 2003 2004 )
		       :Subtract ( 2001 2 )
		       :Subtract ( 2002 2 )                  
		       :Add      ( 2003 4 )
		       :Add      ( 2004 4 )
		       :SetPosition (2000 :IndirectRef 2001 :IndirectRef 2002 )
		       :SetBoxSize (2000 :IndirectRef 2003 :IndirectRef 2004 )
		       :BringToFront ( 2000 )
		       :BringToFront ( :IndirectRef 32002 )	
		       :BringToFront ( :IndirectRef 32003 )	
                )
   }
  
   // ---

   {:Link 1014
    :EventSource 0 :EventType UserInput :EventData 12
    :LinkEffect (  :SetVariable ( 32002  :GObjectRef 3006 ) 
                   :SetVariable ( 32003  :GObjectRef 3106 ) 
		       :GetPosition ( :IndirectRef 32002 2001 2002 )
		       :GetBoxSize     ( :IndirectRef 32002 2003 2004 )
		       :Subtract ( 2001 2 )
		       :Subtract ( 2002 2 )                  
		       :Add      ( 2003 4 )
		       :Add      ( 2004 4 )
		       :SetPosition (2000 :IndirectRef 2001 :IndirectRef 2002 )
		       :SetBoxSize (2000 :IndirectRef 2003 :IndirectRef 2004 )
		       :BringToFront ( 2000 )
		       :BringToFront ( :IndirectRef 32002 )	
		       :BringToFront ( :IndirectRef 32003 )	                )	 
   }
   {:Link 1114
    :EventSource 3106 :EventType IsSelected 
    :LinkEffect (  :SetVariable ( 32002  :GObjectRef 3006 ) 
                   :SetVariable ( 32003  :GObjectRef 3106 ) 
		       :GetPosition ( :IndirectRef 32002 2001 2002 )
		       :GetBoxSize     ( :IndirectRef 32002 2003 2004 )
		       :Subtract ( 2001 2 )
		       :Subtract ( 2002 2 )                  
		       :Add      ( 2003 4 )
		       :Add      ( 2004 4 )
		       :SetPosition (2000 :IndirectRef 2001 :IndirectRef 2002 )
		       :SetBoxSize (2000 :IndirectRef 2003 :IndirectRef 2004 )
		       :BringToFront ( 2000 )
		       :BringToFront ( :IndirectRef 32002 )	
		       :BringToFront ( :IndirectRef 32003 )	
                )
   }
  
   // ---

   {:Link 1015
    :EventSource 0 :EventType UserInput :EventData 13
    :LinkEffect (  :SetVariable ( 32002  :GObjectRef 3007 ) 
                   :SetVariable ( 32003  :GObjectRef 3107 ) 
		       :GetPosition ( :IndirectRef 32002 2001 2002 )
		       :GetBoxSize     ( :IndirectRef 32002 2003 2004 )
		       :Subtract ( 2001 2 )
		       :Subtract ( 2002 2 )                  
		       :Add      ( 2003 4 )
		       :Add      ( 2004 4 )
		       :SetPosition (2000 :IndirectRef 2001 :IndirectRef 2002 )
		       :SetBoxSize (2000 :IndirectRef 2003 :IndirectRef 2004 )
		       :BringToFront ( 2000 )
		       :BringToFront ( :IndirectRef 32002 )	
		       :BringToFront ( :IndirectRef 32003 )	
                )
   }
   {:Link 1115
    :EventSource 3107 :EventType IsSelected 
    :LinkEffect (  :SetVariable ( 32002  :GObjectRef 3007 ) 
                   :SetVariable ( 32003  :GObjectRef 3107 ) 
		       :GetPosition ( :IndirectRef 32002 2001 2002 )
		       :GetBoxSize     ( :IndirectRef 32002 2003 2004 )
		       :Subtract ( 2001 2 )
		       :Subtract ( 2002 2 )                  
		       :Add      ( 2003 4 )
		       :Add      ( 2004 4 )
		       :SetPosition (2000 :IndirectRef 2001 :IndirectRef 2002 )
		       :SetBoxSize (2000 :IndirectRef 2003 :IndirectRef 2004 )
		       :BringToFront ( 2000 )
		       :BringToFront ( :IndirectRef 32002 )	
		       :BringToFront ( :IndirectRef 32003 )	
                )
   }
  
   // ---

   {:Link 1016
    :EventSource 0 :EventType UserInput :EventData 14
    :LinkEffect (  :SetVariable ( 32002  :GObjectRef 3008 )
                   :SetVariable ( 32003  :GObjectRef 3108 ) 
		       :GetPosition ( :IndirectRef 32002 2001 2002 )
		       :GetBoxSize     ( :IndirectRef 32002 2003 2004 )
		       :Subtract ( 2001 2 )
		       :Subtract ( 2002 2 )                  
		       :Add      ( 2003 4 )
		       :Add      ( 2004 4 )
		       :SetPosition (2000 :IndirectRef 2001 :IndirectRef 2002 )
		       :SetBoxSize (2000 :IndirectRef 2003 :IndirectRef 2004 )
		       :BringToFront ( 2000 )
		       :BringToFront ( :IndirectRef 32002 )	
		       :BringToFront ( :IndirectRef 32003 )	
                )
   }
   {:Link 1116
    :EventSource 3108 :EventType IsSelected 
    :LinkEffect (  :SetVariable ( 32002  :GObjectRef 3008 ) 
                   :SetVariable ( 32003  :GObjectRef 3108 ) 
		       :GetPosition ( :IndirectRef 32002 2001 2002 )
		       :GetBoxSize     ( :IndirectRef 32002 2003 2004 )
		       :Subtract ( 2001 2 )
		       :Subtract ( 2002 2 )                  
		       :Add      ( 2003 4 )
		       :Add      ( 2004 4 )
		       :SetPosition (2000 :IndirectRef 2001 :IndirectRef 2002 )
		       :SetBoxSize (2000 :IndirectRef 2003 :IndirectRef 2004 )
		       :BringToFront ( 2000 )
		       :BringToFront ( :IndirectRef 32002 )	
		       :BringToFront ( :IndirectRef 32003 )	
                )
   }
  

   // ----------------------------------------------------------


   {:Text 9000	
    :OrigContent  'Press key(n), or click on a Text. 
         To change the size of a text presentation,
         press cursor keys.'
    :OrigBoxSize 550 110
    :OrigPosition 10 430
    :FontAttributes Plain.18 :FontName Proportional
    :TextWrapping true 
   }

   {:PushButton 9001
    :OrigBoxSize   100  60
    :OrigPosition  600 430 
    :ButtonRefColour gray
    :OrigLabel "back to main"
   }

   {:Link 9002
    :EventSource 9001 :EventType IsSelected
    :LinkEffect (  :TransitionTo( ( "demo/main.mhg" 0) ) )
   }

   {:Link 9003
    :EventSource 9001 :EventType CursorEnter
    :LinkEffect ( :Activate( 9005 ) )
   }
   {:Link 9004
    :EventSource 9001 :EventType CursorLeave
    :LinkEffect ( :DeActivate( 9005 ) )
   }
   {:Link 9005
      :InitiallyActive false
      :EventSource 0
      :EventType UserInput
      :EventData 15
      :LinkEffect ( :TransitionTo( ( "demo/main.mhg" 0) )
		  )
   }
  
 )

 :InputEventReg 1
 :SceneCS 730 500
 :MovingCursor true
}

intact.mhg:

{:Scene ( "demo/intact.mhg" 0 )

 :Items
 (  
  {:Link  110
    :EventSource 0
    :EventType UserInput
    :EventData 16
    :LinkEffect (
                  :Quit (( "demo/startup" 0 ))
                )
   }
   {:Text 1000
    :OrigContent  'Testing interactible Objects:'
    :OrigBoxSize 500 30
    :OrigPosition 80 10 
    :FontAttributes Bold.24 :FontName Proportional
   }   

  {:Bitmap 101
    :OrigContent :ContentRef ( "demo/tu_klein.gif" )
	     :OrigBoxSize 51 39     // 0 0
	     :OrigPosition 10 5
	     :Tiling false
	     }

   {:Bitmap 102
    :OrigContent :ContentRef ( "demo/fsp_pv.gif")
             :OrigBoxSize 48 43
	     :OrigPosition 545 5
	     :Tiling false
	     }

   {:Bitmap 103
    :OrigContent :ContentRef ( "demo/prz.gif" )
             :OrigBoxSize 48 43
	     :OrigPosition 595 5
	     :Tiling false
	     }



   {:Text 1001
    :OrigContent  'Test of interacting Objects. Use Cursor keys to resize
                   the EntryField above.'
    :OrigBoxSize 180 200 
    :OrigPosition 340 270
    :FontAttributes Plain.18 :FontName Proportional
    :HJustification justified
    :TextWrapping true	
   }

   
   {:EntryField 3001
    :OrigContent 'A simple Entryfield.'
    :OrigBoxSize 300 100
    :OrigPosition 10 50
    :ObscuredInput true
   }

   // 	'A more complex one - vertically and horizontally centered'
   {:EntryField 3002
    :OrigContent 'A more complex one - vertically and horizontally centered'
    :OrigBoxSize 300 150
    :OrigPosition 335 50 
    :FontAttributes Bold.16
    :FontName Proportional
    :TextColour red
    :BackgroundColour white
    :HJustification centre
    :VJustification centre	
   }

   {:OStringVar 3003
    :OrigValue  "void"
   }

   {:Link 3004
    :EventSource 3002 :EventType InteractionCompleted
    :LinkEffect ( :GetTextData ( 3002 3003 ) 
                  :SetData (3005 :indirectref 3003) )
   }	
 
   {:Text 3005
    :OrigContent  'void'
    :OrigBoxSize 300 50
    :OrigPosition 335 210 
    :FontAttributes Plain.10 :FontName Proportional
   }


   // ----------------------------------------------------------


   {:Text 4000
    :OrigContent  'A Pushbutton:'
    :OrigBoxSize 120 30
    :OrigPosition 15 173 
    :FontAttributes Plain.18 :FontName Proportional
   }

   {:PushButton 4001
    :OrigBoxSize  120 30 
    :OrigPosition  180 170
    :ButtonRefColour darkYellow
    :OrigLabel "A PushButton"
   }

   {:Rectangle 4002 
    :InitiallyActive false
    :OrigBoxSize 30 30
    :OrigPosition 130 170 
    :OrigLineWidth 5
    :OrigLineStyle 1
    :OrigRefLineColour DarkRed
    :OrigRefFillColour Red
   }

   // ----

   {:Text 4010
    :OrigContent  'A HotSpot:'
    :OrigBoxSize 120 30
    :OrigPosition 15 213 
    :FontAttributes Plain.18 :FontName Proportional
   }

   {:HotSpot 4011
    :OrigBoxSize  120 30
    :OrigPosition   180 210
   }

   {:Rectangle 4012 
    :InitiallyActive false
    :OrigBoxSize 30 30
    :OrigPosition 130 210 
    :OrigLineWidth 5
    :OrigLineStyle 1
    :OrigRefLineColour DarkRed
    :OrigRefFillColour Red
   }

   // ----

   {:Text 4020
    :OrigContent  '3 SwitchButtons:'
    :OrigBoxSize 135 30
    :OrigPosition 15 293 
    :FontAttributes Plain.18 :FontName Proportional
   }

   {:SwitchButton 4021
    :OrigBoxSize  40 30
    :OrigPosition   180 290
    :OrigLabel "A SwitchButton" 
    :ButtonStyle pushbutton
   }
   {:SwitchButton 4022
    :OrigBoxSize  20 20
    :OrigPosition   230 295
    :OrigLabel "A SwitchButton" 
    :ButtonStyle radiobutton
   }
   {:SwitchButton 4023
    :OrigBoxSize  20 20
    :OrigPosition   270 295
    :OrigLabel "A SwitchButton" 
    :ButtonStyle checkbox
   }

   {:Text 4025
    :OrigContent  'A Slider:'
    :OrigBoxSize 135 30
    :OrigPosition 15 333
    :FontAttributes Plain.18 :FontName Proportional
   }

   {:Slider 4026
    :OrigBoxSize  120 30
    :OrigPosition   180 330
    :Orientation right
    :MaxValue 100
    :InitialPortion 50
    :SliderStyle proportional
   }

   //{:Rectangle 4029
   // :InitiallyActive false
   // :OrigBoxSize 30 30
   // :OrigPosition 130 250 
   // :OrigLineWidth 5
   // :OrigLineStyle 1
   // :OrigRefLineColour DarkRed
   // :OrigRefFillColour Red
   //}

   // ----------------------------------------------------------

   {:Text 4040
    :OrigContent  'Show Highlights:'
    :OrigBoxSize 150 30 
    :OrigPosition 15 253
    :FontAttributes Plain.18 :FontName Proportional
   }

   {:PushButton 4041
    :OrigBoxSize   60  30
    :OrigPosition 180 250 
    :ButtonRefColour gray
    :OrigLabel "On"
   }

   {:PushButton 4051
    :OrigBoxSize   60  30
    :OrigPosition 240 250 
    :ButtonRefColour gray
    :OrigLabel "Off"
   }

   // ----------------------------------------------------------


   {:Link 5000
    :EventSource 4041 :EventType IsSelected
    :LinkEffect ( :SetHighlightStatus ( 4001 true )
                  :SetHighlightStatus ( 4011 true )
                )
   }
   {:Link 5001
    :EventSource 4051 :EventType IsSelected
    :LinkEffect ( :SetHighlightStatus ( 4001 false )
                  :SetHighlightStatus ( 4011 false )
                )
   }

   // ----------------------------------------------------------

   {:Link 5010
    :EventSource 4001 :EventType IsSelected
    :LinkEffect ( :Run ( 4002 ) )
   }
   {:Link 5011
    :EventSource 4001 :EventType IsDeselected
    :LinkEffect ( :Stop ( 4002 ) )
   }

   {:Link 5020
    :EventSource 4011 :EventType IsSelected
    :LinkEffect ( :Run ( 4012 ) )
   }
   {:Link 5021
    :EventSource 4011 :EventType IsDeselected
    :LinkEffect ( :Stop ( 4012 ) )
   }

   // ----------------------------------------------------------



   {:IntegerVar 32000 :OrigValue -1 }
   {:IntegerVar 32001 :OrigValue -1 }

   {:Link 1020
    :EventSource 0 :EventType UserInput :EventData 4
    :LinkEffect ( :GetBoxSize ( 3002 32000 32001 )
                  :Add        ( 32000 4 )
                  :SetBoxSize ( 3002 :IndirectRef 32000 :IndirectRef 32001 ))}
   {:Link 1021
    :EventSource 0 :EventType UserInput :EventData 3
    :LinkEffect ( :GetBoxSize ( 3002 32000 32001 )
                  :Subtract   ( 32000 4 )
                  :SetBoxSize ( 3002 :IndirectRef 32000 :IndirectRef 32001 ))}
   {:Link 1022
    :EventSource 0 :EventType UserInput :EventData 2
    :LinkEffect ( :GetBoxSize ( 3002 32000 32001 )
                  :Add        ( 32001 4 )
                  :SetBoxSize ( 3002 :IndirectRef 32000 :IndirectRef 32001 ))}
   {:Link 1023
    :EventSource 0 :EventType UserInput :EventData 1
    :LinkEffect ( :GetBoxSize ( 3002 32000 32001 )
                  :Subtract   ( 32001 4 )
                  :SetBoxSize ( 3002 :IndirectRef 32000 :IndirectRef 32001 ))}

   // ----------------------------------------------------------

   {:PushButton 9001
    :OrigBoxSize   100  60
    :OrigPosition  540 300
    :ButtonRefColour gray
    :OrigLabel "back to main"
   }

   {:Link 9002
    :EventSource 9001 :EventType IsSelected
    :LinkEffect (  :TransitionTo( ( "demo/main.mhg" 0) ) )
   }

   {:Link 9003
    :EventSource 9001 :EventType CursorEnter
    :LinkEffect ( :Activate( 9005 ) )
   }
   {:Link 9004
    :EventSource 9001 :EventType CursorLeave
    :LinkEffect ( :DeActivate( 9005 ) )
   }
   {:Link 9005
      :InitiallyActive false
      :EventSource 0
      :EventType UserInput
      :EventData 15
      :LinkEffect ( :TransitionTo( ( "demo/main.mhg" 0) )
		  )
   }
  
 )

 :InputEventReg 1
 :SceneCS       650 370
 :MovingCursor  true
}

bitmap1.mhg:

{:Scene ( "demo/bitmap.mhg" 0 )
  
  :Items (
       {:Text 100
        :OrigContent  'Testing the drawing of Bitmaps, 1.Test:'
        :OrigBoxSize 500 30
        :OrigPosition 80 10
        :FontAttributes Bold.24 
        :FontName Proportional
       }

       {:Bitmap 101
             :OrigContent :ContentRef ( "demo/tu_klein.gif" )
	     :OrigBoxSize 51 39     // 0 0
	     :OrigPosition 10 5
	     :Tiling false
	     }

       {:Bitmap 102
        :OrigContent :ContentRef ( "demo/fsp_pv.gif")
             :OrigBoxSize 48 43
	     :OrigPosition 595 5
	     :Tiling false
	     }

       {:Bitmap 103
        :OrigContent :ContentRef ( "demo/prz.gif" )
             :OrigBoxSize 48 43
	     :OrigPosition 645 5
	     :Tiling false
	     }

  {:Link  110
    :EventSource 0
    :EventType UserInput
    :EventData 16
    :LinkEffect (
                  :Quit (( "demo/startup" 0 ))
                )
   }
	  // ----------------------------
	  
	  {:Bitmap 3000
	     :OrigContent
	     :ContentRef ( "demo/pirogue.jpg" )
	     :OrigBoxSize 158 158
	     :OrigPosition 10 100
	     :Tiling false
	     }
          {:HotSpot 3001
             :OrigBoxSize 158 158
             :OrigPosition 10 100 
          }
	  {:Text 3002
             :OrigContent  'A JPEG-encoded picture, drawn in another size:'
             :OrigBoxSize 330 40
             :OrigPosition 10 48
             :FontAttributes Plain.18 
             :FontName Proportional
             :TextWrapping true
          }  
 


	  // ----------------------------

	  {:Bitmap 3100
	     :OrigContent
	     :ContentRef ( "demo/pirogue.gif" )
	     :OrigBoxSize 158 158
	     :OrigPosition 350 100
	     :Tiling false
	     }
          {:HotSpot 3101
             :OrigBoxSize 158 158
             :OrigPosition 350 100
          }
	  {:Text 3102
             :OrigContent  'The GIF-encoded picture rescaled:'
             :OrigBoxSize 300 20
             :OrigPosition 350 48 
             :FontAttributes Plain.18 :FontName Proportional 
             :TextWrapping true
          }  


	  // ----------------------------

	  {:Bitmap 3200
	     :OrigContent
	     :ContentRef ( "demo/pirogue.jpg" )
	     :OrigBoxSize 0 0
	     :OrigPosition 10 310
	     :Tiling false
	     }
	  {:Text 3202
             :OrigContent  'The JPEG-encoded picture in original size:'
             :OrigBoxSize 320 20
             :OrigPosition 10 270 
             :FontAttributes Plain.18 :FontName Proportional
          }

	  // ----------------------------

	  {:Bitmap 3300
	     :OrigContent
	     :ContentRef ( "demo/pirogue.gif" )
	     :OrigBoxSize 0 0
	     :OrigPosition 350 310
	     :Tiling false
	     }
	  {:Text 3302
             :OrigContent  'The GIF-encoded picture in original size:'
             :OrigBoxSize 320 20
             :OrigPosition 350 270 
             :FontAttributes Plain.18 :FontName Proportional
          }

          // ----------------------------------------------------------

          {:Rectangle 2000
           :OrigBoxSize 162 162 :OrigPosition 8 98
           :OrigLineWidth 2 :OrigLineStyle 1
           :OrigRefLineColour Red
           :OrigRefFillColour transparent
          }

          {:IntegerVar 32000 :OrigValue 158 }
          {:IntegerVar 32001 :OrigValue 158 }
          {:ObjectRefVar 32002 :OrigValue :ObjectRef 3000 }        // the bitmap
          {:ObjectRefVar 32003 :OrigValue :ObjectRef 3001 }        // the hotspot
   
          {:IntegerVar 2001  :OrigValue 8 }
          {:IntegerVar 2002  :OrigValue 98 }
          {:IntegerVar 2003  :OrigValue 162 }
          {:IntegerVar 2004  :OrigValue 162 }


          {:Link 1004
           :EventSource 0 :EventType UserInput :EventData 1
           :LinkEffect ( :GetBoxSize (:IndirectRef 32002 32000 32001 )
                         :GetBoxSize (:IndirectRef 32002 2003 2004 )
                         :Subtract ( 32001 1 )
                         :Add       ( 2003 4 )                  
                         :Add       ( 2004 3 )
                         :SetBoxSize (:IndirectRef 32002 :IndirectRef 32000 :IndirectRef 32001 )
                         :SetBoxSize (:IndirectRef 32003 :IndirectRef 32000 :IndirectRef 32001 )
                         :SetBoxSize (2000  :IndirectRef 2003 :IndirectRef 2004)
                         :BringToFront (2000)
                         :BringToFront (:IndirectRef 32003)
                )
          } 
          {:Link 1005      
           :EventSource 0 :EventType UserInput :EventData 2
           :LinkEffect ( :GetBoxSize (:IndirectRef 32002 32000 32001 )
                         :GetBoxSize (:IndirectRef 32002 2003 2004 )
                         :Add ( 32001 1 )
                         :Add       ( 2003 4 )                  
                         :Add       ( 2004 5 )
                         :SetBoxSize (:IndirectRef 32002 :IndirectRef 32000 :IndirectRef 32001 )
                         :SetBoxSize (:IndirectRef 32002 :IndirectRef 32000 :IndirectRef 32001 )
                         :SetBoxSize (2000  :IndirectRef 2003 :IndirectRef 2004)
                         :BringToFront (2000)
                         :BringToFront (:IndirectRef 32003)
                )
          }
          {:Link 1006
           :EventSource 0 :EventType UserInput :EventData 3
           :LinkEffect ( :GetBoxSize (:IndirectRef 32002  32000 32001 )
                         :GetBoxSize (:IndirectRef 32002 2003 2004 )
                         :Subtract ( 32000 1 )
                         :Add       ( 2003 3 )                  
                         :Add       ( 2004 4 )
                         :SetBoxSize (:IndirectRef 32002 :IndirectRef 32000 :IndirectRef 32001 )
                         :SetBoxSize (:IndirectRef 32003 :IndirectRef 32000 :IndirectRef 32001 )
                         :SetBoxSize (2000  :IndirectRef 2003 :IndirectRef 2004)
                         :BringToFront (2000)
                         :BringToFront (:IndirectRef 32003) 
                )
          }
          {:Link 1007
           :EventSource 0 :EventType UserInput :EventData 4
           :LinkEffect ( :GetBoxSize (:IndirectRef 32002 32000 32001 )
                         :GetBoxSize (:IndirectRef 32002 2003 2004 )
                         :Add ( 32000 1 )
                         :Add       ( 2003 5 )                  
                         :Add       ( 2004 4 )
                         :SetBoxSize (:IndirectRef 32002 
                            :IndirectRef 32000 :IndirectRef 32001 )
                         :SetBoxSize (:IndirectRef 32002 
                            :IndirectRef 32000 :IndirectRef 32001 )
                         :SetBoxSize (2000  :IndirectRef 2003 :IndirectRef 2004)
                         :BringToFront (2000)
                         :BringToFront (:IndirectRef 32003)
                )
          }


          // ----------------------------------------------------------

          {:Link 1008
           :EventSource 0 :EventType UserInput :EventData 6
           :LinkEffect (  :SetVariable ( 32002  :GObjectRef 3000 ) 
                          :SetVariable ( 32003  :GObjectRef 3001 ) 
		          :GetPosition ( :IndirectRef 32002 2001 2002 )
		          :GetBoxSize     ( :IndirectRef 32002 2003 2004 )
		          :Subtract ( 2001 2 )
		          :Subtract ( 2002 2 )                  
		          :Add      ( 2003 4 )
		          :Add      ( 2004 4 )
		          :SetPosition (2000 :IndirectRef 2001 :IndirectRef 2002 )
		          :SetBoxSize (2000 :IndirectRef 2003 :IndirectRef 2004 )
		          :BringToFront ( 2000 )
		          :BringToFront ( :IndirectRef 32002 )	
		          :BringToFront ( :IndirectRef 32003 )	
                      )
         }
         {:Link 1108
          :EventSource 3001 :EventType IsSelected 
          :LinkEffect (  :SetVariable ( 32002  :GObjectRef 3000 ) 
                         :SetVariable ( 32003  :GObjectRef 3001 ) 
		         :GetPosition ( :IndirectRef 32002 2001 2002 )
		         :GetBoxSize     ( :IndirectRef 32002 2003 2004 )
		         :Subtract ( 2001 2 )
		         :Subtract ( 2002 2 )                  
		         :Add      ( 2003 4 )
		         :Add      ( 2004 4 )
		         :SetPosition (2000 :IndirectRef 2001 :IndirectRef 2002 )
		         :SetBoxSize (2000 :IndirectRef 2003 :IndirectRef 2004 )
		         :BringToFront ( 2000 )
		         :BringToFront ( :IndirectRef 32002 )	
		         :BringToFront ( :IndirectRef 32003 )	
                     )
         }
 
         // ---  

         {:Link 1009
          :EventSource 0 :EventType UserInput :EventData 7
          :LinkEffect (  :SetVariable ( 32002  :GObjectRef 3100 ) 
                         :SetVariable ( 32003  :GObjectRef 3101 ) 
		         :GetPosition ( :IndirectRef 32002 2001 2002 )
		         :GetBoxSize     ( :IndirectRef 32002 2003 2004 )
		         :Subtract ( 2001 2 )
		         :Subtract ( 2002 2 )                  
		         :Add      ( 2003 4 )
		         :Add      ( 2004 4 )
		         :SetPosition (2000 :IndirectRef 2001 :IndirectRef 2002 )
		         :SetBoxSize (2000 :IndirectRef 2003 :IndirectRef 2004 )
		         :BringToFront ( 2000 )
		         :BringToFront ( :IndirectRef 32002 )	
		         :BringToFront ( :IndirectRef 32003 )	
                      )
         }
         {:Link 1109
          :EventSource 3101 :EventType IsSelected 
          :LinkEffect (  :SetVariable ( 32002  :GObjectRef 3100 ) 
                         :SetVariable ( 32003  :GObjectRef 3101 ) 
		         :GetPosition ( :IndirectRef 32002 2001 2002 )
		         :GetBoxSize     ( :IndirectRef 32002 2003 2004 )
		         :Subtract ( 2001 2 )
		         :Subtract ( 2002 2 )                  
		         :Add      ( 2003 4 )
		         :Add      ( 2004 4 )
		         :SetPosition (2000 :IndirectRef 2001 :IndirectRef 2002 )
		         :SetBoxSize (2000 :IndirectRef 2003 :IndirectRef 2004 )
		         :BringToFront ( 2000 )
		         :BringToFront ( :IndirectRef 32002 )	
		         :BringToFront ( :IndirectRef 32003 )	
                     )
         }
  
         // -----------------------------------------------------

          {:Text 9000	
           :OrigContent  'Press key1 or key2, 
                          or click on one of the upper bitmaps. 
                          To change the size of the 
                          bitmap presentation, press cursor keys.'
           :OrigBoxSize 550 110
           :OrigPosition 10 490
           :FontAttributes Plain.18 :FontName Proportional
           :TextWrapping true 
          }

         {:PushButton 9001
           :OrigBoxSize   100  60
           :OrigPosition  590 480
           :ButtonRefColour gray
           :OrigLabel "back to main"
          }

          {:Link 9002
           :EventSource 9001 :EventType IsSelected
           :LinkEffect (  :TransitionTo( ( "demo/main.mhg" 0) ) )
          }

          {:Link 9003
           :EventSource 9001 :EventType CursorEnter
           :LinkEffect ( :Activate( 9005 ) )
          }
          {:Link 9004
           :EventSource 9001 :EventType CursorLeave
           :LinkEffect ( :DeActivate( 9005 ) )
          }
          {:Link 9005
           :InitiallyActive false
           :EventSource 0
           :EventType UserInput
           :EventData 15
           :LinkEffect ( :TransitionTo( ( "demo/main.mhg" 0) )
		  )
          }    
  
    )

    :InputEventReg 1
    :SceneCS 700 560
    :MovingCursor true
}

bitmap2.mhg:

{:Scene ( "demo/bitmap2.mhg" 0 )
  
  :Items (
          {:Text 1000
           :OrigContent  'Testing the drawing of Bitmaps, 2.Test:'
           :OrigBoxSize 500 30
           :OrigPosition 80 10
           :FontAttributes Bold.24 
           :FontName Proportional
          }    
	
	  {:Bitmap 101
             :OrigContent :ContentRef ( "demo/tu_klein.gif" )
	     :OrigBoxSize 51 39     // 0 0
	     :OrigPosition 10 5
	     :Tiling false
	     }

	  {:Bitmap 102
             :OrigContent :ContentRef ( "demo/fsp_pv.gif")
             :OrigBoxSize 48 43
	     :OrigPosition 595 5
	     :Tiling false
	     }

          {:Bitmap 103
             :OrigContent :ContentRef ( "demo/prz.gif" )
             :OrigBoxSize 48 43
	     :OrigPosition 645 5
	     :Tiling false
	     }

  {:Link  110
    :EventSource 0
    :EventType UserInput
    :EventData 16
    :LinkEffect (
                  :Quit (( "demo/startup" 0 ))
                )
   }

	  {:Bitmap 3000
	     :OrigContent
	     :ContentRef ( "demo/colors.gif" )
	     :OrigBoxSize 680 400
	     :OrigPosition 10 50
	     :Tiling false
	     }


          {:Bitmap 3100
	     :OrigContent
	     :ContentRef ( "demo/capbla.gif" )
	     :OrigBoxSize 180 208
	     :OrigPosition 50 100
	     :Tiling false
	     }
          {:Bitmap 3200
	     :OrigContent
	     :ContentRef ( "demo/capblb.gif" )
	     :OrigBoxSize  180 208
	     :OrigPosition 150 100
	     :Tiling false
	     }
          {:Bitmap 3300
	     :OrigContent
	     :ContentRef ( "demo/capblc.gif" )
	     :OrigBoxSize 180 208
	     :OrigPosition 50 200
	     :Tiling false
	     }
          {:Bitmap 3400
	     :OrigContent
	     :ContentRef ( "demo/capbld.gif" )
	     :OrigBoxSize 180 208
	     :OrigPosition 150 200
	     :Tiling false
	     }

          // {:Bitmap 3500
	  //   :OrigContent
	  //   :ContentRef ( "demo/globe.gif" )
	  //   :OrigBoxSize 0 0
	  //   :OrigPosition 450 200
	  //   :Tiling false
	  //   }

	  // ----------------------------

          {:Bitmap 5000
             :InitiallyActive false
	     :OrigContent
	     :ContentRef ( "demo/red_ball.gif" )
	     :OrigBoxSize 50 50
	     :OrigPosition 10 10
	     :Tiling true
	     }

	  // ----------------------------

          {:IntegerVar 32000 :OrigValue 320 }
          {:IntegerVar 32001 :OrigValue 158 }

          {:Link 1020
             :EventSource 0 :EventType UserInput :EventData 4
             :LinkEffect ( :GetBoxSize ( 5000 32000 32001 )
                           :Add        ( 32000 5 )
                           :SetBoxSize ( 5000 
                             :IndirectRef 32000 :IndirectRef 32001 ))}

          {:Link 1021
             :EventSource 0 :EventType UserInput :EventData 3
             :LinkEffect ( :GetBoxSize ( 5000 32000 32001 )
                           :Subtract   ( 32000 5 )
                           :SetBoxSize ( 5000 
                            :IndirectRef 32000 :IndirectRef 32001 ))}

          {:Link 1022
             :EventSource 0 :EventType UserInput :EventData 2
             :LinkEffect ( :GetBoxSize ( 5000 32000 32001 )
                           :Add        ( 32001 5 )
                           :SetBoxSize ( 5000 
                              :IndirectRef 32000 :IndirectRef 32001 ))}
          {:Link 1023
             :EventSource 0 :EventType UserInput :EventData 1
             :LinkEffect ( :GetBoxSize ( 5000 32000 32001 )
                           :Subtract   ( 32001 5 )
                           :SetBoxSize ( 5000 
                              :IndirectRef 32000 :IndirectRef 32001 ))}

          // -------


          {:Link 1030
             :EventSource 0 :EventType UserInput :EventData 14
             :LinkEffect ( :Run ( 5000 )
                           :BringToFront ( 9001 )
                         )
          }

          {:Link 1031
             :EventSource 0 :EventType UserInput :EventData 5
             :LinkEffect ( :Stop ( 5000 ) 
                         )
          }

          {:Link 2000
             :EventSource 0 :EventType UserInput :EventData 6
             :LinkEffect ( :BringToFront ( 3100 ) )
          }
          {:Link 2001
             :EventSource 0 :EventType UserInput :EventData 7
             :LinkEffect ( :BringToFront ( 3200 ) )
          }
          {:Link 2002
             :EventSource 0 :EventType UserInput :EventData 8
             :LinkEffect ( :BringToFront ( 3300 ) )
          }
          {:Link 2003
             :EventSource 0 :EventType UserInput :EventData 9
             :LinkEffect ( :BringToFront ( 3400 ) )
          }
  
          {:Link 2004
             :EventSource 0 :EventType UserInput :EventData 10
             :LinkEffect ( :PutBefore ( 3100 3000 ) )
          }
          {:Link 2005
             :EventSource 0 :EventType UserInput :EventData 11
             :LinkEffect ( :PutBefore ( 3200 3000 ) )
          }
          {:Link 2006
             :EventSource 0 :EventType UserInput :EventData 12
             :LinkEffect ( :PutBefore ( 3300 3000 ) )
          }
          {:Link 2007
             :EventSource 0 :EventType UserInput :EventData 13
             :LinkEffect ( :PutBefore ( 3400 3000 ) )
          }


          // ----------------------------------------------------------

          {:Text 9000	
           :OrigContent  'Press Key9 to activate a tiled bitmap, 
    	                     Key0 to deactivate it, 
                          and Cursor Keys to resize that bitmap.'
           :OrigBoxSize 550 110
           :OrigPosition 10 480
           :FontAttributes Plain.18 :FontName Proportional
           :TextWrapping true 
          }

         {:PushButton 9001
           :OrigBoxSize   100  60
           :OrigPosition  590 460
           :ButtonRefColour gray
           :OrigLabel "back to main"
          }

          {:Link 9002
           :EventSource 9001 :EventType IsSelected
           :LinkEffect (  :TransitionTo( ( "demo/main.mhg" 0) ) )
          }

          {:Link 9003
           :EventSource 9001 :EventType CursorEnter
           :LinkEffect ( :Activate( 9005 ) )
          }
          {:Link 9004
           :EventSource 9001 :EventType CursorLeave
           :LinkEffect ( :DeActivate( 9005 ) )
          }
          {:Link 9005
           :InitiallyActive false
           :EventSource 0
           :EventType UserInput
           :EventData 15
           :LinkEffect ( :TransitionTo( ( "demo/main.mhg" 0) )
		       )
          }
  

    )

    :InputEventReg 1
    :SceneCS 700 530
    :MovingCursor true
}

ea.mhg:

{:Scene ( "demo/ea.mhg" 0 )

 :Items
 (

   {:Text 1000
     :OrigContent  'Testing "Elementary Actions":'     
     :OrigBoxSize 500 30
     :OrigPosition 80 10
     :FontAttributes Bold.24 :FontName Proportional
   }

     {:Bitmap 101
             :OrigContent :ContentRef ( "demo/tu_klein.gif" )
	     :OrigBoxSize 51 39     // 0 0
	     :OrigPosition 10 5
	     :Tiling false
	     }

       {:Bitmap 102
        :OrigContent :ContentRef ( "demo/fsp_pv.gif")
             :OrigBoxSize 48 43
	     :OrigPosition 545 5
	     :Tiling false
	     }

       {:Bitmap 103
        :OrigContent :ContentRef ( "demo/prz.gif" )
             :OrigBoxSize 48 43
	     :OrigPosition 595 5
	     :Tiling false
	     }

  {:Link  110
    :EventSource 0
    :EventType UserInput
    :EventData 16
    :LinkEffect (
                  :Quit (( "demo/startup" 0 ))
                )
   }
 
   // ----------------------------------------------------

   // ElementaryActions for Rectangle

   {:Rectangle 4000
    :OrigBoxSize 100 100 :OrigPosition 20 130
    :OrigLineWidth 5 :OrigLineStyle 1
    :OrigRefLineColour Red :OrigRefFillColour DarkRed
   }
   {:Rectangle 4001
    :OrigBoxSize 100 100 :OrigPosition 60 170
    :OrigLineWidth 5 :OrigLineStyle 1
    :OrigRefLineColour Blue :OrigRefFillColour DarkBlue
   }

   // apply all ElementaryActions possible for Rectangle
   {:Link 4102
    :EventSource 0 :EventType UserInput :EventData 6
    :LinkEffect ( 
                  // Root
                     :GetAvailabilityStatus( 4000 2103)
                     :GetRunningStatus( 4000 2103 )
                  // Ingredient
                     :Clone( 4000 4200 )
                     :Preload( 4000 )
                     :SetData( 4000 "new data_1")
                     :Unload( 4000 )                    
                  // Presentable
                     :Run( 4000 )
                     :SetData( 4000 "new data_2" )
                     :Stop( 4000 )
                     :Run( 4000 )
                  // Visible
                     :BringToFront( 4000 )
                     :GetBoxSize( 4000 2101 2102 )
                     :GetPosition ( 4000 2101 2102 )
                     :PutBefore(4000 4001)
                     :PutBehind(4000 4001)
                     :SendToBack(4000)
                     :SetBoxSize(4000 150 100 )
                     :SetPaletteRef(4000 100)      
                     :SetPosition(4000 20 130)
                  // LineArt
	             :SetFillColour (4000 :NewAbsoluteColour blue)
	             :SetLineColour (4000 :NewAbsoluteColour red)
	             :SetLineStyle (4000 3)
	             :SetLineWidth (4000 6)
                     :PutBehind(4000 4001)
                )
    }

 
   // ----------------------------------------------------------


   // ElementaryActions for PushButton
   {:PushButton 5000
    :OrigBoxSize  100 100 
    :OrigPosition  200 130
    :ButtonRefColour darkYellow
    :OrigLabel "A Pushbutton"
   }

   {:Link 5100
    :EventSource 0 :EventType UserInput :EventData 7
    //:EventSource 5000 :EventType IsSelected
    :LinkEffect ( 
                   //Root:
	             :GetAvailabilityStatus(5000 2101)
	             :GetRunningStatus(5000 2103)
                   //Ingredient:
	             :Clone(5000 5200)
	             :Preload(5000)
	             :SetData(5000 "setdata, ingredient")
	             :Unload(5000)
                   //Presentable:
	             :Run(5000)
	             :SetData(5000 "setdata, presentable")
	             :Stop(5000)
                     :Run(5000)
                   //Visible:
	             :BringToFront(5000)
	             :GetBoxSize(5000 2101 2102)
	             :GetPosition(5000 2101 2102)
	             :PutBefore(5000 4000)
	             :PutBehind(5000 4000)
	             :SendToBack(5000)
	             :SetBoxSize(5000 120 90)
	             :SetPaletteRef(5000 1)
	             :SetPosition(5000 190 120)
                   //Button:
	             :Deselect(5000) 
	             :GetInteractionStatus(5000 2101)
	             :Select(5000)          
	             :SetInteractionStatus(5000  true)
                     :Deselect(5000)
                   //PushButton:
	             :GetLabel(5000 5300)
	             :Select(5000)
	             :SetLabel(5000 "Label set by EA")
                )
   }


    // -----------------------------------------------------

    // ElementaryActions for EntryField

    {:EntryField 2000
     :OrigContent 'A more complex one. vertically and horizontally centred.'
     :OrigBoxSize 300 100
     :OrigPosition 335 50 
     :FontAttributes Bold.10 :FontName Proportional
     :TextColour red
     :BackgroundColour white
     :HJustification centre
     :VJustification centre	
    }

    {:IntegerVar 2101 :OrigValue 1 }     
    {:IntegerVar 2102 :OrigValue 1 }     
    {:BooleanVar 2103 :OrigValue true} 

   // apply all ElementaryActions possible for Entryfield
    {:Link 2100
     :EventSource 0 :EventType UserInput :EventData 9
     :LinkEffect ( 
                  // Root
                        :GetAvailabilityStatus( 2000 2101 )
                        :GetRunningStatus( 2000 2103 )
                  // Ingredient
                        :Clone( 2000 4200 )
                        :Preload( 2000 )
                        :SetData( 2000 "new data_1")
                        :Unload( 2000 )                    
                  // Presentable
                        :Run( 2000 )
                        :SetData( 2000 "new data_2" )
                        :Stop( 2000 )
                        :Run( 2000 )
                  // Visible
                        :BringToFront( 2000 )
                        :GetBoxSize( 2000 2101 2102 )
                        :GetPosition ( 2000 2101 2102 )
                        :PutBefore(2000 4000)
                        :PutBehind(2000 4000)
                        :SendToBack(2000)
                        :SetBoxSize(2000 300 100 )
                        :SetPaletteRef(2000 100)      
                        :SetPosition(2000 335 50)
                  // Text
                        :GetTextContent(2000 2101)
                        :GetTextData(2000 2101)
                        :SetData( 2000 "new data_3" )   
                        //:SetFontRef(2000 "Bold:20")
                  // Interactible
                        :GetHighlightStatus(2000 2101)
                        :GetInteractionStatus(2000 2101)
                        :SetHighlightStatus(2000 true)
                        :SetInteractionStatus(2000 true)
                  // EntryField
                       :GetEntryPoint(2000 2101)
                       :GetOverwriteMode(2000 2101)
                       :SetEntryPoint(2000 5)
                       :SetOverwriteMode(2000 true)
                )
    }

  // ----------------------------------------------------------

    // ElementaryActions for DynamicLineArt

    {:DynamicLineArt 3000
     :OrigBoxSize 300 100
     :OrigPosition 335 160
    }

    // apply all ElementaryActions possible for DynamicLineArt	
    {:Link 3100
     :EventSource 0 :EventType UserInput :EventData 8
     :LinkEffect ( 
                  // Root
                        :GetAvailabilityStatus( 3000 2101 )
                        :GetRunningStatus( 3000 2103 )
                  // Ingredient
                        :Clone( 3000 4200 )
                        :Preload( 3000 )
                        :SetData( 3000 "new data_1")
                        :Unload( 3000 )                    
                  // Presentable
                        :Run( 3000 )
                        :SetData( 3000 "new data_2" )
                        :Stop( 3000 )
                        :Run( 3000 )
                  // Visible
                        :BringToFront( 3000 )
                        :GetBoxSize( 3000 2101 2102 )
                        :GetPosition ( 3000 2101 2102 )
                        :PutBefore(3000 4000)
                        :PutBehind(3000 4000)
                        :SendToBack(3000)
                        :SetBoxSize(3000 300 100 )
                        :SetPaletteRef(3000 100)      
                        :SetPosition(3000 335 160)

                  // LineArt
	                :SetFillColour(3000 :NewAbsoluteColour red)
	                :SetLineColour(3000 :NewAbsoluteColour blue)
	                :SetLineStyle(3000 3)
	                :SetLineWidth(3000 2)

                  //DynamicLineArt:
	                :BringToFront(3000)
	                :Clear(3000)
	                

                 :SetPosition(3000 335 160)	
	                :PutBefore(3000 2000)
	                :PutBehind(3000 2000)
	                :SendToBack(3000)
	                :SetBoxSize(3000 300 100)

	                :SetFillColour(3000 :NewAbsoluteColour red)
	                :SetLineColour(3000 :NewAbsoluteColour green)
	                :SetLineStyle(3000 2)
	                :SetLineWidth(3000 2)
	                :DrawArc(3000 5 5 100 50 30 180)

	                :SetFillColour(3000 :NewAbsoluteColour  red)
	                :SetLineColour(3000 :NewAbsoluteColour blue)
	                :SetLineStyle(3000 2)
	                :SetLineWidth(3000 10)
	                :DrawLine(3000 5 5 300 100)

	                :SetFillColour(3000 :NewAbsoluteColour green)
	                :SetLineColour(3000 :NewAbsoluteColour yellow)
	                :SetLineStyle(3000 1)
	                :SetLineWidth(3000 2)
	                :DrawOval(3000 5 50 100 45)

	                :SetFillColour(3000 :NewAbsoluteColour red)
	                :SetLineColour(3000 :NewAbsoluteColour yellow)
	                :SetLineStyle(3000 2)
	                :SetLineWidth(3000 6)
	                :DrawPolygon(3000 
                    ((100 5) (100 45) ( 150 30) (199 45) (199 5)))

	                :SetFillColour(3000 :NewAbsoluteColour red)
	                :SetLineColour(3000 :NewAbsoluteColour black)
	                :SetLineStyle(3000 2)
	                :SetLineWidth(3000 3)
	                :DrawPolyLine(3000 
                    ((100 60) (100 95) (150 80 ) (199 95) (199 60)))

	                :SetFillColour(3000 :NewAbsoluteColour gray)
	                :SetLineColour(3000 :NewAbsoluteColour red)
	                :SetLineStyle(3000 2)
	                :SetLineWidth(3000 3)
	                :DrawRectangle (3000 205 5  90 40) 

	                :SetFillColour(3000 :NewAbsoluteColour red)
	                :SetLineColour(3000 :NewAbsoluteColour green)
	                :SetLineStyle(3000 3)
	                :SetLineWidth(3000 2)
	                :DrawSector(3000 205 50 90 45 -30 180 )

		        

 	)
    }

    {:IntegerVar 3101 :OrigValue 30 }      // start_angle for arc   
    {:IntegerVar 3102 :OrigValue 10 }      // linewidth for line
    {:IntegerVar 3103 :OrigValue 100 }     // x-size for oval
    {:IntegerVar 3104 :OrigValue 150 }     // xPos of a point of polygon
    {:IntegerVar 3105 :OrigValue 80 }      // yPos of a point for polyline   
    {:IntegerVar 3106 :OrigValue 90 }      // xSize for rectangle
    {:IntegerVar 3107 :OrigValue 180 }      // arc_angle for sector

	
    {:Link 3200
     :EventSource 0 :EventType UserInput :EventData 1
     :LinkEffect ( 
                        :Add       ( 3101 5 )                  
                        :Add       ( 3102 1 )                  
                        :Add       ( 3103 10 )                  
                        :Add       ( 3104 5 )                  
                        :Add       ( 3105 5 ) 
                        :Add       ( 3106 10 )                  
                        :Add       ( 3107 10 )        

	                :Clear(3000)        
                        :GetBoxSize( 3000 2101 2102 )

	                :SetFillColour(3000 :NewAbsoluteColour red)
	                :SetLineColour(3000 :NewAbsoluteColour green)
	                :SetLineStyle(3000 2)
	                :SetLineWidth(3000 2)
	                :DrawArc(3000 5 5 100 50  :IndirectRef 3101 180)

	                :SetFillColour(3000 :NewAbsoluteColour red)
	                :SetLineColour(3000 :NewAbsoluteColour blue)
	                :SetLineStyle(3000 3)
	                :SetLineWidth(3000  :IndirectRef 3102)
	                :DrawLine(3000 5 5 300 100)

	                :SetFillColour(3000 :NewAbsoluteColour green)
	                :SetLineColour(3000 :NewAbsoluteColour yellow)
	                :SetLineStyle(3000 1)
	                :SetLineWidth(3000 4)
	                :DrawOval(3000 5 50  :IndirectRef 3103 45)

	                :SetFillColour(3000 :NewAbsoluteColour red)
	                :SetLineColour(3000 :NewAbsoluteColour yellow)
	                :SetLineStyle(3000 2)
	                :SetLineWidth(3000 6)
	                :DrawPolygon(3000 ((100 5) (100 45) 
                      (  :IndirectRef 3104 30) (199 45) (199 5)))

	                :SetFillColour(3000 :NewAbsoluteColour red)
	                :SetLineColour(3000 :NewAbsoluteColour black)
	                :SetLineStyle(3000 2)
	                :SetLineWidth(3000 3)
	                :DrawPolyLine(3000 ((100 60) (100 95) 
                      (150  :IndirectRef 3105 ) (199 95) (199 60)))

	                :SetFillColour(3000 :NewAbsoluteColour gray)
	                :SetLineColour(3000 :NewAbsoluteColour red)
	                :SetLineStyle(3000 2)
	                :SetLineWidth(3000 3)
	                :DrawRectangle (3000 205 5   :IndirectRef 3106 40) 

	                :SetFillColour(3000 :NewAbsoluteColour red)
	                :SetLineColour(3000 :NewAbsoluteColour green)
	                :SetLineStyle(3000 3)
	                :SetLineWidth(3000 2)
	                :DrawSector(3000 205 50 90 45 -30  :IndirectRef 3107 )
             )	
    }
    {:Link 3201
     :EventSource 0 :EventType UserInput :EventData 2
     :LinkEffect ( 
                        :Subtract       ( 3101 5 )                  
                        :Subtract       ( 3102 1 )                  
                        :Subtract       ( 3103 10 )                  
                        :Subtract       ( 3104 5 )                  
                        :Subtract       ( 3105 5 ) 
                        :Subtract       ( 3106 10 )                  
                        :Subtract       ( 3107 10 )                  

                        :Clear(3000)

	                :SetFillColour(3000 :NewAbsoluteColour red)
	                :SetLineColour(3000 :NewAbsoluteColour green)
	                :SetLineStyle(3000 2)
	                :SetLineWidth(3000 2)
	                :DrawArc(3000 5 5 100 50  :IndirectRef 3101 180)

	                :SetFillColour(3000 :NewAbsoluteColour red)
	                :SetLineColour(3000 :NewAbsoluteColour blue)
	                :SetLineStyle(3000 2)
	                :SetLineWidth(3000  :IndirectRef 3102)
	                :DrawLine(3000 5 5 300 100)

	                :SetFillColour(3000 :NewAbsoluteColour green)
	                :SetLineColour(3000 :NewAbsoluteColour yellow)
	                :SetLineStyle(3000 1)
	                :SetLineWidth(3000 2)
	                :DrawOval(3000 5 50  :IndirectRef 3103 45)

	                :SetFillColour(3000 :NewAbsoluteColour red)
	                :SetLineColour(3000 :NewAbsoluteColour yellow)
	                :SetLineStyle(3000 2)
	                :SetLineWidth(3000 6)
	                :DrawPolygon(3000 ((100 5) (100 45) 
                      (  :IndirectRef 3104 30) (199 45) (199 5)))

	                :SetFillColour(3000 :NewAbsoluteColour red)
	                :SetLineColour(3000 :NewAbsoluteColour black)
	                :SetLineStyle(3000 2)
	                :SetLineWidth(3000 3)
	                :DrawPolyLine(3000 ((100 60) (100 95) 
                      (150  :IndirectRef 3105 ) (199 95) (199 60)))

	                :SetFillColour(3000 :NewAbsoluteColour gray)
	                :SetLineColour(3000 :NewAbsoluteColour red)
	                :SetLineStyle(3000 2)
	                :SetLineWidth(3000 3)
	                :DrawRectangle (3000 205 5   :IndirectRef 3106 40) 

	                :SetFillColour(3000 :NewAbsoluteColour red)
	                :SetLineColour(3000 :NewAbsoluteColour green)
	                :SetLineStyle(3000 3)
	                :SetLineWidth(3000 2)
	                :DrawSector(3000 205 50 90 45 -30  :IndirectRef 3107 )
             )	
    }


 
  // ----------------------------------------------------------



   {:PushButton 9001
    :OrigBoxSize   100  60
    :OrigPosition  540 280 
    :ButtonRefColour gray
    :OrigLabel "back to main"
   }

   {:Link 9002
    :EventSource 9001 :EventType IsSelected
    :LinkEffect (  :TransitionTo( ( "demo/main.mhg" 0) ) )
   }

   {:Link 9003
    :EventSource 9001 :EventType CursorEnter
    :LinkEffect ( :Activate( 9005 ) )
   }
   {:Link 9004
    :EventSource 9001 :EventType CursorLeave
    :LinkEffect ( :DeActivate( 9005 ) )
   }
   {:Link 9005
      :InitiallyActive false
      :EventSource 0
      :EventType UserInput
      :EventData 15
      :LinkEffect ( :TransitionTo( ( "demo/main.mhg" 0) )
		  )
   }
  
 )

 :InputEventReg 1
 :SceneCS 650 350
 :MovingCursor true
}

allcl.mhg:

{:Scene ( "demo/allcl.mhg" 0 )

 :Items
 (

   {:Text 1000
     :OrigContent  'Testing all concrete Classes and el.Actions:'     
     :OrigBoxSize 500 30
     :OrigPosition 80 10
     :FontAttributes Bold.24 :FontName Proportional
   }

     {:Bitmap 101
             :OrigContent :ContentRef ( "demo/tu_klein.gif" )
	     :OrigBoxSize 51 39     // 0 0
	     :OrigPosition 10 5
	     :Tiling false
	     }

       {:Bitmap 102
        :OrigContent :ContentRef ( "demo/fsp_pv.gif")
             :OrigBoxSize 48 43
	     :OrigPosition 545 5
	     :Tiling false
	     }

       {:Bitmap 103
        :OrigContent :ContentRef ( "demo/prz.gif" )
             :OrigBoxSize 48 43
	     :OrigPosition 595 5
	     :Tiling false
	     }

  {:Link  110
    :EventSource 0
    :EventType UserInput
    :EventData 16
    :LinkEffect (
                  :Quit (( "demo/startup" 0 ))
                )
   }
  // ----------------------------------------------------------

  // Root 1008
  // Group 1009
  // Application 1010
  // Scene 1011
  // Ingredient 1012
  // Link 1013

  // ---- Programs (1014) ----

  {:ResidentPrg 1015
   :Name "Hello World, I'm a ResidentProgram."
  }
 
  {:RemotePrg 1016
   :Name "Hello World, I'm a RemoteProgram."
  }

  {:InterchgPrg 1017
   :Name "Hello World, I'm a InterchangedProgram."
  }

  {:Palette 1018
  }

  {:Font 1019
  }

  {:CursorShape 1020
  }

  // ---- Variables 1021 ----

  {:BooleanVar 1022
   :OrigValue true
  }

  {:IntegerVar 1023
   :OrigValue 1
  } 

  {:OStringVar 1024
   :OrigValue "hello world"
  }

  {:ObjectRefVar 1025
   :OrigValue :ObjectRef 1024
  }

  {:ContentRefVar 1026
   :OrigValue :ContentRef "demo/to_load.txt"
  }

  // ---- Presentables 1027 ----
  // TokenManager 1028

  {:TokenGroup 1029
   :TokenGroupItems ( ( 1024 ) )
  }

  {:ListGroup 1030
   :TokenGroupItems ( ( 1024 ) )
   :Positions ( ( 10 10 ) )
  }

  {:Stream 1037
   :Multiplex ( {:Audio 1038 :ComponentTag 100 }  )
  }

  {:Audio 1038
   :ComponentTag 100
  }

  // ---- Visibles ----

  {:Text 2000
    :OrigContent  'Bitmap, LineArt, Rectangle, Dynamic- LineArt:'
    :OrigBoxSize 95 95
    :OrigPosition 0 50
    :FontAttributes Bold.14
    :TextColour black
    :HJustification centre
    :VJustification centre
    :TextWrapping true 
   }

  {:Bitmap 1032	     
   :OrigContent :ContentRef ( "demo/pirogue.jpg" )
   :OrigBoxSize 120 120
   :OrigPosition 100 50
  }

  {:LineArt 1033
   :OrigBoxSize 120 120
   :OrigPosition 225 50
  }
 
  {:Rectangle 1034 
   :OrigBoxSize 120 120
   :OrigPosition 350 50          
   :OrigLineWidth 5 
   :OrigLineStyle 1
   :OrigRefLineColour Red
   :OrigRefFillColour Yellow
  }

  {:DynamicLineArt 1035 
   :OrigBoxSize 120 120
   :OrigPosition 475 50
  }

  // ---------------------------

  {:Text 2001
    :OrigContent  'Text, Video, RTGraphics:'
    :OrigBoxSize 95 95
    :OrigPosition 0 175
    :FontAttributes Bold.14
    :TextColour black
    :HJustification centre
    :VJustification centre
    :TextWrapping true 
   }

  {:Text 1036 
   :OrigContent  "I'm a simple Text"     	
   :OrigBoxSize 120 120
   :OrigPosition 100 175
   :TextColour red	
   :BackgroundColour black
   :HJustification centre	
   :VJustification centre
   :TextWrapping true
  }

  {:Video 1039
   :InitiallyActive true
   :OrigContent
   :ContentRef ( "demo/saao.m1v" )
   :OrigBoxSize 120 120
   :OrigPosition 225 175
   :ComponentTag 100
   :Termination loop	
  }

  {:RTGraphics 1040  
   :OrigBoxSize 120 120
   :OrigPosition 350 175
   :ComponentTag 100
  }

  // ---- Interactibles 1041 ----

  {:Text 2002
    :OrigContent  'Slider, EntryField, HyperText:'
    :OrigBoxSize 95 95
    :OrigPosition 0 300
    :FontAttributes Bold.14
    :TextColour black
    :HJustification centre
    :VJustification centre
    :TextWrapping true 
   }

  {:Slider 1042 
   :OrigBoxSize 120 120
   :OrigPosition 100 300
   :Orientation up
   :MaxValue 100
   :SliderStyle proportional
  }

  {:EntryField 1043 
   :OrigBoxSize 120 120
   :OrigPosition 225 300
  }

  {:HyperText 1044 
   :OrigContent 'HyperText: an anchor to 
       <a href="http://www.mheg.org">Tom Caseys</a> site'
   :OrigBoxSize 120 120
   :OrigPosition 350 300

  }

  // ---- Buttons 1045 ----

  {:Text 2003
    :OrigContent  'HotSpot, PushButton, SwitchButton:'
    :OrigBoxSize 95 95
    :OrigPosition 0 425
    :FontAttributes Bold.14
    :TextColour black
    :HJustification centre
    :VJustification centre
    :TextWrapping true 
   }

  {:Hotspot 1046 
   :OrigBoxSize 120 120
   :OrigPosition 100 425
  }

  {:PushButton 1047 
   :OrigBoxSize 120 120
   :OrigPosition 225 425
  }

  {:SwitchButton 1048 
   :OrigBoxSize 120 120
   :OrigPosition 350 425
   :ButtonStyle radiobutton
  }

  // TODO:  ___TODO___:
  //{:Action
  // (:Activate 1000)
  //}


  // ----------------------------------------------------------


  {:IntegerVar   3100 :OrigValue 1 }     
  {:IntegerVar   3101 :OrigValue 1 }     
  {:BooleanVar   3102 :OrigValue true }
  {:ObjectRefVAr 3103 :OrigValue :ObjectRef 3000}

  // apply all ElementaryActions possible for all classes
  {:Link 3000
   :EventSource 0 :EventType UserInput :EventData 6
   :LinkEffect ( 
                  // Root (using the bitmap: 1032) 
                   :GetAvailabilityStatus( 1032 3102 )
                   :GetRunningStatus( 1032 3102 )

	          // Scene
		   //:SendEvent(0 1)               // todo.
	           :GetCursorPosition(0 3100 3101)
	           :SetCursorPosition(0 100 100)
	           :SetCursorShape(1000 1000)
	           :SetTimer(0 1 2 :AbsoluteTime true)
	           //:TransitionTo()              // not so useful here.
	          
                 //Application:
	           //:CloseConnection()
	           //:GetEngineSupport()
	           //:Launch()
	           //:LockScreen()
	           //:OpenConnection()
	           //:Quit()
	           //:ReadPersistent()
	           //:Spawn()
	           //:StorePersistent()
	           //:UnlockScreen()

                  // Ingredient (using the bitmap: 1032) 
                   :Clone( 1032 1050 )
                   :Preload( 1032 )
                   :SetData( 1032 "new data_1")
                   :Unload( 1032 )                    

                  //Link:	
                   //:Activate()
	           //:Deactivate()
        
                  //Program (using resident program: 1015)
	           //:Call(1015 )
	           //:Fork(1015)
	           //:SetData(1015)
	           //:Stop(1015)

                  //Presentable (using the bitmap: 1032) 
	           //:Run(1032)
	           //:SetData(1032)
	           //:Stop(1032)

                  //Stream:
	           //:Clone()
	           :SetCounterEndPosition(1037 5)
	           :SetCounterPosition(1037 1)
	           :SetCounterTrigger(1037 2)
	           //:SetData(1037)
	           :SetSpeed(1037 25)

                  //Visible (using the bitmap: 1032)
	           :BringToFront(1032)
	           :GetBoxSize(1032 3100 3101)
	           :GetPosition(1032 3100 3101)
	           :PutBefore(1032 1035)
	           :PutBehind(1032 1035)
	           :SendToBack(1032)
	           :SetBoxSize(1032 60 60)
	           //:SetPaletteRef(1032)
	           :SetPosition(1032 100 50)

                  //RTGraphics:
	           //:Clone(1040)
	           //:SetData(1040)

                  //LineArt:
	           //:SetFillColour(1033)
	           //:SetLineColour(1033)
	           :SetLineStyle(1033 3)
	           :SetLineWidth(1033 2)

                  //DynamicLineArt:
	           :BringToFront(1035)
	           :Clear(1035)
	           :DrawArc(1035 10 10 30 30 0 180)
	           :DrawLine(1035 10 10 50 50)
	           :DrawOval(1035 20 20 50 30)
	           //:DrawPolygon(1035)
	           //:DrawPolyline(1035)
	           :DrawRectangle(1035 10 10 30 50)
	           :DrawSector(1035 30 30 40 40 90 180)
	           //:GetFillColour(1035)
	           //:GetLineColour(1035)
	           :GetLineStyle(1035 3100)
	           :GetLineWidth(1035 3100)
	           :PutBefore(1035 1032)
	           :PutBehind(1035 1032)
	           :SendToBack(1035)
	           :SetBoxSize(1035 90 90)
	           //:SetFillColour(1035)
	           //:SetLineColour(1035)
	           :SetLineStyle(1035 5)
	           :SetLineWidth(1035 6)
	           :SetPosition(1035 400 50)	

                  //Bitmap:
	           :ScaleBitmap(1032 50 50)
	           :SetTransparency(1032 25)

                  //Text:
	           //:GetTextContent(1036)
	           //:GetTextData(1036)
	           //:SetData(1036)
	           //:SetFontRef(1036)

                  //Interactible (using EntryField):
	           :GetHighlightStatus(1043 3102)
	           :GetInteractionStatus(1043 3102)
	           :SetHighlightStatus(1043 true)
	           :SetInteractionStatus(1043 true)
          
                  //EntryField:
	           :GetEntryPoint(1043 3101)
	           :GetOverwriteMode(1043 3102)
	           :SetEntryPoint(1043 4)
	           :SetOverwriteMode(1043 false)

                  //HyperText:
	           //:GetLastAnchorField(1044)

                  //Video:
                   //:Clone(1039)
	           :ScaleVideo(1039 30 30)
	           //:SetData(1039)
       
                  //Slider:
	           :GetPortion(1042 3101)
	           :GetSliderValue(1042 3101)
	           :SetPortion(1042 50)
	           :SetSliderValue(1042 25)
	           :Step(1042 1)

                  //Button (using PushButton)
	           :Deselect(1047) 
	           :GetInteractionStatus(1047 3102)
	           :Select(1047)          
	           :SetInteractionStatus(1047 true)

                  //HotSpot:
	           :Select(1046) 

                  //PushButton:
	           //:GetLabel(1047)
	           :Select(1047)
	           :SetLabel(1047 "new Label")

                  //SwitchButton:
	           :Deselect(1048) 
	           :GetSelectionStatus(1048 3102)
	           :Select(1048)
	           :SetLabel(1048 "new Label")
	           //:Toggle(1048)

                  //Audio:
                   //:Clone(1038)
	           :GetVolume(1038 3100)
	           //:SetData(1038)
	           //:SetVolume(1038 100)

                  //TokenGroup:
	           //:CallActionSlot(1029)

                  //ListGroup:
	           :AddItem(1030 1 1032)
	           :DelItem(1030 1032)
	           :DeselectItem(1030 2)
	           :GetCellItem(1030 2 1032)
	           :GetFirstItem(1030 1032)
	           //:GetItemStatus(1030)
	           //:GetListItem(1030)
	           //:GetListSize(1030)
	           //:ScrollItems(1030)
	           //:SelectItem(1030)
	           //:SetFirstItem(1030)
	           //:ToggleItem(1030)
          
                  //TokenManager (using TokenGroup):
	           //:GetTokenPosition(1029)
	           //:Move(1029)
	           //:MoveTo(1029)
         
                  //Variable (using IntegerVariable):
	           //:SetVariable(1023)
	           //:TestVariable(1023)
      
                  //IntegerVariable:
	           //:Add(1023)
	           //:Divide(1023)
	           //:Modulo(1023)
	           //:Multiply(1023)
                   //:SetVariable(1023)
	           //:Subtract(1023)

                  //BooleanVariable:
                   //:SetVariable(1022 )

                  //OctetStringVariable:
                   //:SetVariable(1024)
                   //:Append(1024)

                  //ObjectRefVariable:
                   //:SetVariable(1025)

                  //ContentRefVariable:
                   //:SetVariable(1026)

   )
  }

  // ----------------------------------------------------------


   {:PushButton 9001
    :OrigBoxSize   100  60
    :OrigPosition  540 480 
    :ButtonRefColour gray
    :OrigLabel "back to main"
   }

   {:Link 9002
    :EventSource 9001 :EventType IsSelected
    :LinkEffect (  :TransitionTo( ( "demo/main.mhg" 0) ) )
   }

   {:Link 9003
    :EventSource 9001 :EventType CursorEnter
    :LinkEffect ( :Activate( 9005 ) )
   }
   {:Link 9004
    :EventSource 9001 :EventType CursorLeave
    :LinkEffect ( :DeActivate( 9005 ) )
   }
   {:Link 9005
      :InitiallyActive false
      :EventSource 0
      :EventType UserInput
      :EventData 15
      :LinkEffect ( :TransitionTo( ( "demo/main.mhg" 0) )
		  )
   }
  

 )

 :InputEventReg 1
 :SceneCS 650 550
 :MovingCursor true
}

token.mhg:

{:Scene ( "demo/tokentest.mhg" 0 )

 :Items
 (
   {:Text 500 :InitiallyActive false
    :OrigContent  'TokenGroup is running'
    :OrigBoxSize 500 30
    :OrigPosition 70 2
    :FontAttributes Bold.18 :FontName Proportional
   }
   {:Text 501 :InitiallyActive true
    :OrigContent  'TokenGroup is not running' 
    :OrigBoxSize 500 30
    :OrigPosition 70 2
    :FontAttributes Bold.18 :FontName Proportional
   }

   {:PushButton 50 :InitiallyActive true
    :OrigBoxSize 150 30 :OrigPosition 10 175
    :ButtonrefColour Gray :OrigLabel "Run TokenGroup" }
   {:Link 60 :EventSource 50 :EventType IsSelected
    :LinkEffect ( :MoveTo( 1000 0 )
                  :CallActionSlot( 1000 1 )
                  :Run( 1000 ) )}

   {:PushButton 51 :InitiallyActive true
    :OrigBoxSize 150 30 :OrigPosition 160 175
    :ButtonRefColour Gray :OrigLabel "Stop TokenGroup" }
   {:Link 62 :EventSource 51 :EventType IsSelected
    :LinkEffect ( :MoveTo( 1000 0 )
                  :CallActionSlot( 1000 2 )
                  :Stop( 1000 ))}

   {:Link 100 :EventSource 101 :EventType IsSelected
    :LinkEffect ( :GetTokenPosition( 1000 104 )
                  :SetVariable( 103 :GInteger :IndirectRef 104 )
                  :SetVariable( 102 :GOctetString "Query TokenPosition<" )
                  :Append     ( 102 :IndirectRef 103 )
                  :Append     ( 102 ">" )
                  :SetLabel   ( 101 :IndirectRef 102 ) )
   }
   {:PushButton 101 :InitiallyActive true
    :OrigBoxSize 300 30 :OrigPosition 10 205
    :ButtonRefColour Gray :OrigLabel "Query TokenPosition<?>" }
   {:OStringVar 102 :OrigValue "" }
   {:OStringVar 103 :OrigValue "" }
   {:IntegerVar 104 :OrigValue -1 }

   {:PushButton 106 :InitiallyActive true
    :OrigBoxSize 100 30 :OrigPosition 10 235
    :ButtonRefColour Gray :OrigLabel "NextItem" }
   {:PushButton 107 :InitiallyActive true
    :OrigBoxSize 100 30 :OrigPosition 110 235
    :ButtonRefColour Gray :OrigLabel "PrevItem" }

   {:Link 111 :EventSource 106 :EventType IsSelected
    :LinkEffect( :Move( 1000 1 ) ) }
   {:Link 112 :EventSource 107 :EventType IsSelected
    :LinkEffect( :Move( 1000 2 ) ) }

   {:PushButton 120 :InitiallyActive true
    :OrigBoxSize 60 30 :OrigPosition 10 265
    :ButtonRefColour Gray :OrigLabel "MoveTo1" }
   {:PushButton 121 :InitiallyActive true
    :OrigBoxSize 60 30 :OrigPosition 70 265
    :ButtonRefColour Gray :OrigLabel "MoveTo2" }
   {:PushButton 122 :InitiallyActive true
    :OrigBoxSize 60 30 :OrigPosition 130 265
    :ButtonRefColour Gray :OrigLabel "MoveTo3" }
   {:PushButton 123 :InitiallyActive true
    :OrigBoxSize 60 30 :OrigPosition 190 265
    :ButtonRefColour Gray :OrigLabel "MoveTo4" }
   {:PushButton 124 :InitiallyActive true
    :OrigBoxSize 60 30 :OrigPosition 250 265
    :ButtonRefColour Gray :OrigLabel "MoveTo5" }

   {:Link 125 :EventSource 120 :EventType IsSelected
    :LinkEffect( :MoveTo( 1000 1 ) ) }
   {:Link 126 :EventSource 121 :EventType IsSelected
    :LinkEffect( :MoveTo( 1000 2 ) ) }
   {:Link 127 :EventSource 122 :EventType IsSelected
    :LinkEffect( :MoveTo( 1000 3 ) ) }
   {:Link 128 :EventSource 123 :EventType IsSelected
    :LinkEffect( :MoveTo( 1000 4 ) ) }
   {:Link 129 :EventSource 124 :EventType IsSelected
    :LinkEffect( :MoveTo( 1000 5 ) ) }

   {:Rectangle 4711 :InitiallyActive false
    :OrigBoxSize 64 64 :OrigPosition 40 25 :OrigLineWidth 4 :OrigLineStyle 1
    :OrigRefLineColour DarkRed :OrigRefFillColour Red
   }
   {:Rectangle 4712 :InitiallyActive false
    :OrigBoxSize 64 64 :OrigPosition 78 45 :OrigLineWidth 4 :OrigLineStyle 1
    :OrigRefLineColour DarkGray :OrigRefFillColour Gray
   }
   {:Rectangle 4713 :InitiallyActive false
    :OrigBoxSize 64 64 :OrigPosition 116 65 :OrigLineWidth 4 :OrigLineStyle 1
    :OrigRefLineColour DarkBlue :OrigRefFillColour Blue
   }
   {:Rectangle 4714 :InitiallyActive false
    :OrigBoxSize 64 64 :OrigPosition 154 85 :OrigLineWidth 4 :OrigLineStyle 1
    :OrigRefLineColour DarkGreen :OrigRefFillColour Green
   }
   {:Rectangle 4715 :InitiallyActive false
    :OrigBoxSize 64 64 :OrigPosition 192 105 :OrigLineWidth 4 :OrigLineStyle 1
    :OrigRefLineColour DarkMagenta :OrigRefFillColour Magenta
   }

   {:Link 1001 :EventSource 1000 :EventType TokenMovedFrom :EventData 1
    :LinkEffect ( :CallActionSlot( 1000 1 ) )}
   {:Link 1002 :EventSource 1000 :EventType TokenMovedTo :EventData 1
    :LinkEffect ( :CallActionSlot( 1000 2 ) )}
   {:Link 1003 :EventSource 1000 :EventType TokenMovedFrom :EventData 2
    :LinkEffect ( :CallActionSlot( 1000 1 ) )}
   {:Link 1004 :EventSource 1000 :EventType TokenMovedTo :EventData 2
    :LinkEffect ( :CallActionSlot( 1000 2 ) )}
   {:Link 1005 :EventSource 1000 :EventType TokenMovedFrom :EventData 3
    :LinkEffect ( :CallActionSlot( 1000 1 ) )}
   {:Link 1006 :EventSource 1000 :EventType TokenMovedTo :EventData 3
    :LinkEffect ( :CallActionSlot( 1000 2 ) )}
   {:Link 1007 :EventSource 1000 :EventType TokenMovedFrom :EventData 4
    :LinkEffect ( :CallActionSlot( 1000 1 ) )}
   {:Link 1008 :EventSource 1000 :EventType TokenMovedTo :EventData 4
    :LinkEffect ( :CallActionSlot( 1000 2 ) )}
   {:Link 1009 :EventSource 1000 :EventType TokenMovedFrom :EventData 5
    :LinkEffect ( :CallActionSlot( 1000 1 ) )}
   {:Link 1010 :EventSource 1000 :EventType TokenMovedTo :EventData 5
    :LinkEffect ( :CallActionSlot( 1000 2 ) )}


   {:TokenGroup 1000 
    :InitiallyActive false
    :Shared false
    :MovementTable
      (
        (2 3 4 5 1 )
        (5 1 2 3 4 )
      )
    :TokenGroupItems
      (
        (4711
          :ActionSlots
          (
            (:SetFillColour(4711 :NewAbsoluteColour red))
            (:SetFillColour(4711 :NewAbsoluteColour transparent))
          )
        )
        ( 4712 
          :ActionSlots
          (
            (:SetFillColour(4712 :NewAbsoluteColour gray))
            (:SetFillColour(4712 :NewAbsoluteColour transparent))
          )
        )
        ( 4713
          :ActionSlots
          (
            (:SetFillColour(4713 :NewAbsoluteColour blue))
            (:SetFillColour(4713 :NewAbsoluteColour transparent))
          )
        )
        ( 4714 
          :ActionSlots
          (
            (:SetFillColour(4714 :NewAbsoluteColour green))
            (:SetFillColour(4714 :NewAbsoluteColour transparent))
          )
        )
        ( 4715
          :ActionSlots
          (
            (:SetFillColour(4715 :NewAbsoluteColour magenta))
            (:SetFillColour(4715 :NewAbsoluteColour transparent))
          )
        )
      )
    :NoTokenActionSlots
      (
        (:Run( 500 ) :Stop( 501 ) )
        (:Run( 501 ) :Stop( 500 ) )
      )
    }
 


    {:PushButton 9001
     :OrigBoxSize   100  30
     :OrigPosition  210 300
     :ButtonRefColour gray
     :OrigLabel "back to main"
    }

    {:Link 9002
     :EventSource 9001 :EventType IsSelected
     :LinkEffect (  :TransitionTo( ( "demo/main.mhg" 0) ) )
    }


   {:Link 9003
    :EventSource 9001 :EventType CursorEnter
    :LinkEffect ( :Activate( 9005 ) )
   }
   {:Link 9004
    :EventSource 9001 :EventType CursorLeave
    :LinkEffect ( :DeActivate( 9005 ) )
   }
   {:Link 9005
      :InitiallyActive false
      :EventSource 0
      :EventType UserInput
      :EventData 15
      :LinkEffect ( :TransitionTo( ( "demo/main.mhg" 0) )
		  )
   }
  


 )

 :InputEventReg 1
 :SceneCS 320 350
 :MovingCursor true
}


next up previous
Next: More Examples Up: An MHEG Player Java Previous: MHEG Example
Dave Marshall
10/4/2001