VERSION 5.00 Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX" Begin VB.Form frmDebug Caption = "Ventana de Depuración" ClientHeight = 6060 ClientLeft = 60 ClientTop = 345 ClientWidth = 4680 Icon = "Debug.frx":0000 KeyPreview = -1 'True LinkTopic = "Form1" ScaleHeight = 6060 ScaleWidth = 4680 Begin MSComctlLib.ImageList ImageList1 Left = 240 Top = 1560 _ExtentX = 1005 _ExtentY = 1005 BackColor = -2147483643 ImageWidth = 16 ImageHeight = 16 MaskColor = 12632256 _Version = 393216 BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} NumListImages = 4 BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Debug.frx":058A Key = "Ejecutar" EndProperty BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Debug.frx":06E4 Key = "Parar" EndProperty BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Debug.frx":083E Key = "Globales" EndProperty BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Debug.frx":0DD8 Key = "Locales" EndProperty EndProperty End Begin MSComctlLib.ImageList ImageList2 Left = 960 Top = 1560 _ExtentX = 1005 _ExtentY = 1005 BackColor = -2147483643 ImageWidth = 16 ImageHeight = 16 MaskColor = 12632256 _Version = 393216 BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} NumListImages = 5 BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Debug.frx":1372 Key = "" EndProperty BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Debug.frx":190C Key = "" EndProperty BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Debug.frx":1EA6 Key = "" EndProperty BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Debug.frx":2440 Key = "" EndProperty BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} Picture = "Debug.frx":29DA Key = "" EndProperty EndProperty End Begin VB.PictureBox Separador Appearance = 0 'Flat BackColor = &H00404040& BorderStyle = 0 'None FillColor = &H00404040& ForeColor = &H80000008& Height = 60 Index = 1 Left = 0 MousePointer = 7 'Size N S ScaleHeight = 60 ScaleWidth = 4695 TabIndex = 4 Top = 4320 Width = 4695 End Begin VB.PictureBox Separador Appearance = 0 'Flat BackColor = &H00404040& BorderStyle = 0 'None FillColor = &H00404040& ForeColor = &H80000008& Height = 60 Index = 0 Left = 0 MousePointer = 7 'Size N S ScaleHeight = 60 ScaleWidth = 4695 TabIndex = 3 Top = 2400 Width = 4695 End Begin MSComctlLib.TreeView lstObj Height = 1695 Left = 120 TabIndex = 1 Top = 2520 Width = 4455 _ExtentX = 7858 _ExtentY = 2990 _Version = 393217 Indentation = 176 LabelEdit = 1 Style = 7 HotTracking = -1 'True ImageList = "ImageList2" Appearance = 1 End Begin MSComctlLib.Toolbar Toolbar1 Align = 2 'Align Bottom Height = 330 Left = 0 TabIndex = 5 Top = 5730 Width = 4680 _ExtentX = 8255 _ExtentY = 582 ButtonWidth = 609 ButtonHeight = 582 AllowCustomize = 0 'False Style = 1 ImageList = "ImageList1" _Version = 393216 BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} NumButtons = 5 BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} Key = "Parar" Object.ToolTipText = "Cierra la ventana de depuración" ImageKey = "Parar" EndProperty BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} Key = "Ejecutar" Object.ToolTipText = "Ejecuta la línea actual" ImageKey = "Ejecutar" EndProperty BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} Style = 3 EndProperty BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} Key = "Globales" Object.ToolTipText = "Mostrar/ocultar variables globales" ImageKey = "Globales" Style = 1 Value = 1 EndProperty BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} Key = "Locales" Object.ToolTipText = "Mostrar/ocultar variables locales" ImageKey = "Locales" Style = 1 Value = 1 EndProperty EndProperty End Begin MSComctlLib.ListView lstCod Height = 1215 Left = 120 TabIndex = 2 Top = 4440 Width = 4455 _ExtentX = 7858 _ExtentY = 2143 View = 3 LabelEdit = 1 LabelWrap = -1 'True HideSelection = 0 'False HideColumnHeaders= -1 'True FullRowSelect = -1 'True GridLines = -1 'True _Version = 393217 ForeColor = -2147483640 BackColor = -2147483624 BorderStyle = 1 Appearance = 1 NumItems = 1 BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} Text = "Código" Object.Width = 2540 EndProperty End Begin MSComctlLib.ListView lstVar Height = 2175 Left = 120 TabIndex = 0 Top = 120 Width = 4455 _ExtentX = 7858 _ExtentY = 3836 View = 3 LabelEdit = 1 Sorted = -1 'True LabelWrap = -1 'True HideSelection = -1 'True FullRowSelect = -1 'True GridLines = -1 'True _Version = 393217 ForeColor = -2147483640 BackColor = -2147483643 BorderStyle = 1 Appearance = 1 BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} Name = "Arial" Size = 6.75 Charset = 0 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty NumItems = 3 BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} Text = "Variable" Object.Width = 2540 EndProperty BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628} SubItemIndex = 1 Text = "Valor" Object.Width = 3528 EndProperty BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628} SubItemIndex = 2 Text = "Proc." Object.Width = 1764 EndProperty End End Attribute VB_Name = "frmDebug" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Private bMoverSeparador As Boolean Public bPausa As Boolean Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) bPausa = False End Sub Private Sub Form_Load() Dim i As Long Me.Top = frmPrincipal.Height - Me.Height - 500 Me.Left = frmPrincipal.Width - Me.Width - 300 lstVar.Left = 0 lstVar.Top = 0 lstVar.Width = Me.ScaleWidth lstVar.Height = 2200 lstObj.Width = Me.ScaleWidth lstObj.Height = 1700 lstObj.Left = 0 lstObj.Top = lstVar.Height + 50 lstCod.Width = Me.ScaleWidth lstCod.Height = Me.ScaleHeight - lstVar.Height - lstObj.Height - Toolbar1.Height - 100 lstCod.Left = 0 lstCod.Top = lstVar.Height + lstObj.Height + 100 lstCod.ColumnHeaders(1).Width = lstCod.Width For i = 0 To Separador.Count - 1 Separador(i).Width = Me.ScaleWidth Separador(i).BackColor = &H8000000F Next Separador(0).Top = lstVar.Height Separador(1).Top = lstVar.Height + lstObj.Height + 50 bMoverSeparador = False bPausa = False ' mantiene la ventana de depuración sobre las demás SetWindowPos Me.hwnd, -1, 0, 0, 0, 0, SWP_FLAGS End Sub Private Sub Form_Resize() Dim i As Long On Error Resume Next lstVar.Width = Me.ScaleWidth lstVar.Height = Me.ScaleHeight - lstCod.Height - lstObj.Height - Toolbar1.Height - 150 If lstVar.Height < 255 Then lstVar.Height = 255 End If lstObj.Width = Me.ScaleWidth lstObj.Top = lstVar.Top + lstVar.Height + 50 lstCod.Width = Me.ScaleWidth lstCod.ColumnHeaders(1).Width = lstCod.Width lstCod.Top = lstObj.Top + lstObj.Height + 50 For i = 0 To Separador.Count - 1 Separador(i).Width = Me.ScaleWidth Next Separador(0).Top = lstVar.Height Separador(1).Top = lstVar.Height + lstObj.Height + 50 If lstCod.Height < 255 Then lstCod.Height = 255 End If If Me.Height < Toolbar1.Height + 1000 Then Me.Height = Toolbar1.Height + 1000 End If End Sub Private Sub Form_Unload(Cancel As Integer) bDepurar = False bPausa = False End Sub Public Sub Pausa() bPausa = True Do While bPausa And EstaCargado(Me) DoEvents Loop End Sub Private Sub Separador_MouseDown(index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) bMoverSeparador = True Separador(index).BackColor = &H404040 End Sub Private Sub Separador_MouseMove(index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) Dim lY As Long On Error Resume Next If bMoverSeparador Then lY = Separador(index).Top + Y ' comprobamos que los separadores no se "pasen" unos a otros If index > 0 Then If lY < (Separador(index - 1).Top + 150) Then lY = Separador(index - 1).Top + 150 End If ElseIf index < Separador.Count Then If lY > (Separador(index + 1).Top - 150) Then lY = Separador(index + 1).Top - 150 End If End If ' comprobamos que no se pasen los límites del formulario If lY < 150 Then lY = 150 ElseIf lY > Me.ScaleHeight - 500 Then lY = Me.ScaleHeight - 500 End If Separador(index).Top = lY End If End Sub Private Sub Separador_MouseUp(index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single) On Error Resume Next bMoverSeparador = False Separador(index).BackColor = &H8000000F Select Case index Case 0 lstVar.Height = Separador(0).Top lstObj.Top = lstVar.Height + 50 lstObj.Height = Separador(1).Top - Separador(0).Top - 50 Case 1 lstObj.Height = Separador(1).Top - lstObj.Top lstCod.Top = Separador(1).Top + 50 lstCod.Height = Me.ScaleHeight - Toolbar1.Height - lstCod.Top End Select End Sub Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button) Select Case Button.key Case "Parar" bPausa = False Unload Me Case "Ejecutar" bPausa = False Case "Globales", "Locales" Depurar End Select End Sub ' actualiza la ventana de depuración Public Sub Depurar() Dim Lst As ListItem Dim s As String Dim i As Long, j As Long, lPrimeraLin As Long, lUltLin As Long LockWindowUpdate frmDebug.hwnd If lProcActual = -1 Then frmDebug.Caption = "[Principal]" Else frmDebug.Caption = Procedimientos(lProcActual).Nombre & _ " (" & CStr(Procedimientos(lProcActual).NumSerie) & ")" End If ' variables frmDebug.lstVar.ListItems.Clear ' globales If bHayGlobales And frmDebug.Toolbar1.Buttons("Globales").value = tbrPressed Then For i = 0 To UBound(VarGlobales) Set Lst = frmDebug.lstVar.ListItems.Add(, , VarGlobales(i).Nombre) Lst.SubItems(1) = VarGlobales(i).Valor Lst.SubItems(2) = "GLOBAL" Next End If ' locales (sólo las del procedimiento actual) If bHayLocales And frmDebug.Toolbar1.Buttons("Locales").value = tbrPressed Then For i = 0 To UBound(VarLocales) If VarLocales(i).Proc = lProcActual And _ VarLocales(i).NumSerie = Procedimientos(lProcActual).NumSerie Then Set Lst = frmDebug.lstVar.ListItems.Add(, , VarLocales(i).Nombre) Lst.SubItems(1) = VarLocales(i).Valor Lst.SubItems(2) = Procedimientos(VarLocales(i).Proc).Nombre End If Next End If ' objetos lstObj.Nodes.Clear lstObj.Nodes.Add , , "LOC", "Localidades", 1, 1 lstObj.Nodes.Add , , "OBJ", "Objetos", 2, 2 lstObj.Nodes.Add , , "PSI", "PSIs", 3, 3 If bHayLoc Then For i = 0 To UBound(Localidades) s = "LOC" & CStr(i) lstObj.Nodes.Add "LOC", tvwChild, s, Localidades(i).Nombre, 4, 4 lstObj.Nodes.Add s, tvwChild, , LOC_PROP_DESCCORTA & "=" & Localidades(i).DescCorta, 5, 5 lstObj.Nodes.Add s, tvwChild, , LOC_PROP_DESCLARGA & "=" & Localidades(i).DescLarga, 5, 5 lstObj.Nodes.Add s, tvwChild, , LOC_PROP_ILUMINADA & "=" & Localidades(i).Iluminada, 5, 5 lstObj.Nodes.Add s, tvwChild, , LOC_PROP_EXTERIOR & "=" & Localidades(i).Exterior, 5, 5 lstObj.Nodes.Add s, tvwChild, , LOC_PROP_GRAFICO & "=" & Localidades(i).Grafico, 5, 5 lstObj.Nodes.Add s, tvwChild, , LOC_PROP_SONIDO & "=" & Localidades(i).Sonido, 5, 5 lstObj.Nodes.Add s, tvwChild, , LOC_PROP_USUARIO & "=" & Localidades(i).Usuario, 5, 5 Next End If If bHayObj Then For i = 0 To UBound(Objetos) s = "OBJ" & CStr(i) lstObj.Nodes.Add "OBJ", tvwChild, s, Objetos(i).Nombre & " " & Objetos(i).Adjetivo, 4, 4 lstObj.Nodes.Add s, tvwChild, , OBJ_PROP_DESCCORTA & "=" & Objetos(i).DescCorta, 5, 5 lstObj.Nodes.Add s, tvwChild, , OBJ_PROP_DESCLARGA & "=" & Objetos(i).DescLarga, 5, 5 lstObj.Nodes.Add s, tvwChild, , OBJ_PROP_TAM & "=" & Objetos(i).Tam, 5, 5 lstObj.Nodes.Add s, tvwChild, , OBJ_PROP_PESO & "=" & Objetos(i).Peso, 5, 5 lstObj.Nodes.Add s, tvwChild, , OBJ_PROP_TIPOCONTENEDOR & "=" & Objetos(i).TipoContenedor, 5, 5 lstObj.Nodes.Add s, tvwChild, , OBJ_PROP_CONTENEDOR & "=" & Objetos(i).Contenedor, 5, 5 For j = 0 To UBound(ObjProp) lstObj.Nodes.Add s, tvwChild, , UCase(ObjProp(j).Nombre) & "=" & PropiedadObj(CStr(i), ObjProp(j).Nombre, ""), 5, 5 Next lstObj.Nodes.Add s, tvwChild, , OBJ_PROP_GRAFICO & "=" & Objetos(i).Grafico, 5, 5 lstObj.Nodes.Add s, tvwChild, , OBJ_PROP_SONIDO & "=" & Objetos(i).Sonido, 5, 5 lstObj.Nodes.Add s, tvwChild, , OBJ_PROP_USUARIO & "=" & Objetos(i).Usuario, 5, 5 Next End If If bHayPSI Then For i = 0 To UBound(PSIs) s = "PSI" & CStr(i) lstObj.Nodes.Add "PSI", tvwChild, s, PSIs(i).Nombre & " " & PSIs(i).Adjetivo, 4, 4 lstObj.Nodes.Add s, tvwChild, , PSI_PROP_DESCCORTA & "=" & PSIs(i).DescCorta, 5, 5 lstObj.Nodes.Add s, tvwChild, , PSI_PROP_DESCLARGA & "=" & PSIs(i).DescLarga, 5, 5 lstObj.Nodes.Add s, tvwChild, , PSI_PROP_TAM & "=" & PSIs(i).Tam, 5, 5 lstObj.Nodes.Add s, tvwChild, , PSI_PROP_PESO & "=" & PSIs(i).Peso, 5, 5 lstObj.Nodes.Add s, tvwChild, , PSI_PROP_LOCALIDAD & "=" & PSIs(i).Localidad, 5, 5 For j = 0 To UBound(PSIProp) lstObj.Nodes.Add s, tvwChild, , UCase(PSIProp(j).Nombre) & "=" & PropiedadPSI(CStr(i), PSIProp(j).Nombre, ""), 5, 5 Next lstObj.Nodes.Add s, tvwChild, , PSI_PROP_GRAFICO & "=" & PSIs(i).Grafico, 5, 5 lstObj.Nodes.Add s, tvwChild, , PSI_PROP_SONIDO & "=" & PSIs(i).Sonido, 5, 5 lstObj.Nodes.Add s, tvwChild, , PSI_PROP_USUARIO & "=" & PSIs(i).Usuario, 5, 5 Next End If ' código frmDebug.lstCod.ListItems.Clear lPrimeraLin = lPunteroLinea - (NUM_LIN_DEP / 2) If lPrimeraLin < 0 Then lPrimeraLin = 0 End If lUltLin = lPrimeraLin + NUM_LIN_DEP If lUltLin > UBound(Lineas) Then lUltLin = UBound(Lineas) End If For i = lPrimeraLin To lUltLin frmDebug.lstCod.ListItems.Add , , IIf(i = lPunteroLinea, "> ", "") & Lineas(i).Lin If i = lPunteroLinea Then Set frmDebug.lstCod.SelectedItem = frmDebug.lstCod.ListItems(frmDebug.lstCod.ListItems.Count) End If Next ' hacemos visible la línea actual frmDebug.lstCod.SelectedItem.EnsureVisible LockWindowUpdate 0 ' pausa hasta que se pulse una tecla frmDebug.Pausa End Sub