VERSION 5.00 Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX" Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx" Begin VB.MDIForm frmPrincipal BackColor = &H8000000C& Caption = "Visual SINTAC" ClientHeight = 6615 ClientLeft = 60 ClientTop = 510 ClientWidth = 9270 Icon = "Principal.frx":0000 LinkTopic = "MDIForm1" StartUpPosition = 2 'CenterScreen Begin MSComctlLib.ImageList ImageList1 Left = 720 Top = 4320 _ExtentX = 1005 _ExtentY = 1005 BackColor = -2147483643 ImageWidth = 16 ImageHeight = 16 MaskColor = 12632256 _Version = 393216 BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} NumListImages = 18 BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Principal.frx":0E42 Key = "NUEVO" EndProperty BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Principal.frx":0F9C Key = "ABRIR" EndProperty BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Principal.frx":10F6 Key = "GUARDAR" EndProperty BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Principal.frx":1250 Key = "CORTAR" EndProperty BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Principal.frx":13AA Key = "COPIAR" EndProperty BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Principal.frx":1504 Key = "PEGAR" EndProperty BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Principal.frx":165E Key = "VOCABULARIO" EndProperty BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Principal.frx":1BF8 Key = "LOCALIDADES" EndProperty BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Principal.frx":2192 Key = "CONEXIONES" EndProperty BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Principal.frx":272C Key = "OBJETOS" EndProperty BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Principal.frx":2CC6 Key = "PSIS" EndProperty BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Principal.frx":3260 Key = "PROCEDIMIENTOS" EndProperty BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Principal.frx":37FA Key = "BUSCAR" EndProperty BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Principal.frx":3954 Key = "EJECUTAR" EndProperty BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Principal.frx":3AAE Key = "DEPURAR" EndProperty BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Principal.frx":4048 Key = "PASOAPASO" EndProperty BeginProperty ListImage17 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Principal.frx":41A2 Key = "RECURSOS" EndProperty BeginProperty ListImage18 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Principal.frx":42FC Key = "IMPRIMIR" EndProperty EndProperty End Begin MSComctlLib.Toolbar Toolbar1 Align = 1 'Align Top Height = 360 Left = 0 TabIndex = 1 Top = 0 Width = 9270 _ExtentX = 16351 _ExtentY = 635 ButtonWidth = 609 ButtonHeight = 582 AllowCustomize = 0 'False Appearance = 1 Style = 1 ImageList = "ImageList1" _Version = 393216 BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} NumButtons = 22 BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} Key = "NUEVO" Object.ToolTipText = "Nuevo" ImageKey = "NUEVO" EndProperty BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} Key = "ABRIR" Object.ToolTipText = "Abrir" ImageKey = "ABRIR" EndProperty BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} Key = "GUARDAR" Object.ToolTipText = "Guardar" ImageKey = "GUARDAR" EndProperty BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} Style = 3 EndProperty BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} Key = "IMPRIMIR" Object.ToolTipText = "Imprimir" ImageKey = "IMPRIMIR" EndProperty BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} Style = 3 EndProperty BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} Enabled = 0 'False Key = "CORTAR" Object.ToolTipText = "Cortar" ImageKey = "CORTAR" EndProperty BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} Enabled = 0 'False Key = "COPIAR" Object.ToolTipText = "Copiar" ImageKey = "COPIAR" EndProperty BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} Enabled = 0 'False Key = "PEGAR" Object.ToolTipText = "Pegar" ImageKey = "PEGAR" EndProperty BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} Enabled = 0 'False Key = "BUSCAR" Object.ToolTipText = "Buscar" ImageKey = "BUSCAR" EndProperty BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} Style = 3 EndProperty BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} Enabled = 0 'False Key = "VOCABULARIO" Object.ToolTipText = "Vocabulario" ImageKey = "VOCABULARIO" EndProperty BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} Enabled = 0 'False Key = "LOCALIDADES" Object.ToolTipText = "Localidades" ImageKey = "LOCALIDADES" EndProperty BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628} Enabled = 0 'False Key = "CONEXIONES" Object.ToolTipText = "Conexiones" ImageKey = "CONEXIONES" EndProperty BeginProperty Button15 {66833FEA-8583-11D1-B16A-00C0F0283628} Enabled = 0 'False Key = "OBJETOS" Object.ToolTipText = "Objetos" ImageKey = "OBJETOS" EndProperty BeginProperty Button16 {66833FEA-8583-11D1-B16A-00C0F0283628} Enabled = 0 'False Key = "PSIS" Object.ToolTipText = "PSIs" ImageKey = "PSIS" EndProperty BeginProperty Button17 {66833FEA-8583-11D1-B16A-00C0F0283628} Enabled = 0 'False Key = "PROCEDIMIENTOS" Object.ToolTipText = "Procedimientos" ImageKey = "PROCEDIMIENTOS" EndProperty BeginProperty Button18 {66833FEA-8583-11D1-B16A-00C0F0283628} Enabled = 0 'False Key = "RECURSOS" Object.ToolTipText = "Recursos" ImageKey = "RECURSOS" EndProperty BeginProperty Button19 {66833FEA-8583-11D1-B16A-00C0F0283628} Style = 3 EndProperty BeginProperty Button20 {66833FEA-8583-11D1-B16A-00C0F0283628} Enabled = 0 'False Key = "EJECUTAR" Object.ToolTipText = "Ejecutar" ImageKey = "EJECUTAR" EndProperty BeginProperty Button21 {66833FEA-8583-11D1-B16A-00C0F0283628} Enabled = 0 'False Key = "PASOAPASO" Object.ToolTipText = "Ejecutar paso a paso" ImageKey = "PASOAPASO" EndProperty BeginProperty Button22 {66833FEA-8583-11D1-B16A-00C0F0283628} Enabled = 0 'False Key = "DEPURAR" Object.ToolTipText = "Ventana de depuración" ImageKey = "DEPURAR" EndProperty EndProperty End Begin MSComDlg.CommonDialog CommonDialog1 Left = 120 Top = 4320 _ExtentX = 847 _ExtentY = 847 _Version = 393216 End Begin MSComctlLib.StatusBar StatusBar1 Align = 2 'Align Bottom Height = 255 Left = 0 TabIndex = 0 Top = 6360 Width = 9270 _ExtentX = 16351 _ExtentY = 450 Style = 1 _Version = 393216 BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} NumPanels = 1 BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} EndProperty EndProperty End Begin VB.Menu mPrincipal Caption = "&Archivo" Index = 0 Begin VB.Menu mArchivo Caption = "&Nuevo" Index = 0 End Begin VB.Menu mArchivo Caption = "&Abrir..." Index = 1 End Begin VB.Menu mArchivo Caption = "&Guardar" Index = 2 End Begin VB.Menu mArchivo Caption = "-" Index = 3 End Begin VB.Menu mArchivo Caption = "&Imprimir..." Index = 4 End Begin VB.Menu mArchivo Caption = "-" Index = 5 End Begin VB.Menu mArchivo Caption = "&Salir" Index = 6 End End Begin VB.Menu mPrincipal Caption = "&Edición" Index = 1 Begin VB.Menu mEdicion Caption = "Cor&tar" Enabled = 0 'False Index = 0 End Begin VB.Menu mEdicion Caption = "&Copiar" Enabled = 0 'False Index = 1 End Begin VB.Menu mEdicion Caption = "&Pegar" Enabled = 0 'False Index = 2 End Begin VB.Menu mEdicion Caption = "-" Index = 3 End Begin VB.Menu mEdicion Caption = "&Buscar..." Enabled = 0 'False Index = 4 Shortcut = ^F End Begin VB.Menu mEdicion Caption = "Buscar &siguiente" Enabled = 0 'False Index = 5 Shortcut = {F3} End Begin VB.Menu mEdicion Caption = "&Reemplazar..." Enabled = 0 'False Index = 6 Shortcut = ^H End Begin VB.Menu mEdicion Caption = "-" Index = 7 End Begin VB.Menu mEdicion Caption = "&Ir a línea..." Enabled = 0 'False Index = 8 Shortcut = ^G End End Begin VB.Menu mPrincipal Caption = "A&ventura" Index = 2 Begin VB.Menu mAventura Caption = "&Vocabulario..." Enabled = 0 'False Index = 0 End Begin VB.Menu mAventura Caption = "&Localidades..." Enabled = 0 'False Index = 1 End Begin VB.Menu mAventura Caption = "&Conexiones..." Enabled = 0 'False Index = 2 End Begin VB.Menu mAventura Caption = "&Objetos..." Enabled = 0 'False Index = 3 End Begin VB.Menu mAventura Caption = "&PSIs..." Enabled = 0 'False Index = 4 End Begin VB.Menu mAventura Caption = "P&rocedimientos..." Enabled = 0 'False Index = 5 End Begin VB.Menu mAventura Caption = "-" Index = 6 End Begin VB.Menu mAventura Caption = "&Ejecutar" Enabled = 0 'False Index = 7 Shortcut = {F5} End Begin VB.Menu mAventura Caption = "&Paso a paso" Enabled = 0 'False Index = 8 Shortcut = {F8} End Begin VB.Menu mAventura Caption = "Ventana de &depuración" Enabled = 0 'False Index = 9 Shortcut = ^D End Begin VB.Menu mAventura Caption = "-" Index = 10 End Begin VB.Menu mAventura Caption = "Edi&tor de recursos..." Enabled = 0 'False Index = 11 End Begin VB.Menu mAventura Caption = "Co&mpilar aventura..." Enabled = 0 'False Index = 12 End End Begin VB.Menu mPrincipal Caption = "Ve&ntana" Index = 3 WindowList = -1 'True End Begin VB.Menu mPrincipal Caption = "Ay&uda" Index = 4 Begin VB.Menu mAyuda Caption = "&Contenido" Index = 0 Shortcut = {F1} End Begin VB.Menu mAyuda Caption = "-" Index = 1 End Begin VB.Menu mAyuda Caption = "&Acerca de Visual SINTAC..." Index = 2 End End End Attribute VB_Name = "frmPrincipal" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Public bFuerzaGuardar As Boolean ' para forzar que se guarden los ' cambios al salir Private Sub Nuevo() frmNueva.Show vbModal End Sub Private Sub Abrir() Dim frm As Form Dim sFich As String Dim i As Integer GuardarCambios CommonDialog1.DialogTitle = "Abrir aventura" CommonDialog1.Filter = "Archivos de Visual SINTAC|*" & EXT_PROC & "|Todos los archivos|*.*" CommonDialog1.InitDir = App.Path CommonDialog1.Flags = cdlOFNFileMustExist Or cdlOFNPathMustExist Or cdlOFNHideReadOnly CommonDialog1.CancelError = True On Error GoTo Error_Abrir Screen.MousePointer = vbHourglass ' cerramos los formularios abiertos For Each frm In Forms If frm.Name <> Me.Name Then Unload frm End If Next CommonDialog1.fileName = "" CommonDialog1.ShowOpen sFich = CommonDialog1.fileName ' elimina la extensión del nombre del fichero (si la tiene) i = InStrRev(sFich, ".") If i > 0 Then sFich = Left(sFich, i - 1) End If ' carga los datos If Not CargarVocabulario(sFich & EXT_VOC) Then Screen.MousePointer = vbDefault '''MsgBox "Error al cargar vocabulario", vbOKOnly + vbCritical, "Visual SINTAC" Exit Sub End If If Not CargarLocalidades(sFich & EXT_LOC) Then Screen.MousePointer = vbDefault '''MsgBox "Error al cargar localidades", vbOKOnly + vbCritical, "Visual SINTAC" Exit Sub End If If Not CargarObjetos(sFich & EXT_OBJ) Then Screen.MousePointer = vbDefault '''MsgBox "Error al cargar objetos", vbOKOnly + vbCritical, "Visual SINTAC" Exit Sub End If If Not CargarPSIs(sFich & EXT_PSI) Then Screen.MousePointer = vbDefault '''MsgBox "Error al cargar PSIs", vbOKOnly + vbCritical, "Visual SINTAC" Exit Sub End If If Not CargarModulos(sFich & EXT_PROC) Then Screen.MousePointer = vbDefault '''MsgBox "Error al cargar módulos", vbOKOnly + vbCritical, "Visual SINTAC" Exit Sub End If sFichAventura = sFich Titulo ActivarMenuAventura Screen.MousePointer = vbDefault Error_Abrir: Screen.MousePointer = vbDefault Exit Sub End Sub Public Sub Guardar() If sFichAventura = "" Then Exit Sub End If Screen.MousePointer = vbHourglass If Not GuardarVocabulario(sFichAventura & EXT_VOC) Then Exit Sub End If If Not GuardarLocalidades(sFichAventura & EXT_LOC) Then Exit Sub End If If Not GuardarObjetos(sFichAventura & EXT_OBJ) Then Exit Sub End If If Not GuardarPSIs(sFichAventura & EXT_PSI) Then Exit Sub End If If Not GuardarModulos(sFichAventura & EXT_PROC) Then Exit Sub End If Screen.MousePointer = vbDefault End Sub Private Sub mArchivo_Click(index As Integer) Select Case index Case ARCH_NUEVO Nuevo Case ARCH_ABRIR Abrir Case ARCH_GUARDAR GuardarModificaciones Guardar Case ARCH_IMPRIMIR frmImprimir.Show vbModal Case ARCH_SALIR Unload Me End Select End Sub Private Sub mAventura_Click(index As Integer) Select Case index Case AV_VOC frmVocabulario.Show frmVocabulario.ZOrder 0 Case AV_LOC frmLocalidades.Show frmLocalidades.ZOrder 0 Case AV_CNX If Not bHayLoc Then MsgBox "No hay localidades definidas.", vbOKOnly + vbExclamation, "Conexiones" Exit Sub End If frmConex.Show frmConex.ZOrder 0 Case AV_OBJ frmObjetos.Show frmObjetos.ZOrder 0 Case AV_PSI frmPSIs.Show frmPSIs.ZOrder 0 Case AV_PROC frmProc.Show frmProc.ZOrder 0 Case AV_EJECUTAR Ejecutar False Case AV_PASOAPASO Ejecutar True Case AV_DEPURAR bDepurar = Not bDepurar mAventura(AV_DEPURAR).Checked = bDepurar VentanaDepuracion Case AV_RECURSOS frmRecursos.Show frmRecursos.ZOrder 0 Case AV_COMPILAR Compilar End Select End Sub Private Sub mAyuda_Click(index As Integer) Const cdlHelpFinder = &HB Select Case index Case AYD_CONTENIDO CommonDialog1.HelpFile = App.HelpFile CommonDialog1.HelpCommand = cdlHelpFinder CommonDialog1.ShowHelp Case AYD_ACERCADE frmAcerca.Show vbModal End Select End Sub Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer) Dim frm As Form Dim iOpc As Integer ' cerramos todas las ventanas hijas que haya abiertas For Each frm In Forms If frm.Name <> Me.Name Then Unload frm End If Next GuardarCambios iOpc = MsgBox("¿Estás seguro de querer salir del programa?", vbYesNo + vbQuestion, "Salir") If iOpc <> vbYes Then Cancel = 1 Else Cancel = 0 End If End Sub Private Sub MDIForm_Unload(Cancel As Integer) FinalizaSonido ' por si acaso End End Sub ' vuelve a cargar el último fichero Public Sub AbrirUltimo() Dim sFich As String Dim i As Integer Screen.MousePointer = vbHourglass sFich = sFichAventura ' elimina la extensión del nombre del fichero (si la tiene) i = InStr(sFich, ".") If i > 0 Then sFich = Left(sFich, i - 1) End If ' carga los datos If Not CargarVocabulario(sFich & EXT_VOC) Then MsgBox "Error al cargar vocabulario", vbOKOnly + vbCritical, "Visual SINTAC" Exit Sub End If If Not CargarLocalidades(sFich & EXT_LOC) Then MsgBox "Error al cargar localidades", vbOKOnly + vbCritical, "Visual SINTAC" Exit Sub End If If Not CargarObjetos(sFich & EXT_OBJ) Then MsgBox "Error al cargar objetos", vbOKOnly + vbCritical, "Visual SINTAC" Exit Sub End If If Not CargarPSIs(sFich & EXT_PSI) Then MsgBox "Error al cargar PSIs", vbOKOnly + vbCritical, "Visual SINTAC" Exit Sub End If If Not CargarModulos(sFich & EXT_PROC) Then MsgBox "Error al cargar módulos", vbOKOnly + vbCritical, "Visual SINTAC" Exit Sub End If Screen.MousePointer = vbDefault End Sub ' lanza la ejecución del programa ' el parámetro 'bDep' indica si se comienza con el depurador activado Private Sub Ejecutar(ByVal bDep As Boolean) Dim s As String On Error GoTo Error_Ejecutar GuardarModificaciones ' guardamos los cambios porque necesitaremos volverlos a cargar al final ' de la ejecución ya que es posible que se hayan modificado las tablas ' de localidades, objetos o PSIs por programa Guardar bDepurar = bDep DesactivarEjecutar frmCompilar.ProgressBar1.value = 3 frmCompilar.Refresh s = CargarScript If s <> "" Then MsgBox s, vbOKOnly + vbCritical, "Error de sintaxis" Else Ejecuta End If ActivarEjecutar AbrirUltimo Exit Sub Error_Ejecutar: ActivarEjecutar MsgBox Err.Description, vbOKOnly + vbCritical, "ERROR" End Sub ' desactiva opciones y formularios durante la ejecución Private Sub DesactivarEjecutar() Dim F As Form Dim i As Long Dim s As String On Error Resume Next mPrincipal(0).Enabled = False mPrincipal(1).Enabled = False For i = 0 To mAventura.Count - 1 ' guardamos el estado de las opciones de menú para restaurarlas ' para ello usamos la propiedad 'Tag' mAventura(i).Tag = IIf(mAventura(i).Enabled, "1", "0") mAventura(i).Enabled = False Next For i = 0 To Toolbar1.Buttons.Count - 1 ' guardamos el estado de los botones de la barra en la propiedad 'Tag' Toolbar1.Buttons(i).Tag = IIf(Toolbar1.Buttons(i).Enabled, "1", "0") Toolbar1.Buttons(i).Enabled = False Next mAventura(AV_DEPURAR).Enabled = True mAventura(AV_DEPURAR).Checked = bDepurar Toolbar1.Buttons("DEPURAR").Enabled = True ' bloqueamos los formularios que tengamos abiertos y visibles For Each F In Forms If F.Visible Then s = UCase(F.Name) If s <> "FRMPRINCIPAL" And s <> "FRMVIS" And s <> "FRMDEBUG" Then F.Enabled = False End If End If Next End Sub ' activa opciones y formularios cuando termina de ejecutar Private Sub ActivarEjecutar() Dim F As Form Dim i As Long Dim s As String On Error Resume Next mPrincipal(0).Enabled = True mPrincipal(1).Enabled = True For i = 0 To mAventura.Count - 1 ' recuperamos el estado de las opciones de menú mAventura(i).Enabled = IIf(mAventura(i).Tag = "1", True, False) Next For i = 0 To Toolbar1.Buttons.Count - 1 Toolbar1.Buttons(i).Enabled = IIf(Toolbar1.Buttons(i).Tag = "1", True, False) Next mAventura(AV_DEPURAR).Enabled = False Toolbar1.Buttons("DEPURAR").Enabled = False ' desbloqueamos los formularios que tengamos abiertos y visibles For Each F In Forms If F.Visible Then s = UCase(F.Name) If s <> "FRMPRINCIPAL" And s <> "FRMVIS" And s <> "FRMDEBUG" Then F.Enabled = True End If End If Next End Sub Public Sub Titulo() Me.Caption = App.Title & IIf(sFichAventura = "", "", " - " & sFichAventura) End Sub Private Sub mEdicion_Click(index As Integer) Select Case index Case EDIC_CORTAR If frmProc.txtEditor.SelText <> "" Then Clipboard.SetText frmProc.txtEditor.SelText frmProc.txtEditor.SelText = "" End If Case EDIC_COPIAR If frmProc.txtEditor.SelText <> "" Then Clipboard.SetText frmProc.txtEditor.SelText End If Case EDIC_PEGAR If Clipboard.GetText <> "" Then frmProc.txtEditor.SelText = Clipboard.GetText End If Case EDIC_BUSCAR frmBuscar.ModoBuscar frmBuscar.Show vbModal Case EDIC_BUSCARSGTE frmBuscar.BuscarSgte Case EDIC_REEMPLAZAR frmBuscar.ModoReemplazar frmBuscar.Show vbModal Case EDIC_IRA frmProc.IrA End Select End Sub Public Sub ActivarMenuAventura() Dim i As Integer For i = 0 To Me.mAventura.Count - 1 mAventura(i).Enabled = True Next Toolbar1.Buttons("VOCABULARIO").Enabled = True Toolbar1.Buttons("LOCALIDADES").Enabled = True Toolbar1.Buttons("CONEXIONES").Enabled = True Toolbar1.Buttons("OBJETOS").Enabled = True Toolbar1.Buttons("PSIS").Enabled = True Toolbar1.Buttons("PROCEDIMIENTOS").Enabled = True Toolbar1.Buttons("RECURSOS").Enabled = True Toolbar1.Buttons("EJECUTAR").Enabled = True Toolbar1.Buttons("PASOAPASO").Enabled = True ' desactiva opción de depurar (se activará al ejecutar) mAventura(AV_DEPURAR).Enabled = False Toolbar1.Buttons("DEPURAR").Enabled = False End Sub Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button) Select Case Button.key Case "NUEVO" mArchivo_Click ARCH_NUEVO Case "ABRIR" mArchivo_Click ARCH_ABRIR Case "GUARDAR" mArchivo_Click ARCH_GUARDAR Case "IMPRIMIR" mArchivo_Click ARCH_IMPRIMIR Case "CORTAR" mEdicion_Click EDIC_CORTAR Case "COPIAR" mEdicion_Click EDIC_COPIAR Case "PEGAR" mEdicion_Click EDIC_PEGAR Case "BUSCAR" mEdicion_Click EDIC_BUSCAR Case "VOCABULARIO" mAventura_Click AV_VOC Case "LOCALIDADES" mAventura_Click AV_LOC Case "CONEXIONES" mAventura_Click AV_CNX Case "OBJETOS" mAventura_Click AV_OBJ Case "PSIS" mAventura_Click AV_PSI Case "PROCEDIMIENTOS" mAventura_Click AV_PROC Case "EJECUTAR" mAventura_Click AV_EJECUTAR Case "PASOAPASO" mAventura_Click AV_PASOAPASO Case "DEPURAR" mAventura_Click AV_DEPURAR Case "RECURSOS" mAventura_Click AV_RECURSOS End Select End Sub ' guardamos las modificaciones que estemos haciendo en el editor Private Sub GuardarModificaciones() If EstaCargado(frmLocalidades) Then frmLocalidades.GuardarDatosLoc End If If EstaCargado(frmObjetos) Then frmObjetos.GuardarDatosObj End If If EstaCargado(frmPSIs) Then frmPSIs.GuardarDatosPSI End If If EstaCargado(frmProc) Then frmProc.GuardarMod End If End Sub Public Sub GuardarCambios() Dim iOpc As Integer If sFichAventura = "" Then Exit Sub End If If bFuerzaGuardar Then Guardar Else iOpc = MsgBox("¿Quieres guardar los cambios?", vbYesNo + vbQuestion, "Guardar") If iOpc = vbYes Then Guardar End If End If End Sub Private Sub Compilar() Dim bCorrecto As Boolean Dim sDLLRes As String sDLLRes = sFichAventura & EXT_DLL ' borramos el fichero On Error Resume Next Kill sDLLRes On Error GoTo Error_Compilar Load frmCompilar frmCompilar.ProgressBar1.Min = 1 frmCompilar.ProgressBar1.Max = 6 frmCompilar.ProgressBar1.value = 1 frmCompilar.Show SetWindowPos frmCompilar.hwnd, -1, 0, 0, 0, 0, SWP_FLAGS frmCompilar.lblInfo.Caption = "Guardando datos..." frmCompilar.Refresh Guardar Screen.MousePointer = vbHourglass ' recursos frmCompilar.lblInfo.Caption = "Compilando recursos..." frmCompilar.ProgressBar1.value = 1 frmCompilar.Refresh Load frmRecursos frmRecursos.Show SetWindowPos frmRecursos.hwnd, -1, 0, 0, 0, 0, SWP_FLAGS frmCompilar.Refresh frmRecursos.cmdCompilar_Click bCorrecto = frmRecursos.bCompilado Unload frmRecursos DoEvents If Not bCorrecto Then Unload frmCompilar Screen.MousePointer = vbDefault Exit Sub End If ' vocabulario frmCompilar.lblInfo.Caption = "Compilando vocabulario..." frmCompilar.ProgressBar1.value = 2 frmCompilar.Refresh If Not GuardarVocabularioRes(sDLLRes) Then Err.Description = "Error al compilar el vocabulario" GoTo Error_Compilar End If ' localidades frmCompilar.lblInfo.Caption = "Compilando tabla de localidades..." frmCompilar.ProgressBar1.value = 3 frmCompilar.Refresh If Not GuardarLocalidadesRes(sDLLRes) Then Err.Description = "Error al compilar la tabla de localidades" GoTo Error_Compilar End If ' objetos frmCompilar.lblInfo.Caption = "Compilando tabla de objetos..." frmCompilar.ProgressBar1.value = 4 frmCompilar.Refresh If Not GuardarObjetosRes(sDLLRes) Then Err.Description = "Error al compilar la tabla de objetos" GoTo Error_Compilar End If ' PSIs frmCompilar.lblInfo.Caption = "Compilando tabla de PSIs..." frmCompilar.ProgressBar1.value = 5 frmCompilar.Refresh If Not GuardarPSIsRes(sDLLRes) Then Err.Description = "Error al compilar la tabla de PSIs" GoTo Error_Compilar End If ' módulos frmCompilar.lblInfo.Caption = "Compilando módulos..." frmCompilar.ProgressBar1.value = 6 frmCompilar.Refresh If Not GuardarModulosRes(sDLLRes) Then Err.Description = "Error al compilar los módulos" GoTo Error_Compilar End If Unload frmCompilar Screen.MousePointer = vbDefault Exit Sub Error_Compilar: Unload frmCompilar Screen.MousePointer = vbDefault MsgBox "Error al compilar aventura: " & Err.Description, vbOKOnly + vbCritical, _ "Compilar aventura" End Sub