VERSION 5.00 Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX" Begin VB.Form frmLstObj BorderStyle = 5 'Sizable ToolWindow Caption = "Objetos" ClientHeight = 4560 ClientLeft = 60 ClientTop = 300 ClientWidth = 2550 Icon = "LstObjs.frx":0000 LinkTopic = "Form1" MaxButton = 0 'False MDIChild = -1 'True MinButton = 0 'False ScaleHeight = 4560 ScaleWidth = 2550 ShowInTaskbar = 0 'False Begin MSComctlLib.ListView lstObj DragIcon = "LstObjs.frx":0E42 Height = 4215 Left = 0 TabIndex = 0 Top = 60 Width = 2535 _ExtentX = 4471 _ExtentY = 7435 View = 3 LabelEdit = 1 LabelWrap = -1 'True HideSelection = -1 'True _Version = 393217 ForeColor = -2147483640 BackColor = -2147483643 BorderStyle = 1 Appearance = 1 NumItems = 1 BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} Text = "Localidad" Object.Width = 3881 EndProperty End Begin VB.Label lblInfo Caption = "Arrastra el objeto sobre la localidad" ForeColor = &H00800000& Height = 255 Left = 0 TabIndex = 1 Top = 4320 Width = 2535 End End Attribute VB_Name = "frmLstObj" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Dim bPulsado As Boolean ' para drag&drop Private Sub Form_Load() bPulsado = False Me.Width = 2670 Me.Height = 4920 ActualizarListaObj End Sub Public Sub ActualizarListaObj() Dim i As Long, n As Long lstObj.ListItems.Clear If Not bHayObj Then Exit Sub End If For i = 0 To UBound(Objetos) lstObj.ListItems.Add i + 1, "O" & CStr(i), Objetos(i).Nombre & " " & Objetos(i).Adjetivo Next End Sub Private Sub Form_Resize() On Error Resume Next lblInfo.Top = Me.ScaleHeight - lblInfo.Height lblInfo.Left = 0 lstObj.Top = 60 lstObj.Left = 0 lstObj.Width = Me.ScaleWidth lstObj.Height = Me.ScaleHeight - lblInfo.Height - 120 lstObj.ColumnHeaders(1).Width = lstObj.Width - 300 End Sub Private Sub lstObj_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader) If ColumnHeader.index = 1 Then If lstObj.Sorted Then lstObj.Sorted = False ActualizarListaObj Else lstObj.SortKey = 0 lstObj.Sorted = True End If End If End Sub Private Sub lstObj_DblClick() Dim lObj As Long ' coge el objeto que está seleccionado If lstObj.ListItems.Count < 1 Then Exit Sub End If lObj = CLng(Mid(lstObj.SelectedItem.Key, 2)) '''JSJ::: End Sub Private Sub lstObj_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) bPulsado = True End Sub Private Sub lstObj_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If bPulsado Then lstObj.Drag vbBeginDrag bPulsado = False End If End Sub Private Sub lstObj_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) bPulsado = False lstObj.Drag vbEndDrag End Sub