home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 February / PCWK0297.iso / envelop / envelop.6 / Tools / Bootcamp / concepts / encapsul / ENCAPSUL.ETO < prev    next >
Text File  |  1996-07-08  |  8KB  |  266 lines

  1. Type EncapsulationForm From SampleMasterForm
  2.   Dim BtnEnvelopWay As New Button
  3.   Dim BtnVisualBasicWay As New Button
  4.   Dim BtnEnvelopLeft As New Button
  5.   Dim BtnEnvelopRight As New Button
  6.   Dim BtnVisualBasicLeft As New Button
  7.   Dim BtnVisualBasicRight As New Button
  8.   Dim Label1 As New Label
  9.   Dim Label2 As New Label
  10.   Dim Label3 As New Label
  11.   Dim Label4 As New Label
  12.   Dim Label5 As New Label
  13.   Dim Label6 As New Label
  14.   Dim Label7 As New Label
  15.   Dim Label8 As New Label
  16.  
  17.   ' METHODS for object: EncapsulationForm
  18.   Sub BtnEnvelopLeft_Click()
  19.     EnvelopWay.MoveGaugesLeft
  20.   End Sub
  21.  
  22.   Sub BtnEnvelopRight_Click()
  23.     EnvelopWay.MoveGaugesRight
  24.   End Sub
  25.  
  26.   Sub BtnEnvelopWay_Click()
  27.     EnvelopWay.Show
  28.     EnvelopWay.BringToTop
  29.   End Sub
  30.  
  31.   Sub BtnVisualBasicLeft_Click()
  32.     VisualBasicWay.Gauge1.Move VisualBasicWay.ScaleWidth - (VisualBasicWay.Gauge1.Left + VisualBasicWay.Gauge1.Width), VisualBasicWay.Gauge1.Top, VisualBasicWay.Gauge1.Width, VisualBasicWay.Gauge1.Height
  33.   End Sub
  34.  
  35.   Sub BtnVisualBasicRight_Click()
  36.     VisualBasicWay.Gauge1.Move VisualBasicWay.ScaleWidth - VisualBasicWay.Gauge1.Width - VisualBasicWay.Gauge1.Left, VisualBasicWay.Gauge1.Top, VisualBasicWay.Gauge1.Width, VisualBasicWay.Gauge1.Height
  37.   End Sub
  38.  
  39.   Sub BtnVisualBasicWay_Click()
  40.     VisualBasicWay.Show
  41.     VisualBasicWay.BringToTop
  42.   End Sub
  43.  
  44.   Sub ResetApplication_Click()
  45.     ' Remove any copied gauges on the test forms
  46.     If FindObject("VisualBasicWay.Gauge2") Then 
  47.       DestroyObject(VisualBasicWay.Gauge2)
  48.     End If
  49.     If FindObject("VisualBasicWay.Gauge3") Then 
  50.       DestroyObject(VisualBasicWay.Gauge3)
  51.     End If
  52.     If FindObject("VisualBasicWay.Gauge4") Then 
  53.       DestroyObject(VisualBasicWay.Gauge4)
  54.     End If
  55.     If FindObject("EnvelopWay.EnvelopGauge2") Then 
  56.       DestroyObject(EnvelopWay.EnvelopGauge2)
  57.     End If
  58.     If FindObject("EnvelopWay.EnvelopGauge3") Then 
  59.       DestroyObject(EnvelopWay.EnvelopGauge3)
  60.     End If
  61.     If FindObject("EnvelopWay.EnvelopGauge4") Then 
  62.       DestroyObject(EnvelopWay.EnvelopGauge4)
  63.     End If
  64.   
  65.     If EnvelopWay.Visible = True Then 
  66.       EnvelopWay.MoveGaugesLeft
  67.       EnvelopWay.EnvelopGauge1.Value = 0
  68.     End If
  69.   
  70.     If VisualBasicWay.Visible = True Then 
  71.       VisualBasicWay.Gauge1.Move VisualBasicWay.ScaleWidth - (VisualBasicWay.Gauge1.Left + VisualBasicWay.Gauge1.Width), VisualBasicWay.Gauge1.Top, VisualBasicWay.Gauge1.Width, VisualBasicWay.Gauge1.Height
  72.       VisualBasicWay.Gauge1.Value = 0
  73.     End If
  74.   
  75.     ' Hide the two test forms
  76.     VisualBasicWay.Hide
  77.     EnvelopWay.Hide
  78.   
  79.   End Sub
  80.  
  81. End Type
  82.  
  83. Type EnvelopGauge From Gauge
  84.  
  85.   ' METHODS for object: EnvelopGauge
  86.   Sub MouseUp(button As Integer, shift As Integer, x As Single, y As Single)
  87.     Max = Width
  88.     Value = x
  89.   End Sub
  90.  
  91.   Sub MoveLeft
  92.     Move Parent.ScaleWidth - (Width + Left), Top, Width, Height
  93.   End Sub
  94.  
  95.   Sub MoveRight
  96.     Move Parent.ScaleWidth - Width - Left, Top, Width, Height
  97.   End Sub
  98.  
  99. End Type
  100.  
  101. Type EnvelopWay From Form
  102.   Dim BtnClose As New Button
  103.   Dim EnvelopGauge1 As New EnvelopGauge
  104.  
  105.   ' METHODS for object: EnvelopWay
  106.   Sub BtnClose_Click()
  107.     Hide
  108.   End Sub
  109.  
  110.   Sub MoveGaugesLeft
  111.     Controls.MoveLeft
  112.   End Sub
  113.  
  114.   Sub MoveGaugesRight
  115.     Controls.MoveRight
  116.   End Sub
  117.  
  118. End Type
  119.  
  120. Type VisualBasicWay From Form
  121.   Dim Gauge1 As New Gauge
  122.   Dim BtnClose As New Button
  123.  
  124.   ' METHODS for object: VisualBasicWay
  125.   Sub BtnClose_Click()
  126.     Hide
  127.   End Sub
  128.  
  129.   Sub Gauge1_MouseUp(button As Integer, shift As Integer, x As Single, y As Single)
  130.     Gauge1.Max = Gauge1.Width
  131.     Gauge1.Value = x
  132.   End Sub
  133.  
  134. End Type
  135.  
  136. Begin Code
  137. ' Reconstruction commands for object: EncapsulationForm
  138. '
  139.   With EncapsulationForm
  140.     .Caption := "Encapsulation Example"
  141.     .Move(1260, 1815, 5970, 6375)
  142.     .SampleDir := "C:\ENVELOP\bootcamp\concepts\encapsul\"
  143.     .SampleName := "ENCAPSUL"
  144.     With .BtnEnvelopWay
  145.       .Caption := "Envelop Way"
  146.       .ZOrder := 1
  147.       .Move(300, 3000, 1950, 450)
  148.     End With  'EncapsulationForm.BtnEnvelopWay
  149.     With .BtnVisualBasicWay
  150.       .Caption := "Visual Basic Way"
  151.       .ZOrder := 2
  152.       .Move(300, 4350, 1950, 450)
  153.     End With  'EncapsulationForm.BtnVisualBasicWay
  154.     With .BtnEnvelopLeft
  155.       .Caption := "<- Left"
  156.       .ZOrder := 3
  157.       .Move(3600, 3600, 900, 450)
  158.     End With  'EncapsulationForm.BtnEnvelopLeft
  159.     With .BtnEnvelopRight
  160.       .Caption := "Right ->"
  161.       .ZOrder := 4
  162.       .Move(4650, 3600, 900, 450)
  163.     End With  'EncapsulationForm.BtnEnvelopRight
  164.     With .BtnVisualBasicLeft
  165.       .Caption := "<- Left"
  166.       .ZOrder := 5
  167.       .Move(3600, 4950, 900, 450)
  168.     End With  'EncapsulationForm.BtnVisualBasicLeft
  169.     With .BtnVisualBasicRight
  170.       .Caption := "Right ->"
  171.       .ZOrder := 6
  172.       .Move(4650, 4950, 900, 450)
  173.     End With  'EncapsulationForm.BtnVisualBasicRight
  174.     With .Label1
  175.       .Caption := "Move EnvelopWay Controls"
  176.       .ForeColor := 255
  177.       .ZOrder := 7
  178.       .Move(300, 3750, 2850, 300)
  179.     End With  'EncapsulationForm.Label1
  180.     With .Label2
  181.       .Caption := "Move VisualBasicWay Controls"
  182.       .ForeColor := 255
  183.       .ZOrder := 8
  184.       .Move(300, 5100, 3150, 300)
  185.     End With  'EncapsulationForm.Label2
  186.     With .Label3
  187.       .Caption := "2. Activate Form Editor on EnvelopWay form."
  188.       .ForeColor := 16711680
  189.       .ZOrder := 9
  190.       .Move(300, 600, 4350, 300)
  191.     End With  'EncapsulationForm.Label3
  192.     With .Label4
  193.       .Caption := "3. Click on Gauge control."
  194.       .ForeColor := 16711680
  195.       .ZOrder := 10
  196.       .Move(300, 1050, 2550, 300)
  197.     End With  'EncapsulationForm.Label4
  198.     With .Label5
  199.       .Caption := "4. Press Control-C keys '3' times to create 3 copies."
  200.       .ForeColor := 16711680
  201.       .ZOrder := 11
  202.       .Move(300, 1500, 5100, 300)
  203.     End With  'EncapsulationForm.Label5
  204.     With .Label6
  205.       .Caption := "5.  Repeat these steps for VisualBasicWay form."
  206.       .ForeColor := 16711680
  207.       .ZOrder := 12
  208.       .Move(300, 1950, 4800, 300)
  209.     End With  'EncapsulationForm.Label6
  210.     With .Label7
  211.       .Caption := "1. Click Envelop Way and Visual Basic Way buttons."
  212.       .ForeColor := 16711680
  213.       .ZOrder := 13
  214.       .Move(300, 150, 5250, 300)
  215.     End With  'EncapsulationForm.Label7
  216.     With .Label8
  217.       .Caption := "6. Deactivate Form Editor and click on Gauge Controls."
  218.       .ForeColor := 16711680
  219.       .ZOrder := 14
  220.       .Move(300, 2400, 5400, 300)
  221.     End With  'EncapsulationForm.Label8
  222.     With .helpfile
  223.       .FileName := "C:\ENVELOP\bootcamp\concepts\encapsul\ENCAPSUL.hlp"
  224.     End With  'EncapsulationForm.helpfile
  225.   End With  'EncapsulationForm
  226. ' Reconstruction commands for object: EnvelopGauge
  227. '
  228.   With EnvelopGauge
  229.     .Move(0, 0, 0, 0)
  230.   End With  'EnvelopGauge
  231. ' Reconstruction commands for object: EnvelopWay
  232. '
  233.   With EnvelopWay
  234.     .Caption := "Envelop Way"
  235.     .Move(7635, 495, 5985, 4470)
  236.     With .BtnClose
  237.       .Caption := "Close"
  238.       .ZOrder := 1
  239.       .Move(2250, 3450, 1350, 450)
  240.     End With  'EnvelopWay.BtnClose
  241.     With .EnvelopGauge1
  242.       .Caption := "EnvelopGauge1"
  243.       .ZOrder := 1
  244.       .Move(300, 300, 3600, 600)
  245.       .Max := 3600
  246.     End With  'EnvelopWay.EnvelopGauge1
  247.   End With  'EnvelopWay
  248. ' Reconstruction commands for object: VisualBasicWay
  249. '
  250.   With VisualBasicWay
  251.     .Caption := "Visual Basic Way"
  252.     .Move(7740, 5880, 5970, 4455)
  253.     With .Gauge1
  254.       .Caption := "Gauge1"
  255.       .ZOrder := 1
  256.       .Move(300, 300, 3600, 600)
  257.       .Max := 3600
  258.     End With  'VisualBasicWay.Gauge1
  259.     With .BtnClose
  260.       .Caption := "Close"
  261.       .ZOrder := 1
  262.       .Move(2100, 3450, 1500, 450)
  263.     End With  'VisualBasicWay.BtnClose
  264.   End With  'VisualBasicWay
  265. End Code
  266.