home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / buddy / cfbsrc.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-04-16  |  7.7 KB  |  264 lines

  1. VERSION 4.00
  2. Begin VB.Form cfbsrc 
  3.    Caption         =   "WARNING:Changes made here may disable the Classy Form Buddy !"
  4.    ClientHeight    =   5364
  5.    ClientLeft      =   1236
  6.    ClientTop       =   1548
  7.    ClientWidth     =   10680
  8.    Height          =   5688
  9.    Left            =   1188
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   5364
  12.    ScaleWidth      =   10680
  13.    Top             =   1272
  14.    Width           =   10776
  15.    Begin VB.TextBox CFDt 
  16.       Height          =   300
  17.       Left            =   7452
  18.       TabIndex        =   11
  19.       Top             =   3492
  20.       Width           =   1440
  21.    End
  22.    Begin VB.Frame frmMethod 
  23.       Caption         =   "frmMethod"
  24.       Height          =   2556
  25.       Left            =   2724
  26.       TabIndex        =   10
  27.       Top             =   564
  28.       Width           =   6725
  29.    End
  30.    Begin VB.VScrollBar vsbMethod 
  31.       Height          =   2508
  32.       Left            =   9660
  33.       TabIndex        =   9
  34.       Top             =   192
  35.       Width           =   216
  36.    End
  37.    Begin VB.VScrollBar vsbProperty 
  38.       Height          =   2508
  39.       Left            =   9276
  40.       TabIndex        =   8
  41.       Top             =   132
  42.       Width           =   216
  43.    End
  44.    Begin VB.CheckBox CFBool 
  45.       Height          =   252
  46.       Left            =   7416
  47.       TabIndex        =   7
  48.       Top             =   1884
  49.       Width           =   204
  50.    End
  51.    Begin VB.TextBox CFGenString 
  52.       Height          =   300
  53.       Left            =   7452
  54.       TabIndex        =   6
  55.       Top             =   3036
  56.       Width           =   2856
  57.    End
  58.    Begin VB.TextBox CFGenNum 
  59.       Height          =   300
  60.       Left            =   7428
  61.       TabIndex        =   5
  62.       Top             =   2364
  63.       Width           =   1164
  64.    End
  65.    Begin VB.CommandButton btnMethod 
  66.       Caption         =   "Command1"
  67.       Height          =   432
  68.       Left            =   7428
  69.       TabIndex        =   4
  70.       Top             =   1248
  71.       Width           =   1368
  72.    End
  73.    Begin VB.CommandButton btnGetProp 
  74.       Caption         =   "GetProperties"
  75.       Height          =   432
  76.       Left            =   7428
  77.       TabIndex        =   3
  78.       Top             =   660
  79.       Width           =   1368
  80.    End
  81.    Begin VB.PictureBox pctMethods 
  82.       Height          =   2556
  83.       Left            =   24
  84.       ScaleHeight     =   2508
  85.       ScaleWidth      =   7128
  86.       TabIndex        =   2
  87.       Top             =   2748
  88.       Width           =   7176
  89.    End
  90.    Begin VB.CommandButton btnSetProp 
  91.       Caption         =   "Set Properties"
  92.       Height          =   432
  93.       Left            =   7428
  94.       TabIndex        =   1
  95.       Top             =   132
  96.       Width           =   1368
  97.    End
  98.    Begin VB.PictureBox pctProperty 
  99.       Height          =   2556
  100.       Left            =   24
  101.       ScaleHeight     =   2508
  102.       ScaleWidth      =   7128
  103.       TabIndex        =   0
  104.       Top             =   132
  105.       Width           =   7176
  106.    End
  107. Attribute VB_Name = "cfbsrc"
  108. Attribute VB_Creatable = False
  109. Attribute VB_Exposed = False
  110. Option Explicit
  111. '{{clsName}}
  112. Public gBase As New clsName
  113. Private OldVal As Integer
  114. Private OldMethVal As Integer
  115. Private Sub btnGetProp_Click()
  116.     'Call Property Procedures to set
  117.     'values from gBase
  118. End Sub
  119. Private Sub btnMethod_Click()
  120. End Sub
  121. Private Sub btnSetProp_Click()
  122.     'Call Property Procedures to return
  123.     'values to set gBase
  124. End Sub
  125. Private Sub Form_Load()
  126.     Set gBase = New clsName
  127.     OldVal = 0
  128.     OldMethVal = 0
  129.     vsbProperty_Init
  130.     vsbMethod_Init
  131.     Exit Sub
  132. End Sub
  133. Private Sub vsbMethod_Change()
  134.     Dim nCount As Integer
  135.     Dim nInc As Integer
  136.     nInc = OldMethVal - vsbMethod
  137.     For nCount = 0 To Me.Controls.Count - 1
  138.         If Me.Controls(nCount).Container.Name = "pctMethods" _
  139.          And Me.Controls(nCount).Name <> "vsbMethod" Then
  140.             Me.Controls(nCount).Top = Me.Controls(nCount).Top + nInc
  141.         End If
  142.     Next nCount
  143.     OldMethVal = vsbMethod.Value
  144.     Exit Sub
  145. End Sub
  146. Private Sub vsbProperty_Change()
  147.     Dim nCount As Integer
  148.     Dim nInc As Integer
  149.     nInc = OldVal - vsbProperty
  150.     For nCount = 0 To Me.Controls.Count - 1
  151.         If Me.Controls(nCount).Container.Name = "pctProperty" _
  152.          And Me.Controls(nCount).Name <> "vsbProperty" Then
  153.             Me.Controls(nCount).Top = Me.Controls(nCount).Top + nInc
  154.         End If
  155.     Next nCount
  156.     OldVal = vsbProperty.Value
  157.     Exit Sub
  158. End Sub
  159. Private Sub vsbProperty_Init()
  160.     Dim nCount As Integer
  161.     Dim nMaxTop As Integer
  162.     nMaxTop = 0
  163.     For nCount = 0 To Me.Controls.Count - 1
  164.         If Me.Controls(nCount).Container.Name = "pctProperty" Then
  165.             If Me.Controls(nCount).Top > nMaxTop Then
  166.                 nMaxTop = Me.Controls(nCount).Top + Me.Controls(nCount).Height
  167.             End If
  168.         End If
  169.     Next nCount
  170.     If nMaxTop < pctProperty.ScaleHeight Then
  171.         vsbProperty.Visible = False
  172.     Else
  173.         vsbProperty.Max = nMaxTop - pctProperty.ScaleHeight
  174.         vsbProperty.SmallChange = vsbProperty.Max / 10
  175.         vsbProperty.LargeChange = vsbProperty.Max / 2
  176.     End If
  177.     Exit Sub
  178. End Sub
  179. Private Sub vsbMethod_Init()
  180.     Dim nCount As Integer
  181.     Dim nMaxTop As Integer
  182.     nMaxTop = 0
  183.     For nCount = 0 To Me.Controls.Count - 1
  184.         If Me.Controls(nCount).Container.Name = "pctMethods" Then
  185.             If Me.Controls(nCount).Top > nMaxTop Then
  186.                 nMaxTop = Me.Controls(nCount).Top + Me.Controls(nCount).Height
  187.             End If
  188.         End If
  189.     Next nCount
  190.     If nMaxTop < pctMethods.ScaleHeight Then
  191.         vsbMethod.Visible = False
  192.     Else
  193.         vsbMethod.Max = nMaxTop - pctMethods.ScaleHeight
  194.         vsbMethod.SmallChange = vsbMethod.Max / 10
  195.         vsbMethod.LargeChange = vsbMethod.Max / 2
  196.     End If
  197.     Exit Sub
  198. End Sub
  199. Public Property Get CFGenNumVal() As Variant
  200. On Error GoTo ErrorHandler:
  201.     CFGenNumVal = CVar(CFGenNum.Text)
  202.     Exit Property
  203. ErrorHandler:
  204.     CFGenNumVal = CVar(0)
  205.     Exit Property
  206. End Property
  207. Public Property Let CFGenNumVal(vLet As Variant)
  208. On Error GoTo ErrorHandler:
  209.     CFGenNum.Text = Val(vLet)
  210.     Exit Property
  211. ErrorHandler:
  212.     CFGenNum.Text = Err.Description
  213.     Exit Property
  214. End Property
  215. Public Property Get CFGenStringVal() As Variant
  216. On Error GoTo ErrorHandler:
  217.     CFGenStringVal = CVar(CFGenString.Text)
  218.     Exit Property
  219. ErrorHandler:
  220.     CFGenStringVal = CVar("")
  221.     Exit Property
  222. End Property
  223. Public Property Let CFGenStringVal(vLet As Variant)
  224. On Error GoTo ErrorHandler:
  225.     CFGenString.Text = CStr(vLet)
  226.     Exit Property
  227. ErrorHandler:
  228.     CFGenString.Text = Err.Description
  229.     Exit Property
  230. End Property
  231. Public Property Get CFBoolVal() As Boolean
  232. On Error GoTo ErrorHandler:
  233.     CFBoolVal = CInt(-1 * CFBool.Value)
  234.     Exit Property
  235. ErrorHandler:
  236.     CFBoolVal = 0
  237.     Exit Property
  238. End Property
  239. Public Property Let CFBoolVal(vLet As Boolean)
  240. On Error GoTo ErrorHandler:
  241.     CFBool.Value = -1 * CInt(vLet)
  242.     Exit Property
  243. ErrorHandler:
  244.     CFBool.Value = 0
  245.     Exit Property
  246. End Property
  247. Public Property Let CFDtVal(dLet As Date)
  248. On Error GoTo ErrorHandler:
  249.     CFDt.Text = CStr(dLet)
  250.     Exit Property
  251. ErrorHandler:
  252.     CFDt.Text = Err.Description
  253.     Exit Property
  254. End Property
  255. Public Property Get CFDtVal() As Date
  256. On Error GoTo ErrorHandler:
  257.     CFDtVal = CDate(CFDt.Text)
  258.     Exit Property
  259. ErrorHandler:
  260.     CFDtVal = CDate("08/31/1955")
  261.     Exit Property
  262.         
  263. End Property
  264.