home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / code / cdspy / f_outlin.frm < prev    next >
Text File  |  1995-02-26  |  6KB  |  216 lines

  1. VERSION 2.00
  2. Begin Form F_Outline 
  3.    Caption         =   "Inhalt"
  4.    ClientHeight    =   5355
  5.    ClientLeft      =   1335
  6.    ClientTop       =   1770
  7.    ClientWidth     =   3570
  8.    Height          =   5760
  9.    Left            =   1275
  10.    LinkTopic       =   "Form2"
  11.    MDIChild        =   -1  'True
  12.    ScaleHeight     =   5355
  13.    ScaleWidth      =   3570
  14.    Tag             =   "Inhalt"
  15.    Top             =   1425
  16.    Width           =   3690
  17.    Begin Outline Outline 
  18.       Height          =   3525
  19.       Left            =   120
  20.       PictureClosed   =   F_OUTLIN.FRX:0000
  21.       PictureLeaf     =   F_OUTLIN.FRX:00E2
  22.       PictureMinus    =   F_OUTLIN.FRX:01C4
  23.       PictureOpen     =   F_OUTLIN.FRX:02A6
  24.       PicturePlus     =   F_OUTLIN.FRX:0388
  25.       TabIndex        =   0
  26.       Tag             =   "Outline"
  27.       Top             =   90
  28.       Width           =   3075
  29.    End
  30.    Begin Label LblStatusbar 
  31.       AutoSize        =   -1  'True
  32.       FontBold        =   0   'False
  33.       FontItalic      =   0   'False
  34.       FontName        =   "MS Sans Serif"
  35.       FontSize        =   8.25
  36.       FontStrikethru  =   0   'False
  37.       FontUnderline   =   0   'False
  38.       Height          =   195
  39.       Left            =   120
  40.       TabIndex        =   1
  41.       Top             =   3840
  42.       Width           =   45
  43.    End
  44.    Begin Shape ShpStatusbar 
  45.       Height          =   255
  46.       Left            =   120
  47.       Top             =   3840
  48.       Width           =   3255
  49.    End
  50. End
  51. Option Explicit
  52. Option Compare Text
  53. Dim GL_ListIndex%
  54. Dim GL_AktElement As TM_AktElement
  55.  
  56. Sub Form_Activate ()
  57.   GM_AktElement = GL_AktElement
  58.   PM_RefreshForms
  59. End Sub
  60.  
  61. Sub Form_Load ()
  62.   PM_LiesForm Me
  63.   Rem Show3d Me
  64.   PM_ReadItems Me.Outline, 0, -1, 1
  65.   If Outline.ListCount > 0 Then Outline.Expand(0) = True
  66.   Outline_Click
  67. End Sub
  68.  
  69. Sub Form_QueryUnload (Cancel As Integer, UnloadMode As Integer)
  70.   If UnloadMode = 0 Then
  71.     Cancel = True
  72.     Exit Sub
  73.   Else
  74.     PM_SchreibForm Me
  75.   End If
  76. End Sub
  77.  
  78. Sub Form_Resize ()
  79. FreezeOn mdicdSpy.hWnd
  80.   If F_CheckFormSize(Me, 3000, 4000) = True Then
  81.     P_ResizeObjectToForm Me, Outline, 100
  82.     Outline.Top = 300
  83.     Outline.Height = FM_Max(Me.ScaleHeight - 600, 200)
  84.     ShpStatusbar.Move 100, Me.ScaleHeight - 250, Me.ScaleWidth - 200, 200
  85.     LblStatusbar.Move 200, Me.ScaleHeight - 250
  86.     
  87.     ' Zeichnen
  88.     Me.AutoRedraw = True
  89.     Me.Cls
  90.     Show3d Me
  91.     Me.DrawWidth = 2
  92.     Me.Line (0, 0)-(Me.ScaleWidth, Me.ScaleHeight), QBColor(7), B
  93.     Me.DrawWidth = 1
  94.     Me.Line (0, 0)-(Me.ScaleWidth, Me.ScaleHeight), QBColor(15), B
  95.  
  96.     P_Show3dTwips Me, Outline, 1
  97.   End If
  98.  
  99. FreezeOn 0
  100. End Sub
  101.  
  102. Sub Outline_Click ()
  103.   Dim Res&
  104.   Dim pos%
  105.   If Outline.ListIndex < 0 Then Exit Sub
  106.   Me.MousePointer = 11
  107.   PM_ReadCDInfo Me.Outline, GL_AktElement
  108.   GM_AktElement = GL_AktElement
  109.   Me.LblStatusbar = GM_DB.Verzeichnis$
  110.   Show3d Me
  111.   PM_RefreshForms
  112.   GL_ListIndex% = Outline.ListIndex
  113.   Me.MousePointer = 0
  114. End Sub
  115.  
  116. Sub Outline_Collapse (ListIndex As Integer)
  117.   Dim i%
  118.   On Error Resume Next
  119.   Me.MousePointer = 11' Sanduhr
  120.   Do
  121.     i% = Outline.Indent(ListIndex% + 1)
  122.     If Err <> 0 Or Outline.Indent(ListIndex) >= i% Then
  123.       Outline.AddItem "Hilfs", ListIndex% + 1
  124.       Exit Do
  125.     Else
  126.       Outline.RemoveItem ListIndex% + 1
  127.     End If
  128.   Loop
  129.   Outline.List(ListIndex% + 1) = "Hilfs"
  130.   Outline.Indent(ListIndex% + 1) = Outline.Indent(ListIndex%) + 1
  131.   Outline.ListIndex = GL_ListIndex%
  132.   Me.MousePointer = 0' Default
  133. End Sub
  134.  
  135. Sub Outline_DblClick ()
  136.   If Me.Outline.PictureType(Me.Outline.ListIndex) = 2 Then
  137.     Set G_Control = Outline
  138.     PopupMenu mdicdSpy!MnuSetup
  139.     Exit Sub
  140.   End If
  141.   If Me.Outline.Expand(Me.Outline.ListIndex) Then
  142.     Outline_Collapse (Me.Outline.ListIndex)
  143.   Else
  144.     Outline_Expand (Me.Outline.ListIndex)
  145.   End If
  146. End Sub
  147.  
  148. Sub Outline_Expand (ListIndex As Integer)
  149.   On Error GoTo Err_Outline_Expand
  150.   Static working%
  151.   Dim tmp%
  152.   Dim i%
  153.   Dim Indent%
  154.   Dim ID&
  155.   If working% Or Not Me.Outline.HasSubItems(ListIndex%) Then
  156.     'Me.Outline.Refresh
  157.     Exit Sub
  158.   End If
  159.   On Error Resume Next
  160.   working% = True
  161.   Me.MousePointer = 11 'Sanduhr
  162.   Indent% = Me.Outline.Indent(ListIndex%)
  163.   ID& = Me.Outline.ItemData(ListIndex%)
  164.   For i% = 0 To Me.Outline.ListCount - 1
  165.     If Me.Outline.ItemData(i%) = ID& Then
  166.       ListIndex% = i%
  167.       Exit For
  168.     End If
  169.   Next i%
  170.   tmp% = ListIndex
  171.   PM_ReadItems Me.Outline, Me.Outline.ItemData(ListIndex%), ListIndex%, Me.Outline.Indent(ListIndex%) + 1
  172.   Me.Outline.Expand(tmp%) = True
  173.   Me.Outline.ListIndex = tmp%
  174.   working% = False
  175.   Me.MousePointer = 0 ' default
  176.   Exit Sub
  177. Err_Outline_Expand:
  178.   working% = False
  179.   Me.MousePointer = 0' default
  180.   MsgBox "Der Speicher ist voll! Bitte schliessen Sie mindestens eine Gliederungsebene bevor Sie weitere Ebenen ÷ffnen.", 48, "Fehler"
  181.   Exit Sub
  182. End Sub
  183.  
  184. Sub Outline_KeyUp (KeyCode As Integer, Shift As Integer)
  185.   If Outline.ListIndex <> GL_ListIndex% Then
  186.     Outline_Click
  187.   End If
  188. End Sub
  189.  
  190. Sub Outline_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  191.   If Button And 2 Then
  192.     Set G_Control = Outline
  193.     PopupMenu mdicdSpy!MnuSetup
  194.   End If
  195. End Sub
  196.  
  197. Sub Outline_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  198.   If Outline.ListIndex <> GL_ListIndex% Then
  199.     Outline_Click
  200.   End If
  201. End Sub
  202.  
  203. Sub Outline_PictureClick (ListIndex As Integer)
  204.   Outline.ListIndex = ListIndex
  205.   Outline_Click
  206. End Sub
  207.  
  208. Sub Outline_PictureDblClick (ListIndex As Integer)
  209.   If Me.Outline.Expand(Me.Outline.ListIndex) Then
  210.     Outline_Collapse (Me.Outline.ListIndex)
  211.   Else
  212.     Outline_Expand (Me.Outline.ListIndex)
  213.   End If
  214. End Sub
  215.  
  216.