home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Magazine 1999 April / CD_Shareware_Magazine_31.iso / Free / Prg / csplitdc.exe / fSplit.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-07-29  |  5.8 KB  |  174 lines

  1. VERSION 5.00
  2. Begin VB.Form frmSplittable 
  3.    Caption         =   "Splittable Child Window"
  4.    ClientHeight    =   5490
  5.    ClientLeft      =   4065
  6.    ClientTop       =   2175
  7.    ClientWidth     =   9060
  8.    Icon            =   "fSplit.frx":0000
  9.    LinkTopic       =   "Form1"
  10.    MDIChild        =   -1  'True
  11.    ScaleHeight     =   5490
  12.    ScaleWidth      =   9060
  13.    Begin VB.ListBox lstFiles 
  14.       Height          =   1260
  15.       IntegralHeight  =   0   'False
  16.       Left            =   60
  17.       TabIndex        =   4
  18.       Top             =   3900
  19.       Width           =   8895
  20.    End
  21.    Begin VB.TextBox Text2 
  22.       BeginProperty Font 
  23.          Name            =   "Lucida Console"
  24.          Size            =   8.25
  25.          Charset         =   0
  26.          Weight          =   400
  27.          Underline       =   0   'False
  28.          Italic          =   0   'False
  29.          Strikethrough   =   0   'False
  30.       EndProperty
  31.       Height          =   3675
  32.       Left            =   2400
  33.       MultiLine       =   -1  'True
  34.       ScrollBars      =   2  'Vertical
  35.       TabIndex        =   1
  36.       Text            =   "fSplit.frx":014A
  37.       Top             =   120
  38.       Width           =   6555
  39.    End
  40.    Begin VB.TextBox Text1 
  41.       BeginProperty Font 
  42.          Name            =   "Lucida Console"
  43.          Size            =   8.25
  44.          Charset         =   0
  45.          Weight          =   400
  46.          Underline       =   0   'False
  47.          Italic          =   0   'False
  48.          Strikethrough   =   0   'False
  49.       EndProperty
  50.       Height          =   3675
  51.       Left            =   60
  52.       MultiLine       =   -1  'True
  53.       ScrollBars      =   2  'Vertical
  54.       TabIndex        =   0
  55.       Text            =   "fSplit.frx":0150
  56.       Top             =   120
  57.       Width           =   2235
  58.    End
  59.    Begin VB.PictureBox picSplit 
  60.       Height          =   4155
  61.       Left            =   2220
  62.       MousePointer    =   9  'Size W E
  63.       ScaleHeight     =   4095
  64.       ScaleWidth      =   195
  65.       TabIndex        =   2
  66.       Top             =   0
  67.       Width           =   255
  68.    End
  69.    Begin VB.PictureBox picVSplit 
  70.       Height          =   255
  71.       Left            =   0
  72.       ScaleHeight     =   195
  73.       ScaleWidth      =   9015
  74.       TabIndex        =   3
  75.       Top             =   3720
  76.       Width           =   9075
  77.    End
  78. Attribute VB_Name = "frmSplittable"
  79. Attribute VB_GlobalNameSpace = False
  80. Attribute VB_Creatable = False
  81. Attribute VB_PredeclaredId = True
  82. Attribute VB_Exposed = False
  83. Option Explicit
  84. Dim cHS As New cSplitDDC
  85. Dim cVS As New cSplitDDC
  86. Private Function GetFileText(ByVal sFile As String, ByRef sText As String) As Boolean
  87. Dim iFIle As Integer, lLen As Long
  88.     iFIle = FreeFile
  89.     On Error Resume Next
  90.     Open sFile For Binary Access Read As #iFIle
  91.     If (Err.Number = 0) Then
  92.         lLen = LOF(iFIle)
  93.         sText = String$(lLen, 0)
  94.         Get #iFIle, , sText
  95.         If (Err.Number = 0) Then
  96.             GetFileText = True
  97.         End If
  98.         Close #iFIle
  99.     End If
  100. End Function
  101. Private Sub Form_Load()
  102.     With cHS
  103.         .Orientation = espVertical
  104.         .Border(espbLeft) = 32
  105.         .Border(espbRight) = 32
  106.         .SplitObject = picSplit
  107.     End With
  108.     With cVS
  109.         .Orientation = espHorizontal
  110.         .Border(espbBottom) = 32
  111.         .Border(espbTop) = 64
  112.         .Border(espbLeft) = 2
  113.         .Border(espbRight) = 2
  114.         .SplitObject = picVSplit
  115.     End With
  116.     Dim sText As String, sFile As String
  117.     sFile = App.Path & "\mfrmMain.frm"
  118.     If (GetFileText(sFile, sText)) Then
  119.         Text1.Text = sText
  120.     Else
  121.         Text1.Text = "Source code to file '" & sFile & "' could not be found."
  122.     End If
  123.     sFile = App.Path & "\cSplitDC.cls"
  124.     If (GetFileText(sFile, sText)) Then
  125.         Text2.Text = sText
  126.     Else
  127.         Text2.Text = "Source code to file '" & sFile & "' could not be found."
  128.     End If
  129.     sFile = Dir(App.Path & "\*.*")
  130.     Do While Len(sFile) > 0
  131.         lstFiles.AddItem sFile
  132.         sFile = Dir
  133.     Loop
  134.     If (Me.ScaleHeight \ 4 * 3 >= cVS.Border(espbTop) * Screen.TwipsPerPixelY) Then
  135.         picVSplit.Top = Me.ScaleHeight \ 4 * 3
  136.     Else
  137.         picVSplit.Top = cVS.Border(espbTop) * Screen.TwipsPerPixelY
  138.     End If
  139. End Sub
  140. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  141.     cHS.SplitterFormMouseMove X, Y
  142.     cVS.SplitterFormMouseMove X, Y
  143. End Sub
  144. Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  145.     If (cHS.SplitterFormMouseUp(X, Y)) Then
  146.         Form_Resize
  147.     ElseIf (cVS.SplitterFormMouseUp(X, Y)) Then
  148.         Form_Resize
  149.     End If
  150. End Sub
  151. Private Sub Form_Resize()
  152. Dim lH As Long
  153.     lH = picVSplit.Top + 2 * Screen.TwipsPerPixelY
  154.     With Text1
  155.         .Move .Left, .Top, _
  156.             picSplit.Left - .Left - 4 * Screen.TwipsPerPixelX, _
  157.             lH
  158.     End With
  159.     Text2.Move picSplit.Left + 2 * Screen.TwipsPerPixelX, Text1.Top, _
  160.         (Me.ScaleWidth - picSplit.Left - 4 * Screen.TwipsPerPixelX - Text1.Left), _
  161.         lH
  162.     With lstFiles
  163.         .Move .Left, picVSplit.Top + picVSplit.Height - 2 * Screen.TwipsPerPixelY, _
  164.             Me.ScaleWidth - .Left * 2, Me.ScaleHeight - (picVSplit.Top + picVSplit.Height - 2 * Screen.TwipsPerPixelY) - 2 * Screen.TwipsPerPixelY
  165.     End With
  166.     cHS.Border(espbBottom) = (Me.ScaleHeight - lstFiles.Top) \ Screen.TwipsPerPixelY
  167. End Sub
  168. Private Sub picSplit_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  169.     cHS.SplitterMouseDown Me.hWnd, X, Y
  170. End Sub
  171. Private Sub picVSplit_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  172.     cVS.SplitterMouseDown Me.hWnd, X, Y
  173. End Sub
  174.