home *** CD-ROM | disk | FTP | other *** search
- Type EncapsulationForm From SampleMasterForm
- Dim BtnEnvelopWay As New Button
- Dim BtnVisualBasicWay As New Button
- Dim BtnEnvelopLeft As New Button
- Dim BtnEnvelopRight As New Button
- Dim BtnVisualBasicLeft As New Button
- Dim BtnVisualBasicRight As New Button
- Dim Label1 As New Label
- Dim Label2 As New Label
- Dim Label3 As New Label
- Dim Label4 As New Label
- Dim Label5 As New Label
- Dim Label6 As New Label
- Dim Label7 As New Label
- Dim Label8 As New Label
-
- ' METHODS for object: EncapsulationForm
- Sub BtnEnvelopLeft_Click()
- EnvelopWay.MoveGaugesLeft
- End Sub
-
- Sub BtnEnvelopRight_Click()
- EnvelopWay.MoveGaugesRight
- End Sub
-
- Sub BtnEnvelopWay_Click()
- EnvelopWay.Show
- EnvelopWay.BringToTop
- End Sub
-
- Sub BtnVisualBasicLeft_Click()
- VisualBasicWay.Gauge1.Move VisualBasicWay.ScaleWidth - (VisualBasicWay.Gauge1.Left + VisualBasicWay.Gauge1.Width), VisualBasicWay.Gauge1.Top, VisualBasicWay.Gauge1.Width, VisualBasicWay.Gauge1.Height
- End Sub
-
- Sub BtnVisualBasicRight_Click()
- VisualBasicWay.Gauge1.Move VisualBasicWay.ScaleWidth - VisualBasicWay.Gauge1.Width - VisualBasicWay.Gauge1.Left, VisualBasicWay.Gauge1.Top, VisualBasicWay.Gauge1.Width, VisualBasicWay.Gauge1.Height
- End Sub
-
- Sub BtnVisualBasicWay_Click()
- VisualBasicWay.Show
- VisualBasicWay.BringToTop
- End Sub
-
- Sub ResetApplication_Click()
- ' Remove any copied gauges on the test forms
- If FindObject("VisualBasicWay.Gauge2") Then
- DestroyObject(VisualBasicWay.Gauge2)
- End If
- If FindObject("VisualBasicWay.Gauge3") Then
- DestroyObject(VisualBasicWay.Gauge3)
- End If
- If FindObject("VisualBasicWay.Gauge4") Then
- DestroyObject(VisualBasicWay.Gauge4)
- End If
- If FindObject("EnvelopWay.EnvelopGauge2") Then
- DestroyObject(EnvelopWay.EnvelopGauge2)
- End If
- If FindObject("EnvelopWay.EnvelopGauge3") Then
- DestroyObject(EnvelopWay.EnvelopGauge3)
- End If
- If FindObject("EnvelopWay.EnvelopGauge4") Then
- DestroyObject(EnvelopWay.EnvelopGauge4)
- End If
-
- If EnvelopWay.Visible = True Then
- EnvelopWay.MoveGaugesLeft
- EnvelopWay.EnvelopGauge1.Value = 0
- End If
-
- If VisualBasicWay.Visible = True Then
- VisualBasicWay.Gauge1.Move VisualBasicWay.ScaleWidth - (VisualBasicWay.Gauge1.Left + VisualBasicWay.Gauge1.Width), VisualBasicWay.Gauge1.Top, VisualBasicWay.Gauge1.Width, VisualBasicWay.Gauge1.Height
- VisualBasicWay.Gauge1.Value = 0
- End If
-
- ' Hide the two test forms
- VisualBasicWay.Hide
- EnvelopWay.Hide
-
- End Sub
-
- End Type
-
- Type EnvelopGauge From Gauge
-
- ' METHODS for object: EnvelopGauge
- Sub MouseUp(button As Integer, shift As Integer, x As Single, y As Single)
- Max = Width
- Value = x
- End Sub
-
- Sub MoveLeft
- Move Parent.ScaleWidth - (Width + Left), Top, Width, Height
- End Sub
-
- Sub MoveRight
- Move Parent.ScaleWidth - Width - Left, Top, Width, Height
- End Sub
-
- End Type
-
- Type EnvelopWay From Form
- Dim BtnClose As New Button
- Dim EnvelopGauge1 As New EnvelopGauge
-
- ' METHODS for object: EnvelopWay
- Sub BtnClose_Click()
- Hide
- End Sub
-
- Sub MoveGaugesLeft
- Controls.MoveLeft
- End Sub
-
- Sub MoveGaugesRight
- Controls.MoveRight
- End Sub
-
- End Type
-
- Type VisualBasicWay From Form
- Dim Gauge1 As New Gauge
- Dim BtnClose As New Button
-
- ' METHODS for object: VisualBasicWay
- Sub BtnClose_Click()
- Hide
- End Sub
-
- Sub Gauge1_MouseUp(button As Integer, shift As Integer, x As Single, y As Single)
- Gauge1.Max = Gauge1.Width
- Gauge1.Value = x
- End Sub
-
- End Type
-
- Begin Code
- ' Reconstruction commands for object: EncapsulationForm
- '
- With EncapsulationForm
- .Caption := "Encapsulation Example"
- .Move(1260, 1815, 5970, 6375)
- .SampleDir := "C:\ENVELOP\bootcamp\concepts\encapsul\"
- .SampleName := "ENCAPSUL"
- With .BtnEnvelopWay
- .Caption := "Envelop Way"
- .ZOrder := 1
- .Move(300, 3000, 1950, 450)
- End With 'EncapsulationForm.BtnEnvelopWay
- With .BtnVisualBasicWay
- .Caption := "Visual Basic Way"
- .ZOrder := 2
- .Move(300, 4350, 1950, 450)
- End With 'EncapsulationForm.BtnVisualBasicWay
- With .BtnEnvelopLeft
- .Caption := "<- Left"
- .ZOrder := 3
- .Move(3600, 3600, 900, 450)
- End With 'EncapsulationForm.BtnEnvelopLeft
- With .BtnEnvelopRight
- .Caption := "Right ->"
- .ZOrder := 4
- .Move(4650, 3600, 900, 450)
- End With 'EncapsulationForm.BtnEnvelopRight
- With .BtnVisualBasicLeft
- .Caption := "<- Left"
- .ZOrder := 5
- .Move(3600, 4950, 900, 450)
- End With 'EncapsulationForm.BtnVisualBasicLeft
- With .BtnVisualBasicRight
- .Caption := "Right ->"
- .ZOrder := 6
- .Move(4650, 4950, 900, 450)
- End With 'EncapsulationForm.BtnVisualBasicRight
- With .Label1
- .Caption := "Move EnvelopWay Controls"
- .ForeColor := 255
- .ZOrder := 7
- .Move(300, 3750, 2850, 300)
- End With 'EncapsulationForm.Label1
- With .Label2
- .Caption := "Move VisualBasicWay Controls"
- .ForeColor := 255
- .ZOrder := 8
- .Move(300, 5100, 3150, 300)
- End With 'EncapsulationForm.Label2
- With .Label3
- .Caption := "2. Activate Form Editor on EnvelopWay form."
- .ForeColor := 16711680
- .ZOrder := 9
- .Move(300, 600, 4350, 300)
- End With 'EncapsulationForm.Label3
- With .Label4
- .Caption := "3. Click on Gauge control."
- .ForeColor := 16711680
- .ZOrder := 10
- .Move(300, 1050, 2550, 300)
- End With 'EncapsulationForm.Label4
- With .Label5
- .Caption := "4. Press Control-C keys '3' times to create 3 copies."
- .ForeColor := 16711680
- .ZOrder := 11
- .Move(300, 1500, 5100, 300)
- End With 'EncapsulationForm.Label5
- With .Label6
- .Caption := "5. Repeat these steps for VisualBasicWay form."
- .ForeColor := 16711680
- .ZOrder := 12
- .Move(300, 1950, 4800, 300)
- End With 'EncapsulationForm.Label6
- With .Label7
- .Caption := "1. Click Envelop Way and Visual Basic Way buttons."
- .ForeColor := 16711680
- .ZOrder := 13
- .Move(300, 150, 5250, 300)
- End With 'EncapsulationForm.Label7
- With .Label8
- .Caption := "6. Deactivate Form Editor and click on Gauge Controls."
- .ForeColor := 16711680
- .ZOrder := 14
- .Move(300, 2400, 5400, 300)
- End With 'EncapsulationForm.Label8
- With .helpfile
- .FileName := "C:\ENVELOP\bootcamp\concepts\encapsul\ENCAPSUL.hlp"
- End With 'EncapsulationForm.helpfile
- End With 'EncapsulationForm
- ' Reconstruction commands for object: EnvelopGauge
- '
- With EnvelopGauge
- .Move(0, 0, 0, 0)
- End With 'EnvelopGauge
- ' Reconstruction commands for object: EnvelopWay
- '
- With EnvelopWay
- .Caption := "Envelop Way"
- .Move(7635, 495, 5985, 4470)
- With .BtnClose
- .Caption := "Close"
- .ZOrder := 1
- .Move(2250, 3450, 1350, 450)
- End With 'EnvelopWay.BtnClose
- With .EnvelopGauge1
- .Caption := "EnvelopGauge1"
- .ZOrder := 1
- .Move(300, 300, 3600, 600)
- .Max := 3600
- End With 'EnvelopWay.EnvelopGauge1
- End With 'EnvelopWay
- ' Reconstruction commands for object: VisualBasicWay
- '
- With VisualBasicWay
- .Caption := "Visual Basic Way"
- .Move(7740, 5880, 5970, 4455)
- With .Gauge1
- .Caption := "Gauge1"
- .ZOrder := 1
- .Move(300, 300, 3600, 600)
- .Max := 3600
- End With 'VisualBasicWay.Gauge1
- With .BtnClose
- .Caption := "Close"
- .ZOrder := 1
- .Move(2100, 3450, 1500, 450)
- End With 'VisualBasicWay.BtnClose
- End With 'VisualBasicWay
- End Code
-