home *** CD-ROM | disk | FTP | other *** search
/ The Best of Select: Windows 95 Special 2 / WIN95_2.bin / utils / envelop / envelop.6 / Tools / Bootcamp / basic / buttons / buttons.eto < prev    next >
Encoding:
Text File  |  1996-07-08  |  7.4 KB  |  274 lines

  1. Type ButtonMasterForm From SampleMasterForm
  2.   Dim Label1 As New Label
  3.   Dim Label3 As New Label
  4.   Dim Label4 As New Label
  5.   Dim Label5 As New Label
  6.   Dim Label6 As New Label
  7.   Dim btnSize As New Button
  8.   Dim btnCaption As New Button
  9.   Dim btnMove As New Button
  10.   Dim btnTom As New Button
  11.   Dim btnDick As New Button
  12.   Dim btnHarry As New Button
  13.   Dim btnCalm As New Button
  14.   Dim btnHappy As New Button
  15.   Dim btnExcited As New Button
  16.   Dim FaceImage As New Image
  17.   Dim Face1Bitmap As New Bitmap
  18.   Dim Face2Bitmap As New Bitmap
  19.   Dim Face3Bitmap As New Bitmap
  20.   Dim Face4Bitmap As New Bitmap
  21.   Dim btnAngry As New Button
  22.   Dim lblHideMessage As New Label
  23.  
  24.   ' METHODS for object: ButtonMasterForm
  25.   Sub btnTom_Click()
  26.     btnDick.Visible = "True"
  27.     btnHarry.Visible = "True"
  28.     btnTom.Visible = "False"
  29.     lblHideMessage.Caption = "Tom's Disappeared!"
  30.   End Sub
  31.  
  32.   Sub btnDick_Click()
  33.     btnDick.Visible = "False"
  34.     btnHarry.Visible = "True"
  35.     btnTom.Visible = "True"
  36.     lblHideMessage.Caption = "Anyone seen Dick?"
  37.   End Sub
  38.  
  39.   Sub btnHarry_Click()
  40.     btnDick.Visible = "True"
  41.     btnHarry.Visible = "False"
  42.     btnTom.Visible = "True"
  43.     lblHideMessage.Caption = "Where in the world is Harry?"
  44.   End Sub
  45.  
  46.   Sub btnMove_Click()
  47.     Dim cur_location As Integer
  48.     cur_location = btnMove.Left
  49.     Select Case cur_location
  50.       Case 600
  51.         btnMove.Left = 1600
  52.       Case 1600
  53.         btnMove.Left = 2600
  54.       Case 2600
  55.         btnMove.Left = 3600
  56.       Case 3600
  57.         btnMove.Left = 4600
  58.       Case 4600
  59.         btnMove.Left = 5600
  60.       Case 5600
  61.         btnMove.Left = 600
  62.     End Select
  63.   End Sub
  64.  
  65.   Sub btnCaption_Click()
  66.     Dim count As Integer
  67.     Dim first_paren As Integer
  68.     Dim start_pos As Integer
  69.     Dim second_paren As Integer
  70.     Dim click_number As Integer
  71.   
  72.     If btnCaption.Caption == "" Then 
  73.       btnCaption.Caption = "I've been clicked (1) time."
  74.     Else 
  75.       ' Figure out how many times the button has been clicked
  76.       first_paren = Instr(btnCaption.Caption, "(")
  77.       start_pos = first_paren + 1
  78.       second_paren = Instr(start_pos, btnCaption.Caption, ")")
  79.       click_number = Val(Mid(btnCaption.Caption, start_pos, second_paren - start_pos))
  80.       click_number = click_number + 1
  81.       btnCaption.Caption = "I've been clicked (" & click_number & ") times."
  82.     End If
  83.   End Sub
  84.  
  85.   Sub btnSize_Click()
  86.   
  87.     If btnSize.Top < 75 Then 
  88.       btnSize.Left = 5700
  89.       btnSize.Top = 450
  90.       btnSize.Width = 300
  91.       btnSize.Height = 300
  92.     Else 
  93.       btnSize.Left = btnSize.Left - 75
  94.       btnSize.Top = btnSize.Top - 75
  95.       btnSize.Width = btnSize.Width + 150
  96.       btnSize.Height = btnSize.Height + 150
  97.     End If
  98.   
  99.   End Sub
  100.  
  101.   Sub btnAngry_Click()
  102.     ' Set the name of the icon file
  103.     FaceImage.Picture = Face4Bitmap
  104.     FaceImage.Refresh
  105.   End Sub
  106.  
  107.   Sub btnCalm_Click()
  108.     ' Set the name of the icon file
  109.     FaceImage.Picture = Face1Bitmap
  110.     FaceImage.Refresh
  111.   End Sub
  112.  
  113.   Sub btnExcited_Click()
  114.     ' Set the name of the icon file
  115.     FaceImage.Picture = Face3Bitmap
  116.     FaceImage.Refresh
  117.   End Sub
  118.  
  119.   Sub btnHappy_Click()
  120.     ' Set the name of the icon file
  121.     FaceImage.Picture = Face2Bitmap
  122.     FaceImage.Refresh
  123.   End Sub
  124.  
  125.   Sub ResetApplication_Click ()
  126.     ' Setup Demo #1
  127.     btnSize.Left = 5700
  128.     btnSize.Top = 450
  129.     btnSize.Width = 300
  130.     btnSize.Height = 300
  131.   
  132.     ' Setup Demo #2
  133.     btnCaption.Caption = ""
  134.   
  135.     ' Setup Demo #3
  136.     btnMove.Left = 600
  137.   
  138.     ' Setup Demo #4
  139.     lblHideMessage.Caption = ""
  140.     btnTom.Visible = "True"
  141.     btnDick.Visible = "True"
  142.     btnHarry.Visible = "True"
  143.   
  144.     ' Setup Demo #5
  145.     FaceImage.Picture = Face1Bitmap
  146.     FaceImage.Refresh
  147.   
  148.   End Sub
  149.  
  150. End Type
  151.  
  152. Begin Code
  153. ' Reconstruction commands for object: ButtonMasterForm
  154. '
  155.   With ButtonMasterForm
  156.     .Caption := "Button Demonstration"
  157.     .Move(6165, 300, 7605, 6825)
  158.     .SampleDir := "W:\bootcamp\basic\buttons\"
  159.     .SampleName := "buttons"
  160.     With .Label1
  161.       .Caption := "1. Click to change button size."
  162.       .ForeColor := 13107200
  163.       .ZOrder := 1
  164.       .Move(300, 300, 3450, 300)
  165.     End With  'ButtonMasterForm.Label1
  166.     With .Label3
  167.       .Caption := "2. Click to change button caption."
  168.       .ForeColor := 13107200
  169.       .ZOrder := 2
  170.       .Move(300, 1350, 3450, 300)
  171.     End With  'ButtonMasterForm.Label3
  172.     With .Label4
  173.       .Caption := "3. Click to move button."
  174.       .ForeColor := 13107200
  175.       .ZOrder := 3
  176.       .Move(300, 1950, 3450, 300)
  177.     End With  'ButtonMasterForm.Label4
  178.     With .Label5
  179.       .Caption := "4. Click to hide button."
  180.       .ForeColor := 13107200
  181.       .ZOrder := 4
  182.       .Move(300, 3150, 2250, 300)
  183.     End With  'ButtonMasterForm.Label5
  184.     With .Label6
  185.       .Caption := "5. Click to change expression."
  186.       .ForeColor := 13107200
  187.       .ZOrder := 5
  188.       .Move(300, 4650, 3450, 300)
  189.     End With  'ButtonMasterForm.Label6
  190.     With .btnSize
  191.       .ZOrder := 6
  192.       .Move(5700, 450, 300, 300)
  193.     End With  'ButtonMasterForm.btnSize
  194.     With .btnCaption
  195.       .ZOrder := 7
  196.       .Move(4200, 1200, 3000, 450)
  197.     End With  'ButtonMasterForm.btnCaption
  198.     With .btnMove
  199.       .Caption := "Move Me"
  200.       .ZOrder := 8
  201.       .Move(600, 2400, 1200, 450)
  202.     End With  'ButtonMasterForm.btnMove
  203.     With .btnTom
  204.       .Caption := "Tom"
  205.       .ZOrder := 9
  206.       .Move(600, 3600, 1500, 450)
  207.     End With  'ButtonMasterForm.btnTom
  208.     With .btnDick
  209.       .Caption := "Dick"
  210.       .ZOrder := 10
  211.       .Move(3150, 3600, 1500, 450)
  212.     End With  'ButtonMasterForm.btnDick
  213.     With .btnHarry
  214.       .Caption := "Harry"
  215.       .ZOrder := 11
  216.       .Move(5700, 3600, 1500, 450)
  217.     End With  'ButtonMasterForm.btnHarry
  218.     With .btnCalm
  219.       .Caption := "Calm"
  220.       .ZOrder := 12
  221.       .Move(600, 5400, 900, 450)
  222.     End With  'ButtonMasterForm.btnCalm
  223.     With .btnHappy
  224.       .Caption := "Happy"
  225.       .ZOrder := 13
  226.       .Move(1650, 5400, 900, 450)
  227.     End With  'ButtonMasterForm.btnHappy
  228.     With .btnExcited
  229.       .Caption := "Excited"
  230.       .ZOrder := 14
  231.       .Move(2700, 5400, 900, 450)
  232.     End With  'ButtonMasterForm.btnExcited
  233.     With .FaceImage
  234.       .Caption := "FaceImage"
  235.       .ZOrder := 15
  236.       .Move(4050, 4500, 480, 480)
  237.       .BevelOuter := "None"
  238.       .Picture := ButtonMasterForm.Face1Bitmap
  239.     End With  'ButtonMasterForm.FaceImage
  240.     With .Face1Bitmap
  241.       .LoadType := "MemoryBased"
  242.       .FileName := "buttons.ero"
  243.       .ResId := 0
  244.     End With  'ButtonMasterForm.Face1Bitmap
  245.     With .Face2Bitmap
  246.       .LoadType := "MemoryBased"
  247.       .FileName := "buttons.ero"
  248.       .ResId := 628
  249.     End With  'ButtonMasterForm.Face2Bitmap
  250.     With .Face3Bitmap
  251.       .LoadType := "MemoryBased"
  252.       .FileName := "buttons.ero"
  253.       .ResId := 1256
  254.     End With  'ButtonMasterForm.Face3Bitmap
  255.     With .Face4Bitmap
  256.       .LoadType := "MemoryBased"
  257.       .FileName := "buttons.ero"
  258.       .ResId := 1884
  259.     End With  'ButtonMasterForm.Face4Bitmap
  260.     With .btnAngry
  261.       .Caption := "Angry"
  262.       .ZOrder := 16
  263.       .Move(3750, 5400, 900, 450)
  264.     End With  'ButtonMasterForm.btnAngry
  265.     With .lblHideMessage
  266.       .ZOrder := 17
  267.       .Move(2850, 3150, 4350, 300)
  268.     End With  'ButtonMasterForm.lblHideMessage
  269.     With .helpfile
  270.       .FileName := "W:\bootcamp\basic\buttons\buttons.hlp"
  271.     End With  'ButtonMasterForm.helpfile
  272.   End With  'ButtonMasterForm
  273. End Code
  274.