home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 10: University / CDAT10.iso / TUTORIALES.DXR / 00002_Menu.ls < prev    next >
Encoding:
Text File  |  1999-10-20  |  2.4 KB  |  93 lines

  1. property Distancia
  2. global texto, Ruta, ListaCP, OpcionesCat, OpcionesSubcat, OpcionesProg, spIdioma, spFormato, spLinea, spSubCat, spSO, colorOpciones, colorSeleccion
  3.  
  4. on mouseUp me
  5.   pointClicked = the mouseLoc
  6.   Miembro = sprite(the currentSpriteNum).member
  7.   opcion = PointToLine(sprite(the currentSpriteNum), pointClicked)
  8.   Distancia = sprite(the currentSpriteNum).locV + linePosToLocV(Miembro, opcion) - 7
  9.   if (opcion >= Miembro.text.lines.count) or (opcion < 0) then
  10.     exit
  11.   end if
  12.   Miembro.forecolor = colorOpciones
  13.   Miembro.line[opcion].forecolor = colorSeleccion
  14.   updateStage()
  15.   case Miembro.name of
  16.     "Categorias":
  17.       ClickMenu(OpcionesCat, opcion)
  18.     "Subcategorias":
  19.       ClickMenu(OpcionesSubcat, opcion)
  20.     "Programas":
  21.       ClickMenu(OpcionesProg, opcion)
  22.   end case
  23.   puppetTransition(0)
  24.   updateStage()
  25. end
  26.  
  27. on ClickMenu menu, opcion
  28.   Padre = menu[opcion]
  29.   case ListaCP[#tipo][Padre] of
  30.     "S":
  31.       MenuSubcategorias(Padre)
  32.     "C":
  33.       MenuProgramas(Padre)
  34.     "P":
  35.       DatosPrograma(Padre)
  36.   end case
  37. end
  38.  
  39. on MenuSubcategorias Padre
  40.   Ruta = EMPTY
  41.   InicializarSubcategorias()
  42.   InicializarProgramas()
  43.   updateStage()
  44.   s = EMPTY
  45.   if ListaCP[#tipo][Padre + 1] = "P" then
  46.     MenuProgramas(Padre)
  47.     exit
  48.   end if
  49.   Ruta = ListaCP[#titulo][Padre] & "\"
  50.   repeat with X = Padre + 1 to ListaCP[#tipo].count
  51.     if ListaCP[#tipo][X] = "S" then
  52.       exit repeat
  53.     end if
  54.     if ListaCP[#tipo][X] = "C" then
  55.       append(OpcionesSubcat, X)
  56.       s = s & ListaCP[#titulo][X] & RETURN
  57.     end if
  58.   end repeat
  59.   member("Subcategorias").text = s
  60.   sprite(spLinea).locV = Distancia
  61.   sprite(spSubCat).locV = Distancia
  62.   puppetTransition(3, 2)
  63. end
  64.  
  65. on MenuProgramas Padre
  66.   p = offset("\", Ruta) + 1
  67.   delete char p to length(Ruta) of Ruta
  68.   InicializarProgramas()
  69.   s = EMPTY
  70.   Ruta = Ruta & ListaCP[#titulo][Padre] & "\"
  71.   repeat with X = Padre + 1 to ListaCP[#tipo].count
  72.     if ListaCP[#tipo][X] <> "P" then
  73.       exit repeat
  74.     end if
  75.     append(OpcionesProg, X)
  76.     s = s & ListaCP[#titulo][X] & RETURN
  77.   end repeat
  78.   member("Programas").text = s
  79.   puppetTransition(3, 2)
  80. end
  81.  
  82. on DatosPrograma Padre
  83.   L = ListaCP[#linea][Padre] + 1
  84.   sprite(spFormato).member = texto.line[L].word[1]
  85.   sprite(spIdioma).member = texto.line[L].word[2]
  86.   sprite(spSO).locV = 240
  87.   member("Sistema").text = texto.line[L].word[3]
  88.   r = the pathName & Ruta & texto.line[L].word[4]
  89.   member("Ruta").text = r
  90.   L = L + 1
  91.   member("Descripcion").text = texto.line[L]
  92. end
  93.