home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / AMT / Sample AMT⁄PE Code / SOURCES / NAVIGATION.k < prev    next >
Encoding:
Text File  |  1996-03-04  |  8.5 KB  |  486 lines  |  [TEXT/MPS ]

  1. class cMenuSelector
  2. is
  3.     cEmptyHandler;
  4. has
  5.     RowID;            --which row in self.container.MenuData to use
  6.     RowData;        --the actual data in the row
  7.     
  8.     SetEnable()
  9.         do
  10.             self.Enable(false);
  11.             
  12.             self.RowData := self.container.CurMenu @ self.RowID;
  13.             if self.RowData <> void then
  14.                 self.Enable(true);
  15.             end;
  16.         end;
  17. end;
  18.  
  19.  
  20. class cMainMenuSelectorBehavior 
  21. is
  22.     cDefaultBehavior;
  23. has
  24.                     
  25.     MouseUp(theTarget, theX, theY)
  26.         use
  27.             theDoc;
  28.         do
  29.             if (((theTarget.RowData @ 1) - "OPEN") = 0) then
  30.                 LAUNCHER_HELPER.GetParams();
  31.                 theDoc := LAUNCHER_HELPER.ThePath + (theTarget.RowData @ 2);
  32.                 GML_LAUNCHER.Open(theDoc);
  33.  
  34.             else if (((theTarget.RowData @ 1) - "LAUNCH") = 0) then
  35.                 LAUNCHER_HELPER.GetParams();
  36.                 theDoc := LAUNCHER_HELPER.ThePath + (theTarget.RowData @ 2);
  37.                 oPOPUP_PIC_3_29.Show(true);
  38.                 oBTNABRT_PIC_3_31.Show(true);
  39.                 oBTNABRT_PIC_3_31.Enable(true);
  40.                 oBTNCONT_PIC_3_32.Show(true);
  41.                 oBTNCONT_PIC_3_32.Enable(true);
  42.                 
  43.                 CURSPOTS.CurrentSpots := MAINMENUSELECTORSPOTS;
  44.                 oBTNCONT_PIC_3_32.SetLaunchDoc(theDoc);
  45.             end;
  46.         end;
  47. end;
  48.  
  49. class cMenuSelectorBehavior 
  50. is
  51.     cDefaultBehavior;
  52. has
  53.     OffScreen(theTarget)
  54.         do
  55.             theTarget.Enable(false);
  56.             
  57.             theTarget.RowData := theTarget.container.MenuData @ theTarget.RowID;
  58.             if theTarget.RowData <> void then
  59.                 theTarget.Enable(true);
  60.             end;
  61.         end;
  62.             
  63.     MouseEnter(theTarget, thex, theY)
  64.         do
  65.             oARROWS_PIC_3_27.MoveTo(oARROWS_PIC_3_27.X, theTarget.Y + 3);
  66.         end;
  67.         
  68.     MouseUp(theTarget, theX, theY)
  69.         use
  70.             theDoc;
  71.         do
  72.             if (((theTarget.RowData @ 1) - "OPEN") = 0) then
  73.                 LAUNCHER_HELPER.GetParams();
  74.                 theDoc := LAUNCHER_HELPER.ThePath + (theTarget.RowData @ 2);
  75.                 GML_LAUNCHER.Open(theDoc);
  76.  
  77.             else if (((theTarget.RowData @ 1) - "LAUNCH") = 0) then
  78.                 LAUNCHER_HELPER.GetParams();
  79.                 theDoc := LAUNCHER_HELPER.ThePath + (theTarget.RowData @ 2);
  80.                 oPOPUP_PIC_3_29.Show(true);
  81.                 oBTNABRT_PIC_3_31.Show(true);
  82.                 oBTNABRT_PIC_3_31.Enable(true);
  83.                 oBTNCONT_PIC_3_32.Show(true);
  84.                 oBTNCONT_PIC_3_32.Enable(true);
  85.                 
  86.                 CURSPOTS.CurrentSpots := MENUSELECTORSPOTS;
  87.                 oBTNCONT_PIC_3_32.SetLaunchDoc(theDoc);
  88.             end;
  89.         end;
  90. end;
  91.  
  92.  
  93.  
  94. object CURSPOTS is ANY
  95. has
  96.     CurrentSpots;
  97. with
  98.     CurrentSpots is MAINMENUSELECTORSPOTS;
  99. end;
  100.  
  101.  
  102. object MENUSELECTORSPOTS is COLLECTION
  103. with
  104.     Items is [
  105.         oROW1_3_9,
  106.         oROW2_3_11,
  107.         oROW3_3_12,
  108.         oROW4_3_13,
  109.         oROW5_3_18,
  110.         oROW6_3_19,
  111.         oROW7_3_40,
  112.         oROW8_3_41,
  113.         oROW9_3_42,
  114.         oROW10_3_43,
  115.         oROW11_3_44,
  116.         oROW12_3_45
  117.     ];
  118. end;
  119.  
  120.  
  121. object MAINMENUSELECTORSPOTS is COLLECTION
  122. with
  123.     Items is [
  124.         oMENU1_3_9,
  125.         oMENU2_3_11,
  126.         oMENU3_3_12,
  127.         oMENU4_3_13,
  128.         oMENU5_3_18,
  129.         oMENU6_3_19,
  130.         oMENU7_3_40,
  131.         oMENU8_3_41,
  132.         oMENU9_3_42,
  133.         oMENU10_3_43,
  134.         oMENU11_3_44,
  135.         oMENU12_3_45,
  136.         oMENU13_3_45
  137.     ];
  138. end;
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151. object oBTNMM_PIC_3_33 is cFlipbookHandler
  152. with
  153.     FirstFrame is 0;
  154.     Looping is false;
  155.     Rythm is 1;
  156.     Supplier is oBTNMM_PIC_26_;
  157.     Behavior is cDefaultBehavior
  158.     has
  159.         Offscreen(theTarget)
  160.             do
  161.                 theTarget.Enable(true);
  162.                 theTarget.Show(true);
  163.             end;
  164.         
  165.         MouseDown(theTarget, theX, theY)
  166.             do
  167.                 theTarget.GotoEnd();
  168.             end;
  169.         
  170.         MouseUp(theTarget, theX, theY)
  171.             do
  172.                 theTarget.GoToBeginning();
  173.                 oBinder.Goto(oMMENU_2);
  174.             end;
  175.         
  176.     with
  177.         Enabled is true; Shown is true; 
  178.         X is 542; Y is 87; Width is 66; Height is 30;
  179.     end;
  180. end;
  181.  
  182.  
  183. object oBTNPROD_3_46 is cFlipbookHandler
  184. with
  185.     FirstFrame is 0;
  186.     Looping is false;
  187.     Rythm is 1;
  188.     Supplier is oBTNPROD_PIC_23_;
  189.     Behavior is cDefaultBehavior
  190.     has
  191.         Offscreen(theTarget)
  192.             do
  193.                 theTarget.Enable(true);
  194.                 theTarget.Show(true);
  195.             end;
  196.         
  197.         MouseDown(theTarget, theX, theY)
  198.             do
  199.                 theTarget.GotoEnd();
  200.             end;
  201.         
  202.         MouseUp(theTarget, theX, theY)
  203.             do
  204.                 theTarget.GoToBeginning();
  205.                 oBinder.Goto(oPRODINFO_3);
  206.             end;
  207.         
  208.     with
  209.         Enabled is true; Shown is true; 
  210.         X is 542; Y is 155; Width is 66; Height is 30;
  211.     end;
  212. end;
  213.  
  214.  
  215. object oBTNSUCC_3_35 is cFlipbookHandler
  216. with
  217.     FirstFrame is 0;
  218.     Looping is false;
  219.     Rythm is 1;
  220.     Supplier is oBTNSUCC_PIC_28_;
  221.     Behavior is cDefaultBehavior
  222.     has
  223.         Offscreen(theTarget)
  224.             do
  225.                 theTarget.Enable(true);
  226.                 theTarget.Show(true);
  227.             end;
  228.         
  229.         MouseDown(theTarget, theX, theY)
  230.             do
  231.                 theTarget.GotoEnd();
  232.             end;
  233.         
  234.         MouseUp(theTarget, theX, theY)
  235.             do
  236.                 theTarget.GoToBeginning();
  237.                 oBinder.Goto(oSUCCSTORY_4);
  238.             end;
  239.         
  240.     with
  241.         Enabled is true; Shown is true; 
  242.         X is 542; Y is 220; Width is 66; Height is 30;
  243.     end;
  244. end;
  245.  
  246.  
  247. object oBTNREF_3_36 is cFlipbookHandler
  248. with
  249.     FirstFrame is 0;
  250.     Looping is false;
  251.     Rythm is 1;
  252.     Supplier is oBTNREF_PIC_25_;
  253.     Behavior is cDefaultBehavior
  254.     has
  255.         Offscreen(theTarget)
  256.             do
  257.                 theTarget.Enable(true);
  258.                 theTarget.Show(true);
  259.             end;
  260.         
  261.         MouseDown(theTarget, theX, theY)
  262.             do
  263.                 theTarget.GotoEnd();
  264.             end;
  265.         
  266.         MouseUp(theTarget, theX, theY)
  267.             do
  268.                 theTarget.GoToBeginning();
  269.                 oBinder.Goto(oREF_5);
  270.             end;
  271.         
  272.     with
  273.         Enabled is true; Shown is true; 
  274.         X is 542; Y is 266; Width is 66; Height is 30;
  275.     end;
  276. end;
  277.  
  278.  
  279. object oBTNTUTR_3_37 is cFlipbookHandler
  280. with
  281.     FirstFrame is 0;
  282.     Looping is false;
  283.     Rythm is 1;
  284.     Supplier is oBTNTUTR_PIC_24_;
  285.     Behavior is cDefaultBehavior
  286.     has
  287.         Offscreen(theTarget)
  288.             do
  289.                 theTarget.Enable(true);
  290.                 theTarget.Show(true);
  291.             end;
  292.         
  293.         MouseDown(theTarget, theX, theY)
  294.             do
  295.                 theTarget.GotoEnd();
  296.             end;
  297.         
  298.         MouseUp(theTarget, theX, theY)
  299.             do
  300.                 theTarget.GoToBeginning();
  301.                 oBinder.Goto(oTUT_6);
  302.             end;
  303.         
  304.     with
  305.         Enabled is true; Shown is true; 
  306.         X is 542; Y is 324; Width is 66; Height is 30;
  307.     end;
  308. end;
  309.  
  310.  
  311. object oBTNSAMPL_3_38 is cFlipbookHandler
  312. with
  313.     FirstFrame is 0;
  314.     Looping is false;
  315.     Rythm is 1;
  316.     Supplier is oBTNSAMPL_PIC_29_;
  317.     Behavior is cDefaultBehavior
  318.     has
  319.         Offscreen(theTarget)
  320.             do
  321.                 theTarget.Enable(true);
  322.                 theTarget.Show(true);
  323.             end;
  324.         
  325.         MouseDown(theTarget, theX, theY)
  326.             do
  327.                 theTarget.GotoEnd();
  328.             end;
  329.         
  330.         MouseUp(theTarget, theX, theY)
  331.             do
  332.                 theTarget.GoToBeginning();
  333.                 oBinder.Goto(oSAMPMEDIA_7);
  334.             end;
  335.         
  336.     with
  337.         Enabled is true; Shown is true; 
  338.         X is 542; Y is 390; Width is 66; Height is 30;
  339.     end;
  340. end;
  341.  
  342.  
  343. object oBTNQUIT_3_39 is cFlipbookHandler
  344. with
  345.     FirstFrame is 0;
  346.     Looping is false;
  347.     Rythm is 1;
  348.     Supplier is oBTNQUIT_PIC_27_;
  349.     Behavior is cDefaultBehavior
  350.     has
  351.         Offscreen(theTarget)
  352.             do
  353.                 theTarget.Enable(true);
  354.                 theTarget.Show(true);
  355.             end;
  356.         
  357.         MouseDown(theTarget, theX, theY)
  358.             do
  359.                 theTarget.GotoEnd();
  360.             end;
  361.         
  362.         MouseUp(theTarget, theX, theY)
  363.             do
  364.                 theTarget.GoToBeginning();
  365.                 oBinder.Quit();
  366.             end;
  367.         
  368.     with
  369.         Enabled is true; Shown is true; 
  370.         X is 542; Y is 456; Width is 66; Height is 24;
  371.     end;
  372. end;
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381. object oPOPUP_PIC_3_29 is cPictureHandler
  382. with
  383.     Duration is -1;
  384.     Supplier is oPOPUP_PIC_39_;
  385.     Behavior is cDefaultBehavior
  386.     has
  387.         Offscreen(theTarget)
  388.             do
  389.                 theTarget.Enable(false);
  390.                 theTarget.Show(false);
  391.             end;
  392.         
  393.     with
  394.         Enabled is true; Shown is true; 
  395.         X is 215; Y is 189; Width is 210; Height is 102;
  396.     end;
  397. end;
  398.  
  399.  
  400. object oBTNABRT_PIC_3_31 is cFlipbookHandler
  401. with
  402.     FirstFrame is 0;
  403.     Looping is false;
  404.     Rythm is 1;
  405.     Supplier is oBTNABRT_PIC_37_;
  406.     Behavior is cDefaultBehavior
  407.     has
  408.         Offscreen(theTarget)
  409.             do
  410.                 theTarget.Enable(false);
  411.                 theTarget.Show(false);
  412.             end;
  413.         
  414.         MouseDown(theTarget, theX, theY)
  415.             do
  416.                 theTarget.Enable(true);
  417.                 theTarget.GotoEnd();
  418.             end;
  419.         
  420.         MouseUp(theTarget, theX, theY)
  421.             do
  422.                 CURSPOTS.CurrentSpots.EachUp(OffScreen);
  423.                 theTarget.GoToBeginning();
  424.                 oPOPUP_PIC_3_29.Show(false);
  425.                 oBTNABRT_PIC_3_31.Show(false);
  426.                 oBTNABRT_PIC_3_31.Enable(false);
  427.                 oBTNCONT_PIC_3_32.Show(false);
  428.                 oBTNCONT_PIC_3_32.Enable(false);
  429.                 theTarget.Enable(false);
  430.                 theTarget.Show(false);
  431.             end;
  432.         
  433.     with
  434.         Enabled is true; Shown is true; 
  435.         X is 215; Y is 271; Width is 104; Height is 20;
  436.     end;
  437. end;
  438.  
  439.  
  440. object oBTNCONT_PIC_3_32 is cFlipbookHandler
  441. has
  442.     LaunchDoc;
  443.             
  444.     SetLaunchDoc(theDoc)
  445.         do
  446.             CURSPOTS.CurrentSpots.EachUp(OffScreen);
  447.             self.LaunchDoc := theDoc;
  448.         end;
  449. with
  450.     FirstFrame is 0;
  451.     Looping is false;
  452.     Rythm is 1;
  453.     Supplier is oBTNCONT_PIC_38_;
  454.     Behavior is cDefaultBehavior
  455.     has
  456.         Offscreen(theTarget)
  457.             do
  458.                 theTarget.Enable(false);
  459.                 theTarget.Show(false);
  460.             end;
  461.         
  462.         MouseDown(theTarget, theX, theY)
  463.             do
  464.                 theTarget.Enable(true);
  465.                 theTarget.GotoEnd();
  466.             end;
  467.         
  468.         MouseUp(theTarget, theX, theY)
  469.             do
  470.                 CURSPOTS.CurrentSpots.EachUp(OffScreen);
  471.                 theTarget.GoToBeginning();
  472.                 oPOPUP_PIC_3_29.Show(false);
  473.                 oBTNABRT_PIC_3_31.Show(false);
  474.                 oBTNABRT_PIC_3_31.Enable(false);
  475.                 oBTNCONT_PIC_3_32.Show(false);
  476.                 oBTNCONT_PIC_3_32.Enable(false);
  477.                 GML_LAUNCHER.Open(theTarget.LaunchDoc);
  478.             end;
  479.         
  480.     with
  481.         Enabled is true; Shown is true; 
  482.         X is 321; Y is 271; Width is 104; Height is 20;
  483.     end;
  484. end;
  485.  
  486.