home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / code / cdspy / my2.bas < prev    next >
BASIC Source File  |  1995-02-13  |  46KB  |  1,527 lines

  1. Option Explicit
  2.  
  3. Type TM_OutlineRec
  4.   Bezeichnung As String * 25
  5.   hat_unter_obj As Integer
  6.   Vaterobj As Long
  7.   Kind As Long
  8.   Vor As Long
  9.   Nach As Long
  10.   Pfad As String * 128
  11.   Ebene As Integer
  12.   Visible As Integer
  13. End Type
  14.  
  15. Type TM_DBRec
  16.   Bezeichnung As String * 25
  17.   Vater As Long
  18.   Verzeichnis As String * 128
  19.   Code As Integer
  20. End Type
  21.  
  22. Global GM_Outline() As TM_OutlineRec
  23. Global GM_DB As TM_DBRec
  24.  
  25. Global Const GCM_INFOFILENAME = "CDINFO.TXT"
  26. Global Const GCM_VERZEICHNIS = "VERZEICHNIS="
  27. Global Const GCM_PROJEKT = "PROJEKT="
  28. Global Const GCM_INFO = "INFO="
  29. Global Const GCM_DEMO = "DEMO="
  30. Global Const GCM_INSTALL = "INSTALL="
  31. Global Const GCM_DBNAME = "SPY.DAT"
  32. Global Const GCM_EINSTELLUNGEN = "Einstellungen"
  33. Global Const GCM_SEPERATOR = ","
  34. ' SchaltflΣchen im Cmd_Array
  35. Global Const GCM_CMD_INFO = 0
  36. Global Const GCM_CMD_DEMO = 1
  37. Global Const GCM_CMD_COPY = 2
  38. Global Const GCM_CMD_INSTALL = 3
  39. Global Const GCM_CMD_CODE = 4
  40. Global Const GCM_CMD_HILFE = 5
  41.  
  42.  
  43. Global GM_DBAll() As TM_DBRec
  44.  
  45. Declare Function SendMessage Lib "User" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long
  46. Declare Function GetModuleUsage Lib "KERNEL" (ByVal InstanceID%) As Integer
  47.  
  48.  
  49. Global G_CDInfoFile As String
  50.  
  51. Global G_Control As Control
  52. Global G_EditFile As String
  53.  
  54. Function ExistDir% (drn$)
  55.   Dim temp$
  56.   On Error Resume Next
  57.   temp$ = Dir$(drn$, 16)
  58.   If Err <> 0 Or temp$ = "" Then
  59.     ExistDir% = False
  60.   Else
  61.     ExistDir% = True
  62.   End If
  63. End Function
  64.  
  65. Function exists (dn$) As Integer
  66.   Dim temp$
  67.   On Error Resume Next
  68.   temp$ = Dir$(dn$, 32)
  69.   exists = Not (Err <> 0 Or temp$ = "")
  70. End Function
  71.  
  72. Function FM_LiesDB (ID&)
  73.   Dim fd As Integer
  74.   If ID < 1 Then
  75.     Exit Function
  76.   End If
  77.   fd = FreeFile
  78.   Open GCM_DBNAME For Random As fd Len = Len(GM_DB)
  79.   If ID& * Len(GM_DB) <= LOF(fd) Then
  80.     Get #fd, ID&, GM_DB
  81.     FM_LiesDB = ID&
  82.   Else
  83.     FM_LiesDB = 0
  84.   End If
  85.   Close fd
  86. End Function
  87.  
  88. Function FM_Max (X, y)
  89.   If X > y Then
  90.     FM_Max = X
  91.   Else
  92.     FM_Max = y
  93.   End If
  94. End Function
  95.  
  96. Function FM_Min (X, y)
  97.   If X < y Then
  98.     FM_Min = X
  99.   Else
  100.     FM_Min = y
  101.   End If
  102. End Function
  103.  
  104. ' --------------------------------------------------------
  105. ' Die Funktion Parse_Zeile liefert aus einer gegebenen
  106. ' Zeile die Zeichenkette bis zum ersten Zeichen ch$ zurⁿck
  107. ' und reduziert die Zeile auf den nachfolgenden Teil der
  108. ' Zeile ▄ber den Parameter z$ wird die Zeile zur Initia-
  109. ' lisierung ⁿbergeben. Zum Abrufen der Werte wird ein
  110. ' Leerstring als z$ ⁿbergeben
  111. ' --------------------------------------------------------
  112. Function FM_ParseZeile$ (z$, ch$)
  113.   Static txt$, Zch$
  114.   Dim tmp$
  115.  
  116.   If z$ <> "" Then
  117.     ' Zeile initialisieren
  118.     txt$ = z$ + ch$
  119.     Zch$ = ch$
  120.   End If
  121.   If Trim$(txt$) <> "" Then
  122.     ' Zeichenkette bis zum ersten Tabulatorzeichen bestimmen
  123.     tmp$ = Left$(txt$, InStr(txt$, Zch$) - 1)
  124.     ' Zeile auf Teil nach erstem Tabulatorzeichen reduzieren
  125.     txt$ = LTrim$(Mid$(txt$, InStr(txt$, Zch$) + 1))
  126.   End If
  127.   FM_ParseZeile$ = tmp$
  128. End Function
  129.  
  130. Function FM_SchreibDB ()
  131.   Dim fd As Integer
  132.   Dim pos%
  133.   fd = FreeFile
  134.   Open GCM_DBNAME For Random As fd Len = Len(GM_DB)
  135.   pos% = (LOF(fd) / Len(GM_DB)) + 1
  136.   Put #fd, pos%, GM_DB
  137.   FM_SchreibDB = pos%
  138.   Close fd
  139. End Function
  140.  
  141. Function FM_Verz$ (Verz$)
  142.   Dim tmp$
  143.   tmp$ = Trim$(Verz$)
  144.   If Right$(tmp$, 1) <> "\" Then
  145.     tmp$ = tmp$ + "\"
  146.   End If
  147.   FM_Verz$ = tmp$
  148. End Function
  149.  
  150. Sub ListSubDirs (path$, d() As TM_DBRec)
  151.   Const ATTR_DIRECTORY = 16
  152.   Dim position%, Count%, Vater%
  153.  
  154.   Dim I, dirname
  155.  
  156.   On Error Resume Next
  157.   If Right$(path$, 1) <> "\" Then path$ = path$ + "\"
  158.   If ExistDir(path$) Then
  159.     position% = 1
  160.     Count% = 1
  161.     dirname = Dir(path, ATTR_DIRECTORY) ' Erster Verzeichnisname
  162.  
  163.     'Alle Verzeichnisse innerhalb dieses Verzeichnisses in D() speichern
  164.     ReDim d(Count%)
  165.     d(Count%).Verzeichnis$ = path$
  166.     d(Count%).Vater = 0
  167.     PM_GetCDINFO d(Count%)
  168.     Count% = Count% + 1
  169.     Do
  170.       Do While dirname <> ""
  171.         DoEvents
  172.         If dirname <> "." And dirname <> ".." Then
  173.           If (GetAttr(path + dirname) And ATTR_DIRECTORY) = ATTR_DIRECTORY Then
  174.             ReDim Preserve d(Count%)
  175.             d(Count%).Verzeichnis = path + dirname
  176.             d(Count%).Vater = position%
  177.             PM_GetCDINFO d(Count%)
  178.             Count% = Count% + 1
  179.           End If
  180.         End If
  181.         dirname = Dir   ' Get another directory name.
  182.       Loop
  183.       position% = position% + 1
  184.       If position% >= Count% Then Exit Do
  185.       path$ = Trim$(d(position%).Verzeichnis$) + "\"
  186.       dirname = Dir(path, ATTR_DIRECTORY)
  187.     Loop
  188.   End If
  189. End Sub
  190.  
  191. Sub PM_ChangeCmdState (index%)
  192.   Static old%
  193.   Dim Res&
  194.   If Haupt!Cmd_Array(index%).Enabled Then
  195.     Res& = SendMessage(Haupt!Cmd_Array(index%).hWnd, &H403, -1, 0)
  196.   Else
  197.     Res& = SendMessage(Haupt!Cmd_Array(index%).hWnd, &H403, 0, 0)
  198.   End If
  199.   If old% = index% Then Exit Sub
  200.   Res& = SendMessage(Haupt!Cmd_Array(old%).hWnd, &H403, 0, 0)
  201.   old% = index%
  202. End Sub
  203.  
  204. Sub PM_ClearDB ()
  205.   Dim fd As Integer
  206.   fd = FreeFile
  207.   Kill GCM_DBNAME
  208. End Sub
  209.  
  210. Sub PM_EditFile (dn$)
  211.   Dim fd As Integer
  212.   Dim L_LengthOfFile%
  213.   Dim tmp$
  214.   fd = FreeFile
  215.   L_LengthOfFile% = FileLen(dn$)
  216.   tmp$ = Space$(L_LengthOfFile%)
  217.   Open dn$ For Binary As fd Len = L_LengthOfFile%
  218.   Get fd, 1, tmp$
  219.   G_EditFile$ = tmp$
  220.   Close fd
  221.   EditFile.Caption = dn$
  222.   EditFile.Show
  223. End Sub
  224.  
  225. Sub PM_GenerateDB (Pfad$)
  226.   Dim I%, Res%
  227.   If ExistDir(Pfad$) Then
  228.     PM_ClearDB
  229.     ListSubDirs Pfad$, GM_DBAll()
  230.     For I% = 1 To UBound(GM_DBAll)
  231.       GM_DB = GM_DBAll(I%)
  232.       Res% = FM_SchreibDB()
  233.     Next I%
  234.   End If
  235. End Sub
  236.  
  237. Sub PM_GetCDINFO (d As TM_DBRec)
  238.   Dim tmp$, fd%, Zeile$, pos%
  239.   tmp$ = Trim$(d.Verzeichnis$)
  240.   If Right$(tmp$, 1) <> "\" Then tmp$ = tmp$ + "\"
  241.   tmp$ = Trim$(tmp$) + "CDINFO.TXT"
  242.   fd = FreeFile
  243.   On Error Resume Next
  244.   Open tmp$ For Input As fd
  245.   If Err <> 0 Then Exit Sub
  246.   If Not EOF(fd) Then
  247.     Line Input #fd, Zeile$
  248.     pos% = InStr(UCase$(Zeile$), GCM_VERZEICHNIS)
  249.     If pos% Then
  250.       d.Bezeichnung$ = Mid$(Zeile$, pos% + Len(GCM_VERZEICHNIS))
  251.     End If
  252.     If Not EOF(fd) Then
  253.       Line Input #fd, Zeile$
  254.       pos% = InStr(UCase$(Zeile$), GCM_PROJEKT)
  255.       If pos% Then
  256.         d.Code = 1
  257.       Else
  258.         d.Code = 0
  259.       End If
  260.     End If
  261.   End If
  262.   Close fd
  263. End Sub
  264.  
  265. Sub PM_GetChilds (ID&, d())
  266.   Dim fd As Integer
  267.   Dim I%
  268.   fd = FreeFile
  269.   Open GCM_DBNAME For Random As fd Len = Len(GM_DB)
  270.   For I% = 1 To LOF(fd) / Len(GM_DB)
  271.     Get #fd, I%, GM_DB
  272.     If GM_DB.Vater = ID& Then
  273.       d(UBound(d)) = I%
  274.       ReDim Preserve d(UBound(d) + 1)
  275.     End If
  276.   Next I%
  277.   Close fd
  278. End Sub
  279.  
  280. Sub PM_GetFileInfo (dn$)
  281.   Dim ds As Integer
  282.   Dim pos%
  283.   Dim Zeile$
  284.   Dim Ub%
  285.   ds = FreeFile
  286.   Open dn$ For Input As ds
  287.   Line Input #ds, Zeile$
  288.   pos% = InStr(Zeile$, GCM_VERZEICHNIS)
  289.   If pos% Then ' Verzeichnis
  290.     On Error Resume Next
  291.     Ub% = UBound(GM_Outline)
  292.     On Error GoTo 0
  293.     Ub% = Ub% + 1
  294.     ReDim Preserve GM_Outline(Ub%)
  295.     GM_Outline(Ub%).Bezeichnung = Mid$(Zeile$, pos% + Len(GCM_VERZEICHNIS))
  296.   End If
  297.   If Not EOF(ds) Then
  298.     Line Input #ds, Zeile$
  299.     pos% = InStr(Zeile$, GCM_PROJEKT)
  300.     If pos% Then
  301.       GM_Outline(Ub%).hat_unter_obj = False
  302.     Else
  303.       GM_Outline(Ub%).hat_unter_obj = True
  304.     End If
  305.   Else
  306.     GM_Outline(Ub%).hat_unter_obj = True
  307.   End If
  308.   Close #ds
  309. End Sub
  310.  
  311. Sub PM_GetParents (ID&, d())
  312.   Dim fd As Integer
  313.   Dim I%
  314.   fd = FreeFile
  315.   Open GCM_DBNAME For Random As fd Len = Len(GM_DB)
  316.   For I% = 1 To LOF(fd) / Len(GM_DB)
  317.     Get #fd, I%, GM_DB
  318.     If GM_DB.Vater = ID& Then
  319.       d(UBound(d)) = I%
  320.       ReDim Preserve d(UBound(d) + 1)
  321.     End If
  322.   Next I%
  323.   Close fd
  324. End Sub
  325.  
  326. Sub PM_LeseEintrag (index As Long, ByVal ID As Long, Ebene%)
  327.   Dim Vater&
  328.   Dim LM_DB As TM_DBRec
  329.   Dim tmpIndex&
  330.   ReDim d(1)
  331.   Dim cnt%, I%, Res%
  332.   Res% = FM_LiesDB(ID&)
  333.   LM_DB = GM_DB
  334.   If ID > 0 Then
  335.     PM_LeseEintrag index&, LM_DB.Vater&, Ebene%
  336.     PM_GetParents ID&, d()
  337.     For I% = 1 To UBound(d) - 1
  338.       Res% = FM_LiesDB(CLng(d(I%)))
  339.       If Res% <> 0 Then
  340.         Haupt.Outline.AddItem GM_DB.Bezeichnung, index
  341.         Haupt.Outline.ItemData(index) = Res%
  342.         Haupt.Outline.Indent(index) = Ebene%
  343.         If Not GM_DB.Code Then
  344.           Haupt.Outline.PictureType(index&) = 0
  345.         Else
  346.           Haupt.Outline.PictureType(index&) = 2
  347.         End If
  348.         If Haupt.Outline.ItemData(index) = LM_DB.Vater& Then
  349.           tmpIndex& = index&
  350.           Haupt.Outline.Expand(index&) = True
  351.         End If
  352.         index& = index& + 1
  353.       End If
  354.     Next I%
  355.      
  356.     If tmpIndex& <> 0 Then index& = tmpIndex& + 1
  357.   Else
  358.     Res% = FM_LiesDB(1)
  359.     Ebene% = 1
  360.     If Res% <> 0 Then
  361.       Haupt.Outline.AddItem GM_DB.Bezeichnung, index
  362.       Haupt.Outline.ItemData(index) = Res%
  363.       Haupt.Outline.Indent(index) = Ebene%
  364.       If Not GM_DB.Code Then
  365.         Haupt.Outline.PictureType(index&) = 0
  366.       Else
  367.         Haupt.Outline.PictureType(index&) = 2
  368.       End If
  369.       If Haupt.Outline.ItemData(index) = LM_DB.Vater& Then
  370.         Haupt.Outline.Expand(index&) = True
  371.         tmpIndex& = index&
  372.       End If
  373.       index& = index& + 1
  374.     End If
  375.   End If
  376.   Ebene% = Ebene% + 1
  377. End Sub
  378.  
  379. Sub PM_Lies (ID&)
  380.   Dim index&
  381.   Dim Ebene%
  382.   index& = 0
  383.   Haupt.Outline.Clear
  384.   PM_LeseEintrag index&, ID&, Ebene%
  385. End Sub
  386.  
  387. Sub PM_LiesCDInfo (Verzeichnis$)
  388.   Dim fd As Integer
  389.   Dim l&
  390.   Dim L_CDInfoFilename$
  391.   If Right$(Verzeichnis$, 1) <> "\" Then
  392.     L_CDInfoFilename$ = Verzeichnis$ + "\" + GCM_INFOFILENAME
  393.   Else
  394.     L_CDInfoFilename$ = Verzeichnis$ + GCM_INFOFILENAME
  395.   End If
  396.   l& = FileLen(L_CDInfoFilename$)
  397.   G_CDInfoFile$ = Space$(l&)
  398.   fd = FreeFile
  399.   Open L_CDInfoFilename$ For Binary As fd Len = l&
  400.   Get #fd, , G_CDInfoFile$
  401.   Close fd
  402. End Sub
  403.  
  404. ' --------------------------------------------------------
  405. ' Liest die ben÷tigten Control-Informationen aus dem
  406. ' Initialisierungsfile
  407. ' --------------------------------------------------------
  408. ' Autor   : NM/ag
  409. ' Datum   : 10.2.94
  410. ' Version : 1.0
  411. ' --------------------------------------------------------
  412. Sub PM_LiesControl (Ctrl As Control)
  413.   Dim L_Ini_Zeile$, Eigenschaft$
  414.   L_Ini_Zeile$ = F_GetPrivatIni("Einstellungen", Ctrl.Tag)
  415.   Eigenschaft$ = FM_ParseZeile$((L_Ini_Zeile$), GCM_SEPERATOR)
  416.   If TypeOf Ctrl Is Label Then
  417.     If Eigenschaft$ = "" Then Exit Sub
  418.     Ctrl.FontName = Eigenschaft$
  419.     Eigenschaft$ = FM_ParseZeile$("", "")
  420.     If Eigenschaft$ = "" Then Exit Sub
  421.     Ctrl.FontSize = Val(Eigenschaft$)
  422.     Eigenschaft$ = FM_ParseZeile$("", "")
  423.     If Eigenschaft$ = "" Then Exit Sub
  424.     Ctrl.FontBold = Val(Eigenschaft$)
  425.     Eigenschaft$ = FM_ParseZeile$("", "")
  426.     If Eigenschaft$ = "" Then Exit Sub
  427.     Ctrl.ForeColor = Val(Eigenschaft$)
  428.     Eigenschaft$ = FM_ParseZeile$("", "")
  429.     If Eigenschaft$ = "" Then Exit Sub
  430.     Ctrl.BackColor = Val(Eigenschaft$)
  431.   Else
  432.     If Eigenschaft$ = "" Then Exit Sub
  433.     Ctrl.FontName = Eigenschaft$
  434.     Eigenschaft$ = FM_ParseZeile$("", "")
  435.     If Eigenschaft$ = "" Then Exit Sub
  436.     Ctrl.FontSize = Val(Eigenschaft$)
  437.     Eigenschaft$ = FM_ParseZeile$("", "")
  438.     If Eigenschaft$ = "" Then Exit Sub
  439.     Ctrl.FontBold = Val(Eigenschaft$)
  440.     Eigenschaft$ = FM_ParseZeile$("", "")
  441.     If Eigenschaft$ = "" Then Exit Sub
  442.     Ctrl.ForeColor = Val(Eigenschaft$)
  443.     Eigenschaft$ = FM_ParseZeile$("", "")
  444.     If Eigenschaft$ = "" Then Exit Sub
  445.     Ctrl.BackColor = Val(Eigenschaft$)
  446.   End If
  447. End Sub
  448.  
  449. ' --------------------------------------------------------
  450. ' Liest die ben÷tigten Formular-Informationen aus dem
  451. ' Initialisierungsfile
  452. ' --------------------------------------------------------
  453. ' Autor   : NM/ag
  454. ' Datum   : 10.2.94
  455. ' Version : 1.0
  456. ' --------------------------------------------------------
  457. Sub PM_LiesForm (Frm As Form)
  458.   Dim L_Ini_Zeile$, Eigenschaft$
  459.   L_Ini_Zeile$ = F_GetPrivatIni("Einstellungen", Frm.Tag)
  460.   Eigenschaft$ = FM_ParseZeile$((L_Ini_Zeile$), GCM_SEPERATOR)
  461.   If Eigenschaft$ = "" Then Exit Sub
  462.   Frm.Top = Val(Eigenschaft$)
  463.   Eigenschaft$ = FM_ParseZeile$("", "")
  464.   If Eigenschaft$ = "" Then Exit Sub
  465.   Frm.Left = Val(Eigenschaft$)
  466.   Eigenschaft$ = FM_ParseZeile$("", "")
  467.   If Eigenschaft$ = "" Then Exit Sub
  468.   Frm.Width = Val(Eigenschaft$)
  469.   Eigenschaft$ = FM_ParseZeile$("", "")
  470.   If Eigenschaft$ = "" Then Exit Sub
  471.   Frm.Height = Val(Eigenschaft$)
  472.   Eigenschaft$ = FM_ParseZeile$("", "")
  473.   If Eigenschaft$ = "" Then Exit Sub
  474.   Frm.WindowState = Val(Eigenschaft$)
  475. End Sub
  476.  
  477. Sub PM_LiesOutline (pos%)
  478.   Dim fd As Integer
  479.   fd = FreeFile
  480.   Open GCM_DBNAME For Random As fd Len = Len(GM_DB)
  481.   Get fd, pos%, GM_DB
  482.   Haupt.Outline.AddItem GM_DB.Bezeichnung
  483.   Haupt.Outline.ItemData(0) = pos%
  484.   Haupt.Outline.Indent(1) = 2
  485.   Close fd
  486.   Haupt.Outline.Refresh
  487. End Sub
  488.  
  489. Sub PM_ReadCDInfo ()
  490.   Dim Res&
  491.   Dim pos%
  492.   Dim L_CDInfoCommands$
  493.   Dim tmp$
  494.   Dim MakDatei$, HilfeDatei$
  495.   Res& = FM_LiesDB(Val(Haupt!Outline.ItemData(Haupt!Outline.ListIndex)))
  496.   PM_LiesCDInfo Trim$(GM_DB.Verzeichnis$)
  497.   pos% = InStr(UCase$(G_CDInfoFile$), GCM_INFO)
  498.   If pos% <> 0 Then
  499.     Haupt!Lbl_Info.Caption = Mid$(G_CDInfoFile$, pos% + Len(GCM_INFO))
  500.     Haupt!Lbl_Info.Visible = True
  501.     Haupt!Cmd_Array(GCM_CMD_INFO).Enabled = True
  502.     Haupt!Cmd_Array(GCM_CMD_INFO) = True
  503.     L_CDInfoCommands$ = UCase$(Left$(G_CDInfoFile$, pos% - 1))
  504.   Else
  505.     Haupt!Cmd_Array(GCM_CMD_INFO).Enabled = False
  506.     Haupt!Lbl_Info.Visible = False
  507.     Haupt!Lbl_Info.Caption = ""
  508.     Haupt!Cmd_Array(6) = True
  509.     L_CDInfoCommands$ = UCase$(G_CDInfoFile$)
  510.   End If
  511.   pos% = InStr(L_CDInfoCommands$, GCM_DEMO)
  512.   If pos% <> 0 Then
  513.     Haupt!Cmd_Array(GCM_CMD_DEMO).Enabled = True
  514.     tmp$ = Mid$(L_CDInfoCommands$ + Chr$(13), pos% + Len(GCM_DEMO))
  515.     Haupt!Cmd_Array(GCM_CMD_DEMO).Tag = Left$(tmp$, InStr(tmp$, Chr$(13)) - 1)
  516.   Else
  517.     Haupt!Cmd_Array(GCM_CMD_DEMO).Enabled = False
  518.   End If
  519.   pos% = InStr(L_CDInfoCommands$, GCM_PROJEKT)
  520.   If pos% <> 0 Then
  521.     Haupt!Cmd_Array(GCM_CMD_COPY).Enabled = True
  522.   Else
  523.     Haupt!Cmd_Array(GCM_CMD_COPY).Enabled = False
  524.   End If
  525.   tmp$ = FM_Verz$(GM_DB.Verzeichnis$) + "*.MAK"
  526.   MakDatei$ = Dir$(tmp$)
  527.   If MakDatei$ <> "" Then
  528.     Haupt!Cmd_Array(GCM_CMD_CODE).Enabled = True
  529.     Haupt!Cmd_Array(GCM_CMD_CODE).Tag = FM_Verz$(GM_DB.Verzeichnis$)
  530.   Else
  531.     Haupt!Cmd_Array(GCM_CMD_CODE).Enabled = False
  532.   End If
  533.   pos% = InStr(L_CDInfoCommands$, GCM_INSTALL)
  534.   If pos% <> 0 Then
  535.     Haupt!Cmd_Array(GCM_CMD_INSTALL).Enabled = True
  536.     tmp$ = Mid$(L_CDInfoCommands$ + Chr$(13), pos% + Len(GCM_INSTALL))
  537.     Haupt!Cmd_Array(GCM_CMD_INSTALL).Tag = Left$(tmp$, InStr(tmp$, Chr$(13)) - 1)
  538.   Else
  539.     Haupt!Cmd_Array(GCM_CMD_INSTALL).Enabled = False
  540.   End If
  541.   tmp$ = FM_Verz$(GM_DB.Verzeichnis$) + "*.HLP"
  542.   HilfeDatei$ = Dir$(tmp$)
  543.   If HilfeDatei$ <> "" Then
  544.     Haupt!Cmd_Array(GCM_CMD_HILFE).Enabled = True
  545.     Haupt!Cmd_Array(GCM_CMD_HILFE).Tag = "WinHelp " & FM_Verz$(GM_DB.Verzeichnis$) & HilfeDatei$
  546.   Else
  547.     Haupt!Cmd_Array(GCM_CMD_HILFE).Enabled = False
  548.   End If
  549.   PM_ChangeCmdState (0)
  550. End Sub
  551.  
  552. Sub PM_ReadItems (ByVal Vater&, ByVal ListIndex%, ByVal Ebene%)
  553.   ReDim d(1)
  554.   Dim cnt%, I%, Res%
  555.   PM_GetParents Vater&, d()
  556.   For I% = 1 To UBound(d) - 1
  557.     Res% = FM_LiesDB(CLng(d(I%)))
  558.     If Res% <> 0 Then
  559.       ListIndex% = ListIndex% + 1
  560.       If ListIndex% < Haupt.Outline.ListCount Then
  561.         If Haupt.Outline.List(ListIndex%) = "Hilfs" Then
  562.           Haupt.Outline.List(ListIndex%) = GM_DB.Bezeichnung$
  563.         Else
  564.           Haupt.Outline.AddItem GM_DB.Bezeichnung, ListIndex%
  565.         End If
  566.       Else
  567.         Haupt.Outline.AddItem GM_DB.Bezeichnung, ListIndex%
  568.       End If
  569.       Haupt.Outline.ItemData(ListIndex%) = Res%
  570.       Haupt.Outline.Indent(ListIndex%) = Ebene%
  571.       If GM_DB.Code = 0 Then
  572.         Haupt.Outline.PictureType(ListIndex%) = 0
  573.         ListIndex% = ListIndex% + 1
  574.         Haupt.Outline.AddItem "Hilfs", ListIndex%
  575.         Haupt.Outline.Indent(ListIndex%) = Ebene% + 1
  576.       Else
  577.         Haupt.Outline.PictureType(ListIndex%) = 2
  578.       End If
  579.     End If
  580.   Next I%
  581. End Sub
  582.  
  583. Sub PM_RefreshAnzeige ()
  584.   Haupt!Lbl_Info.Move 4, 2
  585.   Haupt!Lbl_Info.Height = Haupt!Pic_Anzeige.Height - 4
  586.   Haupt!Lbl_Info.Width = FM_Max(Haupt!Pic_Anzeige.Width - 6, 0)
  587.   Haupt!File1.Move 4, 2
  588.   Haupt!File1.Width = Haupt!Lbl_Info.Width
  589.   Haupt!File1.Height = Haupt!Lbl_Info.Height
  590.   If Haupt!Lbl_Info.Visible Then
  591.     Haupt!Pic_Anzeige.BackColor = Haupt!Lbl_Info.BackColor
  592.   Else
  593.     Haupt!Pic_Anzeige.BackColor = Haupt!File1.BackColor
  594.   End If
  595. End Sub
  596.  
  597. Sub PM_ScanDirs (Pfad$, Vater&)
  598.   Dim tmp$, Vater_Neu&, totPfad$
  599.   GM_DB.Bezeichnung$ = "Test"
  600.   GM_DB.Vater& = Vater&
  601.   GM_DB.Verzeichnis$ = Pfad$
  602.   Debug.Print Pfad$
  603.   Vater_Neu& = FM_SchreibDB()
  604.   If Right$(Pfad$, 1) <> "\" Then
  605.     totPfad$ = Pfad$ + "\"
  606.   Else
  607.     totPfad$ = Pfad$ + ""
  608.   End If
  609.   tmp$ = Dir$(totPfad$ + "*.*", 16)
  610.   Do While Left$(tmp$, 1) = "."
  611.     tmp$ = Dir$
  612.   Loop
  613.   Do While tmp$ <> ""
  614.     If GetAttr(totPfad$ + tmp$) = 16 Then ' Verzeichnis
  615.       PM_ScanDirs totPfad$ + tmp$, Vater_Neu&
  616.     End If
  617.     tmp$ = Dir$
  618.   Loop
  619. End Sub
  620.  
  621. ' --------------------------------------------------------
  622. ' Speichert die ben÷tigten Control-Informationen im
  623. ' Initialisierungsfile ab
  624. ' --------------------------------------------------------
  625. ' Autor   : NM/ag
  626. ' Datum   : 10.2.94
  627. ' Version : 1.0
  628. ' --------------------------------------------------------
  629. Sub PM_SchreibControl (Ctrl As Control)
  630.   Dim L_Ini_Zeile$
  631.   If TypeOf Ctrl Is Label Then
  632.     L_Ini_Zeile$ = Ctrl.FontName & GCM_SEPERATOR
  633.     L_Ini_Zeile$ = L_Ini_Zeile$ & Trim$(Str$(Ctrl.FontSize)) & GCM_SEPERATOR
  634.     L_Ini_Zeile$ = L_Ini_Zeile$ & Ctrl.FontBold & GCM_SEPERATOR
  635.     L_Ini_Zeile$ = L_Ini_Zeile$ & Ctrl.ForeColor & GCM_SEPERATOR
  636.     L_Ini_Zeile$ = L_Ini_Zeile$ & Ctrl.BackColor
  637.   Else
  638.     L_Ini_Zeile$ = Ctrl.FontName & GCM_SEPERATOR
  639.     L_Ini_Zeile$ = L_Ini_Zeile$ & Trim$(Str$(Ctrl.FontSize)) & GCM_SEPERATOR
  640.     L_Ini_Zeile$ = L_Ini_Zeile$ & Ctrl.FontBold & GCM_SEPERATOR
  641.     L_Ini_Zeile$ = L_Ini_Zeile$ & Ctrl.ForeColor & GCM_SEPERATOR
  642.     L_Ini_Zeile$ = L_Ini_Zeile$ & Ctrl.BackColor
  643.   End If
  644.   P_WritePrivatInit GCM_EINSTELLUNGEN, (Ctrl.Tag), L_Ini_Zeile$
  645. End Sub
  646.  
  647. ' --------------------------------------------------------
  648. ' Speichert die ben÷tigten Formular-Informationen im
  649. ' Initialisierungsfile ab
  650. ' --------------------------------------------------------
  651. ' Autor   : NM/ag
  652. ' Datum   : 10.2.94
  653. ' Version : 1.0
  654. ' --------------------------------------------------------
  655. Sub PM_SchreibForm (Frm As Form)
  656.   Dim L_Ini_Zeile$, L_tmp_State%
  657.   L_tmp_State% = Frm.WindowState
  658.   Frm.WindowState = 0
  659.   L_Ini_Zeile$ = Frm.Top & GCM_SEPERATOR
  660.   L_Ini_Zeile$ = L_Ini_Zeile$ & Frm.Left & GCM_SEPERATOR
  661.   L_Ini_Zeile$ = L_Ini_Zeile$ & Frm.Width & GCM_SEPERATOR
  662.   L_Ini_Zeile$ = L_Ini_Zeile$ & Frm.Height & GCM_SEPERATOR
  663.   L_Ini_Zeile$ = L_Ini_Zeile$ & L_tmp_State%
  664.   P_WritePrivatInit GCM_EINSTELLUNGEN, (Frm.Tag), L_Ini_Zeile$
  665. End Sub
  666.  
  667. Sub PM_SeekList (Cntrl As Control, Eintrag$)
  668.   Dim I%
  669.   For I% = 0 To Cntrl.ListCount - 1
  670.     If Cntrl.List(I%) = Eintrag Then
  671.       Cntrl.ListIndex = I%
  672.       Exit For
  673.     End If
  674.   Next I%
  675. End Sub
  676.  
  677. Sub PM_ShellAndWait (CommandString$)
  678.   Dim ID%
  679.   Dim X%
  680.   ID% = Shell(CommandString$, 1)
  681.   Do
  682.     DoEvents
  683.     Debug.Print Timer
  684.   Loop Until GetModuleUsage(ID%) = 0
  685. End Sub
  686.  
  687. Sub PM_Show3D (Frm As Form)
  688. ' Colors
  689.  
  690. Const BLACK = &H0&
  691. Const WHITE = &HFFFFFF
  692. Const GRAY = &HC0C0C0
  693. Const DGRAY = &H808080
  694.  
  695. Dim ct As Control
  696. Dim I As Integer
  697. Dim Tx As Integer
  698. Dim Ty As Integer
  699.  
  700. Tx = 1
  701. Ty = 1
  702. Frm.AutoRedraw = True
  703.  
  704. ' Zeichne Formular
  705. Frm.BackColor = &HC0C0C0
  706. If Frm.BorderStyle = 0 Or Frm.BorderStyle = 1 Or Frm.BorderStyle = 3 Then
  707.     Frm.DrawWidth = 2
  708.     Frm.Line (0, 0)-(Frm.ScaleWidth, Frm.ScaleHeight), DGRAY, B
  709.     Frm.DrawWidth = 1
  710.     Frm.Line (0, 0)-(Frm.ScaleWidth, Frm.ScaleHeight), WHITE, B
  711. End If
  712.  
  713. For I = 0 To Frm.Controls.Count - 1
  714.     Set ct = Frm.Controls(I)
  715.     If TypeOf ct Is Shape Then
  716.         ct.Visible = False
  717.         Frm.DrawWidth = 2
  718.         Frm.Line (ct.Left - (0 * Tx), ct.Top - (0 * Ty))-(ct.Width + (1 * Tx) + ct.Left, ct.Top + ct.Height + (0 * Ty)), DGRAY, B
  719.         Frm.DrawWidth = 1
  720.         Frm.Line (ct.Left - (1 * Tx), ct.Top - (1 * Ty))-(ct.Width + (0 * Tx) + ct.Left, ct.Top + ct.Height - (1 * Ty)), WHITE, B
  721.     End If
  722.     If TypeOf ct Is Label Then
  723.  
  724.         Frm.FontSize = ct.FontSize
  725.         Frm.FontName = ct.FontName
  726.         Frm.FontBold = ct.FontBold
  727.         ct.Visible = False
  728.         Frm.CurrentX = ct.Left + Tx
  729.         Frm.CurrentY = ct.Top + Ty
  730.         Frm.ForeColor = WHITE
  731.         Frm.Print ct.Caption
  732.         Frm.CurrentX = ct.Left
  733.         Frm.CurrentY = ct.Top
  734.         Frm.ForeColor = BLACK
  735.         Frm.Print ct.Caption
  736.         ct.Visible = True
  737.     End If
  738.     If TypeOf ct Is TextBox Then
  739.         Frm.Line (ct.Left + (1 * Tx), ct.Top + (1 * Ty))-(ct.Width + (0 * Tx) + ct.Left, ct.Top + ct.Height + (0 * Ty)), WHITE, B
  740.         Frm.Line (ct.Left - (1 * Tx), ct.Top - (1 * Ty))-(ct.Width + (1 * Tx) + ct.Left, ct.Top + ct.Height + (1 * Ty)), DGRAY, B
  741.         Frm.Line (ct.Left - (2 * Tx), ct.Top - (2 * Ty))-(ct.Width + ct.Left + (1 * Tx), ct.Top + ct.Height + (1 * Ty)), GRAY, B
  742.     End If
  743.     If TypeOf ct Is ListBox Then
  744.         Frm.Line (ct.Left + (1 * Tx), ct.Top + (1 * Ty))-(ct.Width + (0 * Tx) + ct.Left, ct.Top + ct.Height + (0 * Ty)), DGRAY, B
  745.         Frm.Line (ct.Left - (1 * Tx), ct.Top - (1 * Ty))-(ct.Width + (1 * Tx) + ct.Left, ct.Top + ct.Height + (1 * Ty)), WHITE, B
  746.         Frm.Line (ct.Left - (2 * Tx), ct.Top - (2 * Ty))-(ct.Width + ct.Left + (1 * Tx), ct.Top + ct.Height + (1 * Ty)), GRAY, B
  747.     End If
  748.     If TypeOf ct Is ComboBox Then
  749.         Frm.Line (ct.Left + (1 * Tx), ct.Top + (1 * Ty))-(ct.Width + (0 * Tx) + ct.Left, ct.Top + ct.Height + (0 * Ty)), DGRAY, B
  750.         Frm.Line (ct.Left - (1 * Tx), ct.Top - (1 * Ty))-(ct.Width + (1 * Tx) + ct.Left, ct.Top + ct.Height + (1 * Ty)), WHITE, B
  751.         Frm.Line (ct.Left - (2 * Tx), ct.Top - (2 * Ty))-(ct.Width + ct.Left + (1 * Tx), ct.Top + ct.Height + (1 * Ty)), GRAY, B
  752.     End If
  753.     If TypeOf ct Is Line Then
  754.         ct.Visible = False
  755.         Frm.Line (ct.X1 + (1 * Tx), ct.Y1 + (1 * Ty))-(ct.X2 + (1 * Tx), ct.Y2 + (1 * Ty)), DGRAY
  756.         Frm.Line (ct.X1 + (0 * Tx), ct.Y1 + (0 * Ty))-(ct.X2 + (0 * Tx), ct.Y2 + (0 * Ty)), WHITE
  757.     End If
  758.  
  759. Next I
  760. Frm.AutoRedraw = False
  761.  
  762. End Sub
  763.  
  764. Option Explicit
  765.  
  766. Type TM_OutlineRec
  767.   Bezeichnung As String * 25
  768.   hat_unter_obj As Integer
  769.   Vaterobj As Long
  770.   Kind As Long
  771.   Vor As Long
  772.   Nach As Long
  773.   Pfad As String * 128
  774.   Ebene As Integer
  775.   Visible As Integer
  776. End Type
  777.  
  778. Type TM_DBRec
  779.   Bezeichnung As String * 25
  780.   Vater As Long
  781.   Verzeichnis As String * 128
  782.   Code As Integer
  783. End Type
  784.  
  785. Global GM_Outline() As TM_OutlineRec
  786. Global GM_DB As TM_DBRec
  787.  
  788. Global Const GCM_INFOFILENAME = "CDINFO.TXT"
  789. Global Const GCM_VERZEICHNIS = "VERZEICHNIS="
  790. Global Const GCM_PROJEKT = "PROJEKT="
  791. Global Const GCM_INFO = "INFO="
  792. Global Const GCM_DEMO = "DEMO="
  793. Global Const GCM_INSTALL = "INSTALL="
  794. Global Const GCM_DBNAME = "SPY.DAT"
  795. Global Const GCM_EINSTELLUNGEN = "Einstellungen"
  796. Global Const GCM_SEPERATOR = ","
  797. ' SchaltflΣchen im Cmd_Array
  798. Global Const GCM_CMD_INFO = 0
  799. Global Const GCM_CMD_DEMO = 1
  800. Global Const GCM_CMD_COPY = 2
  801. Global Const GCM_CMD_INSTALL = 3
  802. Global Const GCM_CMD_CODE = 4
  803. Global Const GCM_CMD_HILFE = 5
  804.  
  805.  
  806. Global GM_DBAll() As TM_DBRec
  807.  
  808. Declare Function SendMessage Lib "User" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long
  809. Declare Function GetModuleUsage Lib "KERNEL" (ByVal InstanceID%) As Integer
  810.  
  811.  
  812. Global G_CDInfoFile As String
  813.  
  814. Global G_Control As Control
  815. Global G_EditFile As String
  816.  
  817. Function ExistDir% (drn$)
  818.   Dim temp$
  819.   On Error Resume Next
  820.   temp$ = Dir$(drn$, 16)
  821.   If Err <> 0 Or temp$ = "" Then
  822.     ExistDir% = False
  823.   Else
  824.     ExistDir% = True
  825.   End If
  826. End Function
  827.  
  828. Function exists (dn$) As Integer
  829.   Dim temp$
  830.   On Error Resume Next
  831.   temp$ = Dir$(dn$, 32)
  832.   exists = Not (Err <> 0 Or temp$ = "")
  833. End Function
  834.  
  835. Function FM_LiesDB (ID&)
  836.   Dim fd As Integer
  837.   If ID < 1 Then
  838.     Exit Function
  839.   End If
  840.   fd = FreeFile
  841.   Open GCM_DBNAME For Random As fd Len = Len(GM_DB)
  842.   If ID& * Len(GM_DB) <= LOF(fd) Then
  843.     Get #fd, ID&, GM_DB
  844.     FM_LiesDB = ID&
  845.   Else
  846.     FM_LiesDB = 0
  847.   End If
  848.   Close fd
  849. End Function
  850.  
  851. Function FM_Max (X, y)
  852.   If X > y Then
  853.     FM_Max = X
  854.   Else
  855.     FM_Max = y
  856.   End If
  857. End Function
  858.  
  859. Function FM_Min (X, y)
  860.   If X < y Then
  861.     FM_Min = X
  862.   Else
  863.     FM_Min = y
  864.   End If
  865. End Function
  866.  
  867. ' --------------------------------------------------------
  868. ' Die Funktion Parse_Zeile liefert aus einer gegebenen
  869. ' Zeile die Zeichenkette bis zum ersten Zeichen ch$ zurⁿck
  870. ' und reduziert die Zeile auf den nachfolgenden Teil der
  871. ' Zeile ▄ber den Parameter z$ wird die Zeile zur Initia-
  872. ' lisierung ⁿbergeben. Zum Abrufen der Werte wird ein
  873. ' Leerstring als z$ ⁿbergeben
  874. ' --------------------------------------------------------
  875. Function FM_ParseZeile$ (z$, ch$)
  876.   Static txt$, Zch$
  877.   Dim tmp$
  878.  
  879.   If z$ <> "" Then
  880.     ' Zeile initialisieren
  881.     txt$ = z$ + ch$
  882.     Zch$ = ch$
  883.   End If
  884.   If Trim$(txt$) <> "" Then
  885.     ' Zeichenkette bis zum ersten Tabulatorzeichen bestimmen
  886.     tmp$ = Left$(txt$, InStr(txt$, Zch$) - 1)
  887.     ' Zeile auf Teil nach erstem Tabulatorzeichen reduzieren
  888.     txt$ = LTrim$(Mid$(txt$, InStr(txt$, Zch$) + 1))
  889.   End If
  890.   FM_ParseZeile$ = tmp$
  891. End Function
  892.  
  893. Function FM_SchreibDB ()
  894.   Dim fd As Integer
  895.   Dim pos%
  896.   fd = FreeFile
  897.   Open GCM_DBNAME For Random As fd Len = Len(GM_DB)
  898.   pos% = (LOF(fd) / Len(GM_DB)) + 1
  899.   Put #fd, pos%, GM_DB
  900.   FM_SchreibDB = pos%
  901.   Close fd
  902. End Function
  903.  
  904. Function FM_Verz$ (Verz$)
  905.   Dim tmp$
  906.   tmp$ = Trim$(Verz$)
  907.   If Right$(tmp$, 1) <> "\" Then
  908.     tmp$ = tmp$ + "\"
  909.   End If
  910.   FM_Verz$ = tmp$
  911. End Function
  912.  
  913. Sub ListSubDirs (path$, d() As TM_DBRec)
  914.   Const ATTR_DIRECTORY = 16
  915.   Dim position%, Count%, Vater%
  916.  
  917.   Dim I, dirname
  918.  
  919.   On Error Resume Next
  920.   If Right$(path$, 1) <> "\" Then path$ = path$ + "\"
  921.   If ExistDir(path$) Then
  922.     position% = 1
  923.     Count% = 1
  924.     dirname = Dir(path, ATTR_DIRECTORY) ' Erster Verzeichnisname
  925.  
  926.     'Alle Verzeichnisse innerhalb dieses Verzeichnisses in D() speichern
  927.     ReDim d(Count%)
  928.     d(Count%).Verzeichnis$ = path$
  929.     d(Count%).Vater = 0
  930.     PM_GetCDINFO d(Count%)
  931.     Count% = Count% + 1
  932.     Do
  933.       Do While dirname <> ""
  934.         DoEvents
  935.         If dirname <> "." And dirname <> ".." Then
  936.           If (GetAttr(path + dirname) And ATTR_DIRECTORY) = ATTR_DIRECTORY Then
  937.             ReDim Preserve d(Count%)
  938.             d(Count%).Verzeichnis = path + dirname
  939.             d(Count%).Vater = position%
  940.             PM_GetCDINFO d(Count%)
  941.             Count% = Count% + 1
  942.           End If
  943.         End If
  944.         dirname = Dir   ' Get another directory name.
  945.       Loop
  946.       position% = position% + 1
  947.       If position% >= Count% Then Exit Do
  948.       path$ = Trim$(d(position%).Verzeichnis$) + "\"
  949.       dirname = Dir(path, ATTR_DIRECTORY)
  950.     Loop
  951.   End If
  952. End Sub
  953.  
  954. Sub PM_ChangeCmdState (index%)
  955.   Static old%
  956.   Dim Res&
  957.   If Haupt!Cmd_Array(index%).Enabled Then
  958.     Res& = SendMessage(Haupt!Cmd_Array(index%).hWnd, &H403, -1, 0)
  959.   Else
  960.     Res& = SendMessage(Haupt!Cmd_Array(index%).hWnd, &H403, 0, 0)
  961.   End If
  962.   If old% = index% Then Exit Sub
  963.   Res& = SendMessage(Haupt!Cmd_Array(old%).hWnd, &H403, 0, 0)
  964.   old% = index%
  965. End Sub
  966.  
  967. Sub PM_ClearDB ()
  968.   Dim fd As Integer
  969.   fd = FreeFile
  970.   Kill GCM_DBNAME
  971. End Sub
  972.  
  973. Sub PM_EditFile (dn$)
  974.   Dim fd As Integer
  975.   Dim L_LengthOfFile%
  976.   Dim tmp$
  977.   fd = FreeFile
  978.   L_LengthOfFile% = FileLen(dn$)
  979.   tmp$ = Space$(L_LengthOfFile%)
  980.   Open dn$ For Binary As fd Len = L_LengthOfFile%
  981.   Get fd, 1, tmp$
  982.   G_EditFile$ = tmp$
  983.   Close fd
  984.   EditFile.Caption = dn$
  985.   EditFile.Show
  986. End Sub
  987.  
  988. Sub PM_GenerateDB (Pfad$)
  989.   Dim I%, Res%
  990.   If ExistDir(Pfad$) Then
  991.     PM_ClearDB
  992.     ListSubDirs Pfad$, GM_DBAll()
  993.     For I% = 1 To UBound(GM_DBAll)
  994.       GM_DB = GM_DBAll(I%)
  995.       Res% = FM_SchreibDB()
  996.     Next I%
  997.   End If
  998. End Sub
  999.  
  1000. Sub PM_GetCDINFO (d As TM_DBRec)
  1001.   Dim tmp$, fd%, Zeile$, pos%
  1002.   tmp$ = Trim$(d.Verzeichnis$)
  1003.   If Right$(tmp$, 1) <> "\" Then tmp$ = tmp$ + "\"
  1004.   tmp$ = Trim$(tmp$) + "CDINFO.TXT"
  1005.   fd = FreeFile
  1006.   On Error Resume Next
  1007.   Open tmp$ For Input As fd
  1008.   If Err <> 0 Then Exit Sub
  1009.   If Not EOF(fd) Then
  1010.     Line Input #fd, Zeile$
  1011.     pos% = InStr(UCase$(Zeile$), GCM_VERZEICHNIS)
  1012.     If pos% Then
  1013.       d.Bezeichnung$ = Mid$(Zeile$, pos% + Len(GCM_VERZEICHNIS))
  1014.     End If
  1015.     If Not EOF(fd) Then
  1016.       Line Input #fd, Zeile$
  1017.       pos% = InStr(UCase$(Zeile$), GCM_PROJEKT)
  1018.       If pos% Then
  1019.         d.Code = 1
  1020.       Else
  1021.         d.Code = 0
  1022.       End If
  1023.     End If
  1024.   End If
  1025.   Close fd
  1026. End Sub
  1027.  
  1028. Sub PM_GetChilds (ID&, d())
  1029.   Dim fd As Integer
  1030.   Dim I%
  1031.   fd = FreeFile
  1032.   Open GCM_DBNAME For Random As fd Len = Len(GM_DB)
  1033.   For I% = 1 To LOF(fd) / Len(GM_DB)
  1034.     Get #fd, I%, GM_DB
  1035.     If GM_DB.Vater = ID& Then
  1036.       d(UBound(d)) = I%
  1037.       ReDim Preserve d(UBound(d) + 1)
  1038.     End If
  1039.   Next I%
  1040.   Close fd
  1041. End Sub
  1042.  
  1043. Sub PM_GetFileInfo (dn$)
  1044.   Dim ds As Integer
  1045.   Dim pos%
  1046.   Dim Zeile$
  1047.   Dim Ub%
  1048.   ds = FreeFile
  1049.   Open dn$ For Input As ds
  1050.   Line Input #ds, Zeile$
  1051.   pos% = InStr(Zeile$, GCM_VERZEICHNIS)
  1052.   If pos% Then ' Verzeichnis
  1053.     On Error Resume Next
  1054.     Ub% = UBound(GM_Outline)
  1055.     On Error GoTo 0
  1056.     Ub% = Ub% + 1
  1057.     ReDim Preserve GM_Outline(Ub%)
  1058.     GM_Outline(Ub%).Bezeichnung = Mid$(Zeile$, pos% + Len(GCM_VERZEICHNIS))
  1059.   End If
  1060.   If Not EOF(ds) Then
  1061.     Line Input #ds, Zeile$
  1062.     pos% = InStr(Zeile$, GCM_PROJEKT)
  1063.     If pos% Then
  1064.       GM_Outline(Ub%).hat_unter_obj = False
  1065.     Else
  1066.       GM_Outline(Ub%).hat_unter_obj = True
  1067.     End If
  1068.   Else
  1069.     GM_Outline(Ub%).hat_unter_obj = True
  1070.   End If
  1071.   Close #ds
  1072. End Sub
  1073.  
  1074. Sub PM_GetParents (ID&, d())
  1075.   Dim fd As Integer
  1076.   Dim I%
  1077.   fd = FreeFile
  1078.   Open GCM_DBNAME For Random As fd Len = Len(GM_DB)
  1079.   For I% = 1 To LOF(fd) / Len(GM_DB)
  1080.     Get #fd, I%, GM_DB
  1081.     If GM_DB.Vater = ID& Then
  1082.       d(UBound(d)) = I%
  1083.       ReDim Preserve d(UBound(d) + 1)
  1084.     End If
  1085.   Next I%
  1086.   Close fd
  1087. End Sub
  1088.  
  1089. Sub PM_LeseEintrag (index As Long, ByVal ID As Long, Ebene%)
  1090.   Dim Vater&
  1091.   Dim LM_DB As TM_DBRec
  1092.   Dim tmpIndex&
  1093.   ReDim d(1)
  1094.   Dim cnt%, I%, Res%
  1095.   Res% = FM_LiesDB(ID&)
  1096.   LM_DB = GM_DB
  1097.   If ID > 0 Then
  1098.     PM_LeseEintrag index&, LM_DB.Vater&, Ebene%
  1099.     PM_GetParents ID&, d()
  1100.     For I% = 1 To UBound(d) - 1
  1101.       Res% = FM_LiesDB(CLng(d(I%)))
  1102.       If Res% <> 0 Then
  1103.         Haupt.Outline.AddItem GM_DB.Bezeichnung, index
  1104.         Haupt.Outline.ItemData(index) = Res%
  1105.         Haupt.Outline.Indent(index) = Ebene%
  1106.         If Not GM_DB.Code Then
  1107.           Haupt.Outline.PictureType(index&) = 0
  1108.         Else
  1109.           Haupt.Outline.PictureType(index&) = 2
  1110.         End If
  1111.         If Haupt.Outline.ItemData(index) = LM_DB.Vater& Then
  1112.           tmpIndex& = index&
  1113.           Haupt.Outline.Expand(index&) = True
  1114.         End If
  1115.         index& = index& + 1
  1116.       End If
  1117.     Next I%
  1118.      
  1119.     If tmpIndex& <> 0 Then index& = tmpIndex& + 1
  1120.   Else
  1121.     Res% = FM_LiesDB(1)
  1122.     Ebene% = 1
  1123.     If Res% <> 0 Then
  1124.       Haupt.Outline.AddItem GM_DB.Bezeichnung, index
  1125.       Haupt.Outline.ItemData(index) = Res%
  1126.       Haupt.Outline.Indent(index) = Ebene%
  1127.       If Not GM_DB.Code Then
  1128.         Haupt.Outline.PictureType(index&) = 0
  1129.       Else
  1130.         Haupt.Outline.PictureType(index&) = 2
  1131.       End If
  1132.       If Haupt.Outline.ItemData(index) = LM_DB.Vater& Then
  1133.         Haupt.Outline.Expand(index&) = True
  1134.         tmpIndex& = index&
  1135.       End If
  1136.       index& = index& + 1
  1137.     End If
  1138.   End If
  1139.   Ebene% = Ebene% + 1
  1140. End Sub
  1141.  
  1142. Sub PM_Lies (ID&)
  1143.   Dim index&
  1144.   Dim Ebene%
  1145.   index& = 0
  1146.   Haupt.Outline.Clear
  1147.   PM_LeseEintrag index&, ID&, Ebene%
  1148. End Sub
  1149.  
  1150. Sub PM_LiesCDInfo (Verzeichnis$)
  1151.   Dim fd As Integer
  1152.   Dim l&
  1153.   Dim L_CDInfoFilename$
  1154.   If Right$(Verzeichnis$, 1) <> "\" Then
  1155.     L_CDInfoFilename$ = Verzeichnis$ + "\" + GCM_INFOFILENAME
  1156.   Else
  1157.     L_CDInfoFilename$ = Verzeichnis$ + GCM_INFOFILENAME
  1158.   End If
  1159.   l& = FileLen(L_CDInfoFilename$)
  1160.   G_CDInfoFile$ = Space$(l&)
  1161.   fd = FreeFile
  1162.   Open L_CDInfoFilename$ For Binary As fd Len = l&
  1163.   Get #fd, , G_CDInfoFile$
  1164.   Close fd
  1165. End Sub
  1166.  
  1167. ' --------------------------------------------------------
  1168. ' Liest die ben÷tigten Control-Informationen aus dem
  1169. ' Initialisierungsfile
  1170. ' --------------------------------------------------------
  1171. ' Autor   : NM/ag
  1172. ' Datum   : 10.2.94
  1173. ' Version : 1.0
  1174. ' --------------------------------------------------------
  1175. Sub PM_LiesControl (Ctrl As Control)
  1176.   Dim L_Ini_Zeile$, Eigenschaft$
  1177.   L_Ini_Zeile$ = F_GetPrivatIni("Einstellungen", Ctrl.Tag)
  1178.   Eigenschaft$ = FM_ParseZeile$((L_Ini_Zeile$), GCM_SEPERATOR)
  1179.   If TypeOf Ctrl Is Label Then
  1180.     If Eigenschaft$ = "" Then Exit Sub
  1181.     Ctrl.FontName = Eigenschaft$
  1182.     Eigenschaft$ = FM_ParseZeile$("", "")
  1183.     If Eigenschaft$ = "" Then Exit Sub
  1184.     Ctrl.FontSize = Val(Eigenschaft$)
  1185.     Eigenschaft$ = FM_ParseZeile$("", "")
  1186.     If Eigenschaft$ = "" Then Exit Sub
  1187.     Ctrl.FontBold = Val(Eigenschaft$)
  1188.     Eigenschaft$ = FM_ParseZeile$("", "")
  1189.     If Eigenschaft$ = "" Then Exit Sub
  1190.     Ctrl.ForeColor = Val(Eigenschaft$)
  1191.     Eigenschaft$ = FM_ParseZeile$("", "")
  1192.     If Eigenschaft$ = "" Then Exit Sub
  1193.     Ctrl.BackColor = Val(Eigenschaft$)
  1194.   Else
  1195.     If Eigenschaft$ = "" Then Exit Sub
  1196.     Ctrl.FontName = Eigenschaft$
  1197.     Eigenschaft$ = FM_ParseZeile$("", "")
  1198.     If Eigenschaft$ = "" Then Exit Sub
  1199.     Ctrl.FontSize = Val(Eigenschaft$)
  1200.     Eigenschaft$ = FM_ParseZeile$("", "")
  1201.     If Eigenschaft$ = "" Then Exit Sub
  1202.     Ctrl.FontBold = Val(Eigenschaft$)
  1203.     Eigenschaft$ = FM_ParseZeile$("", "")
  1204.     If Eigenschaft$ = "" Then Exit Sub
  1205.     Ctrl.ForeColor = Val(Eigenschaft$)
  1206.     Eigenschaft$ = FM_ParseZeile$("", "")
  1207.     If Eigenschaft$ = "" Then Exit Sub
  1208.     Ctrl.BackColor = Val(Eigenschaft$)
  1209.   End If
  1210. End Sub
  1211.  
  1212. ' --------------------------------------------------------
  1213. ' Liest die ben÷tigten Formular-Informationen aus dem
  1214. ' Initialisierungsfile
  1215. ' --------------------------------------------------------
  1216. ' Autor   : NM/ag
  1217. ' Datum   : 10.2.94
  1218. ' Version : 1.0
  1219. ' --------------------------------------------------------
  1220. Sub PM_LiesForm (Frm As Form)
  1221.   Dim L_Ini_Zeile$, Eigenschaft$
  1222.   L_Ini_Zeile$ = F_GetPrivatIni("Einstellungen", Frm.Tag)
  1223.   Eigenschaft$ = FM_ParseZeile$((L_Ini_Zeile$), GCM_SEPERATOR)
  1224.   If Eigenschaft$ = "" Then Exit Sub
  1225.   Frm.Top = Val(Eigenschaft$)
  1226.   Eigenschaft$ = FM_ParseZeile$("", "")
  1227.   If Eigenschaft$ = "" Then Exit Sub
  1228.   Frm.Left = Val(Eigenschaft$)
  1229.   Eigenschaft$ = FM_ParseZeile$("", "")
  1230.   If Eigenschaft$ = "" Then Exit Sub
  1231.   Frm.Width = Val(Eigenschaft$)
  1232.   Eigenschaft$ = FM_ParseZeile$("", "")
  1233.   If Eigenschaft$ = "" Then Exit Sub
  1234.   Frm.Height = Val(Eigenschaft$)
  1235.   Eigenschaft$ = FM_ParseZeile$("", "")
  1236.   If Eigenschaft$ = "" Then Exit Sub
  1237.   Frm.WindowState = Val(Eigenschaft$)
  1238. End Sub
  1239.  
  1240. Sub PM_LiesOutline (pos%)
  1241.   Dim fd As Integer
  1242.   fd = FreeFile
  1243.   Open GCM_DBNAME For Random As fd Len = Len(GM_DB)
  1244.   Get fd, pos%, GM_DB
  1245.   Haupt.Outline.AddItem GM_DB.Bezeichnung
  1246.   Haupt.Outline.ItemData(0) = pos%
  1247.   Haupt.Outline.Indent(1) = 2
  1248.   Close fd
  1249.   Haupt.Outline.Refresh
  1250. End Sub
  1251.  
  1252. Sub PM_ReadCDInfo ()
  1253.   Dim Res&
  1254.   Dim pos%
  1255.   Dim L_CDInfoCommands$
  1256.   Dim tmp$
  1257.   Dim MakDatei$, HilfeDatei$
  1258.   Res& = FM_LiesDB(Val(Haupt!Outline.ItemData(Haupt!Outline.ListIndex)))
  1259.   PM_LiesCDInfo Trim$(GM_DB.Verzeichnis$)
  1260.   pos% = InStr(UCase$(G_CDInfoFile$), GCM_INFO)
  1261.   If pos% <> 0 Then
  1262.     Haupt!Lbl_Info.Caption = Mid$(G_CDInfoFile$, pos% + Len(GCM_INFO))
  1263.     Haupt!Lbl_Info.Visible = True
  1264.     Haupt!Cmd_Array(GCM_CMD_INFO).Enabled = True
  1265.     Haupt!Cmd_Array(GCM_CMD_INFO) = True
  1266.     L_CDInfoCommands$ = UCase$(Left$(G_CDInfoFile$, pos% - 1))
  1267.   Else
  1268.     Haupt!Cmd_Array(GCM_CMD_INFO).Enabled = False
  1269.     Haupt!Lbl_Info.Visible = False
  1270.     Haupt!Lbl_Info.Caption = ""
  1271.     Haupt!Cmd_Array(6) = True
  1272.     L_CDInfoCommands$ = UCase$(G_CDInfoFile$)
  1273.   End If
  1274.   pos% = InStr(L_CDInfoCommands$, GCM_DEMO)
  1275.   If pos% <> 0 Then
  1276.     Haupt!Cmd_Array(GCM_CMD_DEMO).Enabled = True
  1277.     tmp$ = Mid$(L_CDInfoCommands$ + Chr$(13), pos% + Len(GCM_DEMO))
  1278.     Haupt!Cmd_Array(GCM_CMD_DEMO).Tag = Left$(tmp$, InStr(tmp$, Chr$(13)) - 1)
  1279.   Else
  1280.     Haupt!Cmd_Array(GCM_CMD_DEMO).Enabled = False
  1281.   End If
  1282.   pos% = InStr(L_CDInfoCommands$, GCM_PROJEKT)
  1283.   If pos% <> 0 Then
  1284.     Haupt!Cmd_Array(GCM_CMD_COPY).Enabled = True
  1285.   Else
  1286.     Haupt!Cmd_Array(GCM_CMD_COPY).Enabled = False
  1287.   End If
  1288.   tmp$ = FM_Verz$(GM_DB.Verzeichnis$) + "*.MAK"
  1289.   MakDatei$ = Dir$(tmp$)
  1290.   If MakDatei$ <> "" Then
  1291.     Haupt!Cmd_Array(GCM_CMD_CODE).Enabled = True
  1292.     Haupt!Cmd_Array(GCM_CMD_CODE).Tag = FM_Verz$(GM_DB.Verzeichnis$)
  1293.   Else
  1294.     Haupt!Cmd_Array(GCM_CMD_CODE).Enabled = False
  1295.   End If
  1296.   pos% = InStr(L_CDInfoCommands$, GCM_INSTALL)
  1297.   If pos% <> 0 Then
  1298.     Haupt!Cmd_Array(GCM_CMD_INSTALL).Enabled = True
  1299.     tmp$ = Mid$(L_CDInfoCommands$ + Chr$(13), pos% + Len(GCM_INSTALL))
  1300.     Haupt!Cmd_Array(GCM_CMD_INSTALL).Tag = Left$(tmp$, InStr(tmp$, Chr$(13)) - 1)
  1301.   Else
  1302.     Haupt!Cmd_Array(GCM_CMD_INSTALL).Enabled = False
  1303.   End If
  1304.   tmp$ = FM_Verz$(GM_DB.Verzeichnis$) + "*.HLP"
  1305.   HilfeDatei$ = Dir$(tmp$)
  1306.   If HilfeDatei$ <> "" Then
  1307.     Haupt!Cmd_Array(GCM_CMD_HILFE).Enabled = True
  1308.     Haupt!Cmd_Array(GCM_CMD_HILFE).Tag = "WinHelp " & FM_Verz$(GM_DB.Verzeichnis$) & HilfeDatei$
  1309.   Else
  1310.     Haupt!Cmd_Array(GCM_CMD_HILFE).Enabled = False
  1311.   End If
  1312.   PM_ChangeCmdState (0)
  1313. End Sub
  1314.  
  1315. Sub PM_ReadItems (ByVal Vater&, ByVal ListIndex%, ByVal Ebene%)
  1316.   ReDim d(1)
  1317.   Dim cnt%, I%, Res%
  1318.   PM_GetParents Vater&, d()
  1319.   For I% = 1 To UBound(d) - 1
  1320.     Res% = FM_LiesDB(CLng(d(I%)))
  1321.     If Res% <> 0 Then
  1322.       ListIndex% = ListIndex% + 1
  1323.       If ListIndex% < Haupt.Outline.ListCount Then
  1324.         If Haupt.Outline.List(ListIndex%) = "Hilfs" Then
  1325.           Haupt.Outline.List(ListIndex%) = GM_DB.Bezeichnung$
  1326.         Else
  1327.           Haupt.Outline.AddItem GM_DB.Bezeichnung, ListIndex%
  1328.         End If
  1329.       Else
  1330.         Haupt.Outline.AddItem GM_DB.Bezeichnung, ListIndex%
  1331.       End If
  1332.       Haupt.Outline.ItemData(ListIndex%) = Res%
  1333.       Haupt.Outline.Indent(ListIndex%) = Ebene%
  1334.       If GM_DB.Code = 0 Then
  1335.         Haupt.Outline.PictureType(ListIndex%) = 0
  1336.         ListIndex% = ListIndex% + 1
  1337.         Haupt.Outline.AddItem "Hilfs", ListIndex%
  1338.         Haupt.Outline.Indent(ListIndex%) = Ebene% + 1
  1339.       Else
  1340.         Haupt.Outline.PictureType(ListIndex%) = 2
  1341.       End If
  1342.     End If
  1343.   Next I%
  1344. End Sub
  1345.  
  1346. Sub PM_RefreshAnzeige ()
  1347.   Haupt!Lbl_Info.Move 4, 2
  1348.   Haupt!Lbl_Info.Height = Haupt!Pic_Anzeige.Height - 4
  1349.   Haupt!Lbl_Info.Width = FM_Max(Haupt!Pic_Anzeige.Width - 6, 0)
  1350.   Haupt!File1.Move 4, 2
  1351.   Haupt!File1.Width = Haupt!Lbl_Info.Width
  1352.   Haupt!File1.Height = Haupt!Lbl_Info.Height
  1353.   If Haupt!Lbl_Info.Visible Then
  1354.     Haupt!Pic_Anzeige.BackColor = Haupt!Lbl_Info.BackColor
  1355.   Else
  1356.     Haupt!Pic_Anzeige.BackColor = Haupt!File1.BackColor
  1357.   End If
  1358. End Sub
  1359.  
  1360. Sub PM_ScanDirs (Pfad$, Vater&)
  1361.   Dim tmp$, Vater_Neu&, totPfad$
  1362.   GM_DB.Bezeichnung$ = "Test"
  1363.   GM_DB.Vater& = Vater&
  1364.   GM_DB.Verzeichnis$ = Pfad$
  1365.   Debug.Print Pfad$
  1366.   Vater_Neu& = FM_SchreibDB()
  1367.   If Right$(Pfad$, 1) <> "\" Then
  1368.     totPfad$ = Pfad$ + "\"
  1369.   Else
  1370.     totPfad$ = Pfad$ + ""
  1371.   End If
  1372.   tmp$ = Dir$(totPfad$ + "*.*", 16)
  1373.   Do While Left$(tmp$, 1) = "."
  1374.     tmp$ = Dir$
  1375.   Loop
  1376.   Do While tmp$ <> ""
  1377.     If GetAttr(totPfad$ + tmp$) = 16 Then ' Verzeichnis
  1378.       PM_ScanDirs totPfad$ + tmp$, Vater_Neu&
  1379.     End If
  1380.     tmp$ = Dir$
  1381.   Loop
  1382. End Sub
  1383.  
  1384. ' --------------------------------------------------------
  1385. ' Speichert die ben÷tigten Control-Informationen im
  1386. ' Initialisierungsfile ab
  1387. ' --------------------------------------------------------
  1388. ' Autor   : NM/ag
  1389. ' Datum   : 10.2.94
  1390. ' Version : 1.0
  1391. ' --------------------------------------------------------
  1392. Sub PM_SchreibControl (Ctrl As Control)
  1393.   Dim L_Ini_Zeile$
  1394.   If TypeOf Ctrl Is Label Then
  1395.     L_Ini_Zeile$ = Ctrl.FontName & GCM_SEPERATOR
  1396.     L_Ini_Zeile$ = L_Ini_Zeile$ & Trim$(Str$(Ctrl.FontSize)) & GCM_SEPERATOR
  1397.     L_Ini_Zeile$ = L_Ini_Zeile$ & Ctrl.FontBold & GCM_SEPERATOR
  1398.     L_Ini_Zeile$ = L_Ini_Zeile$ & Ctrl.ForeColor & GCM_SEPERATOR
  1399.     L_Ini_Zeile$ = L_Ini_Zeile$ & Ctrl.BackColor
  1400.   Else
  1401.     L_Ini_Zeile$ = Ctrl.FontName & GCM_SEPERATOR
  1402.     L_Ini_Zeile$ = L_Ini_Zeile$ & Trim$(Str$(Ctrl.FontSize)) & GCM_SEPERATOR
  1403.     L_Ini_Zeile$ = L_Ini_Zeile$ & Ctrl.FontBold & GCM_SEPERATOR
  1404.     L_Ini_Zeile$ = L_Ini_Zeile$ & Ctrl.ForeColor & GCM_SEPERATOR
  1405.     L_Ini_Zeile$ = L_Ini_Zeile$ & Ctrl.BackColor
  1406.   End If
  1407.   P_WritePrivatInit GCM_EINSTELLUNGEN, (Ctrl.Tag), L_Ini_Zeile$
  1408. End Sub
  1409.  
  1410. ' --------------------------------------------------------
  1411. ' Speichert die ben÷tigten Formular-Informationen im
  1412. ' Initialisierungsfile ab
  1413. ' --------------------------------------------------------
  1414. ' Autor   : NM/ag
  1415. ' Datum   : 10.2.94
  1416. ' Version : 1.0
  1417. ' --------------------------------------------------------
  1418. Sub PM_SchreibForm (Frm As Form)
  1419.   Dim L_Ini_Zeile$, L_tmp_State%
  1420.   L_tmp_State% = Frm.WindowState
  1421.   Frm.WindowState = 0
  1422.   L_Ini_Zeile$ = Frm.Top & GCM_SEPERATOR
  1423.   L_Ini_Zeile$ = L_Ini_Zeile$ & Frm.Left & GCM_SEPERATOR
  1424.   L_Ini_Zeile$ = L_Ini_Zeile$ & Frm.Width & GCM_SEPERATOR
  1425.   L_Ini_Zeile$ = L_Ini_Zeile$ & Frm.Height & GCM_SEPERATOR
  1426.   L_Ini_Zeile$ = L_Ini_Zeile$ & L_tmp_State%
  1427.   P_WritePrivatInit GCM_EINSTELLUNGEN, (Frm.Tag), L_Ini_Zeile$
  1428. End Sub
  1429.  
  1430. Sub PM_SeekList (Cntrl As Control, Eintrag$)
  1431.   Dim I%
  1432.   For I% = 0 To Cntrl.ListCount - 1
  1433.     If Cntrl.List(I%) = Eintrag Then
  1434.       Cntrl.ListIndex = I%
  1435.       Exit For
  1436.     End If
  1437.   Next I%
  1438. End Sub
  1439.  
  1440. Sub PM_ShellAndWait (CommandString$)
  1441.   Dim ID%
  1442.   Dim X%
  1443.   ID% = Shell(CommandString$, 1)
  1444.   Do
  1445.     DoEvents
  1446.     Debug.Print Timer
  1447.   Loop Until GetModuleUsage(ID%) = 0
  1448. End Sub
  1449.  
  1450. Sub PM_Show3D (Frm As Form)
  1451. ' Colors
  1452.  
  1453. Const BLACK = &H0&
  1454. Const WHITE = &HFFFFFF
  1455. Const GRAY = &HC0C0C0
  1456. Const DGRAY = &H808080
  1457.  
  1458. Dim ct As Control
  1459. Dim I As Integer
  1460. Dim Tx As Integer
  1461. Dim Ty As Integer
  1462.  
  1463. Tx = 1
  1464. Ty = 1
  1465. Frm.AutoRedraw = True
  1466.  
  1467. ' Zeichne Formular
  1468. Frm.BackColor = &HC0C0C0
  1469. If Frm.BorderStyle = 0 Or Frm.BorderStyle = 1 Or Frm.BorderStyle = 3 Then
  1470.     Frm.DrawWidth = 2
  1471.     Frm.Line (0, 0)-(Frm.ScaleWidth, Frm.ScaleHeight), DGRAY, B
  1472.     Frm.DrawWidth = 1
  1473.     Frm.Line (0, 0)-(Frm.ScaleWidth, Frm.ScaleHeight), WHITE, B
  1474. End If
  1475.  
  1476. For I = 0 To Frm.Controls.Count - 1
  1477.     Set ct = Frm.Controls(I)
  1478.     If TypeOf ct Is Shape Then
  1479.         ct.Visible = False
  1480.         Frm.DrawWidth = 2
  1481.         Frm.Line (ct.Left - (0 * Tx), ct.Top - (0 * Ty))-(ct.Width + (1 * Tx) + ct.Left, ct.Top + ct.Height + (0 * Ty)), DGRAY, B
  1482.         Frm.DrawWidth = 1
  1483.         Frm.Line (ct.Left - (1 * Tx), ct.Top - (1 * Ty))-(ct.Width + (0 * Tx) + ct.Left, ct.Top + ct.Height - (1 * Ty)), WHITE, B
  1484.     End If
  1485.     If TypeOf ct Is Label Then
  1486.  
  1487.         Frm.FontSize = ct.FontSize
  1488.         Frm.FontName = ct.FontName
  1489.         Frm.FontBold = ct.FontBold
  1490.         ct.Visible = False
  1491.         Frm.CurrentX = ct.Left + Tx
  1492.         Frm.CurrentY = ct.Top + Ty
  1493.         Frm.ForeColor = WHITE
  1494.         Frm.Print ct.Caption
  1495.         Frm.CurrentX = ct.Left
  1496.         Frm.CurrentY = ct.Top
  1497.         Frm.ForeColor = BLACK
  1498.         Frm.Print ct.Caption
  1499.         ct.Visible = True
  1500.     End If
  1501.     If TypeOf ct Is TextBox Then
  1502.         Frm.Line (ct.Left + (1 * Tx), ct.Top + (1 * Ty))-(ct.Width + (0 * Tx) + ct.Left, ct.Top + ct.Height + (0 * Ty)), WHITE, B
  1503.         Frm.Line (ct.Left - (1 * Tx), ct.Top - (1 * Ty))-(ct.Width + (1 * Tx) + ct.Left, ct.Top + ct.Height + (1 * Ty)), DGRAY, B
  1504.         Frm.Line (ct.Left - (2 * Tx), ct.Top - (2 * Ty))-(ct.Width + ct.Left + (1 * Tx), ct.Top + ct.Height + (1 * Ty)), GRAY, B
  1505.     End If
  1506.     If TypeOf ct Is ListBox Then
  1507.         Frm.Line (ct.Left + (1 * Tx), ct.Top + (1 * Ty))-(ct.Width + (0 * Tx) + ct.Left, ct.Top + ct.Height + (0 * Ty)), DGRAY, B
  1508.         Frm.Line (ct.Left - (1 * Tx), ct.Top - (1 * Ty))-(ct.Width + (1 * Tx) + ct.Left, ct.Top + ct.Height + (1 * Ty)), WHITE, B
  1509.         Frm.Line (ct.Left - (2 * Tx), ct.Top - (2 * Ty))-(ct.Width + ct.Left + (1 * Tx), ct.Top + ct.Height + (1 * Ty)), GRAY, B
  1510.     End If
  1511.     If TypeOf ct Is ComboBox Then
  1512.         Frm.Line (ct.Left + (1 * Tx), ct.Top + (1 * Ty))-(ct.Width + (0 * Tx) + ct.Left, ct.Top + ct.Height + (0 * Ty)), DGRAY, B
  1513.         Frm.Line (ct.Left - (1 * Tx), ct.Top - (1 * Ty))-(ct.Width + (1 * Tx) + ct.Left, ct.Top + ct.Height + (1 * Ty)), WHITE, B
  1514.         Frm.Line (ct.Left - (2 * Tx), ct.Top - (2 * Ty))-(ct.Width + ct.Left + (1 * Tx), ct.Top + ct.Height + (1 * Ty)), GRAY, B
  1515.     End If
  1516.     If TypeOf ct Is Line Then
  1517.         ct.Visible = False
  1518.         Frm.Line (ct.X1 + (1 * Tx), ct.Y1 + (1 * Ty))-(ct.X2 + (1 * Tx), ct.Y2 + (1 * Ty)), DGRAY
  1519.         Frm.Line (ct.X1 + (0 * Tx), ct.Y1 + (0 * Ty))-(ct.X2 + (0 * Tx), ct.Y2 + (0 * Ty)), WHITE
  1520.     End If
  1521.  
  1522. Next I
  1523. Frm.AutoRedraw = False
  1524.  
  1525. End Sub
  1526.  
  1527.