home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / Grid-X9_(_2159668102009.psc / Main / GridList.bas < prev    next >
BASIC Source File  |  2008-07-26  |  2KB  |  58 lines

  1. Attribute VB_Name = "GridList"
  2. Type GList
  3.     GLText As String
  4.     
  5. End Type
  6. Type nIcon
  7.     File  As String
  8.     Index As Integer
  9.     X1    As Integer
  10.     Y1    As Integer
  11. End Type
  12. Type PT
  13.     PTVis As Integer
  14.     PTFull As Integer
  15.     PTX1 As Integer
  16.     PTX2 As Integer
  17.     PTY1 As Integer
  18.     PTY2 As Integer
  19.     PTIcon As nIcon
  20. End Type
  21. Public ListPT As PT
  22. Dim tmpListPT As PT
  23.  
  24. Dim GridList() As GList
  25.  
  26.  
  27. Function Get_Format(Names As String, TypeName As String) As String
  28. Dim TInstr As Long, tagTInstr As Long, endTagTI As Long
  29.     
  30.     TInstr = InStr(TInstr + 1, Names, TypeName)
  31.     If TInstr <> 0 Then
  32.         tagTInstr = InStr(TInstr + 1, Names, "|")
  33.         endTagTI = InStr(tagTInstr + 1, Names, "?")
  34.     
  35.         Get_Format = right(left(Names, endTagTI - 1), Abs(endTagTI - tagTInstr) - 1)
  36.         'If Get_Format = "" Then Get_Format = "?"
  37.     Else
  38.         Get_Format = ""
  39.     End If
  40. End Function
  41.  
  42. Sub LoadFormatPT(nNames As String)
  43. If nNames <> "" Then
  44.     ListPT.PTVis = Val(Get_Format(nNames, "?pt.vis|"))
  45.     ListPT.PTFull = Val(Get_Format(nNames, "?pt.full|"))
  46.     ListPT.PTX1 = Val(Get_Format(nNames, "?pt.x1|"))
  47.     ListPT.PTX2 = Val(Get_Format(nNames, "?pt.x2|"))
  48.     ListPT.PTY1 = Val(Get_Format(nNames, "?pt.y1|"))
  49.     ListPT.PTY2 = Val(Get_Format(nNames, "?pt.y2|"))
  50.     
  51.     ListPT.PTIcon.File = Get_Format(nNames, "?pt.ico.file|")
  52.     ListPT.PTIcon.Index = Val(Get_Format(nNames, "?pt.ico.index|"))
  53. Else
  54.     ListPT = tmpListPT
  55. End If
  56.  
  57. End Sub
  58.