home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 26 / CD_ASCQ_26_1295.iso / vrac / mcbundle.zip / TIME2WIN.ZIP / 3DMETER / T2W_3DM.FRM < prev    next >
Text File  |  1995-07-30  |  10KB  |  396 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "TIME2WIN : 3D Meter"
  5.    ClientHeight    =   4245
  6.    ClientLeft      =   945
  7.    ClientTop       =   1365
  8.    ClientWidth     =   6045
  9.    Height          =   4590
  10.    Left            =   915
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   4245
  13.    ScaleWidth      =   6045
  14.    Top             =   1050
  15.    Width           =   6105
  16.    Begin ComboBox Combo1 
  17.       BackColor       =   &H00C0C0C0&
  18.       FontBold        =   0   'False
  19.       FontItalic      =   0   'False
  20.       FontName        =   "MS Sans Serif"
  21.       FontSize        =   8.25
  22.       FontStrikethru  =   0   'False
  23.       FontUnderline   =   0   'False
  24.       Height          =   300
  25.       Left            =   2520
  26.       TabIndex        =   15
  27.       Top             =   2250
  28.       Width           =   2265
  29.    End
  30.    Begin CommandButton Command5 
  31.       Caption         =   "&Random value"
  32.       Height          =   465
  33.       Left            =   2520
  34.       TabIndex        =   4
  35.       Top             =   1260
  36.       Width           =   2265
  37.    End
  38.    Begin Frame Frame1 
  39.       BackColor       =   &H00C0C0C0&
  40.       Caption         =   "&Form"
  41.       Height          =   1815
  42.       Left            =   90
  43.       TabIndex        =   10
  44.       Top             =   1170
  45.       Width           =   2355
  46.       Begin OptionButton Option1 
  47.          BackColor       =   &H00C0C0C0&
  48.          Caption         =   "&Bar"
  49.          Height          =   225
  50.          Index           =   4
  51.          Left            =   180
  52.          TabIndex        =   9
  53.          Top             =   1440
  54.          Width           =   1905
  55.       End
  56.       Begin OptionButton Option1 
  57.          BackColor       =   &H00C0C0C0&
  58.          Caption         =   "&Ellipse"
  59.          Height          =   225
  60.          Index           =   3
  61.          Left            =   180
  62.          TabIndex        =   8
  63.          Top             =   1170
  64.          Width           =   1905
  65.       End
  66.       Begin OptionButton Option1 
  67.          BackColor       =   &H00C0C0C0&
  68.          Caption         =   "&Trapezium"
  69.          Height          =   225
  70.          Index           =   2
  71.          Left            =   180
  72.          TabIndex        =   7
  73.          Top             =   900
  74.          Width           =   1905
  75.       End
  76.       Begin OptionButton Option1 
  77.          BackColor       =   &H00C0C0C0&
  78.          Caption         =   "&Triangle"
  79.          Height          =   225
  80.          Index           =   1
  81.          Left            =   180
  82.          TabIndex        =   6
  83.          Top             =   630
  84.          Width           =   1905
  85.       End
  86.       Begin OptionButton Option1 
  87.          BackColor       =   &H00C0C0C0&
  88.          Caption         =   "&Rectangle"
  89.          Height          =   225
  90.          Index           =   0
  91.          Left            =   180
  92.          TabIndex        =   5
  93.          Top             =   360
  94.          Value           =   -1  'True
  95.          Width           =   1905
  96.       End
  97.    End
  98.    Begin CheckBox Check1 
  99.       BackColor       =   &H00C0C0C0&
  100.       Caption         =   "Swap &Border"
  101.       Height          =   285
  102.       Left            =   2520
  103.       TabIndex        =   11
  104.       Top             =   1800
  105.       Width           =   2265
  106.    End
  107.    Begin HScrollBar HScroll1 
  108.       Height          =   285
  109.       LargeChange     =   100
  110.       Left            =   2520
  111.       SmallChange     =   25
  112.       TabIndex        =   12
  113.       Top             =   2700
  114.       Width           =   2265
  115.    End
  116.    Begin PictureBox Picture2 
  117.       BackColor       =   &H00FFFFFF&
  118.       Height          =   4050
  119.       Left            =   4860
  120.       ScaleHeight     =   4020
  121.       ScaleWidth      =   1050
  122.       TabIndex        =   14
  123.       TabStop         =   0   'False
  124.       Top             =   90
  125.       Width           =   1080
  126.    End
  127.    Begin PictureBox Picture1 
  128.       BackColor       =   &H00FFFFFF&
  129.       Height          =   1080
  130.       Left            =   180
  131.       ScaleHeight     =   1050
  132.       ScaleWidth      =   4575
  133.       TabIndex        =   13
  134.       TabStop         =   0   'False
  135.       Top             =   3060
  136.       Width           =   4605
  137.    End
  138.    Begin CommandButton Command4 
  139.       Caption         =   "Swap &Horizontal/Vertical"
  140.       Height          =   465
  141.       Left            =   90
  142.       TabIndex        =   1
  143.       Top             =   630
  144.       Width           =   2355
  145.    End
  146.    Begin CommandButton Command3 
  147.       Caption         =   "Automatic &Decrease"
  148.       Height          =   465
  149.       Left            =   2520
  150.       TabIndex        =   3
  151.       Top             =   630
  152.       Width           =   2265
  153.    End
  154.    Begin CommandButton Command2 
  155.       Caption         =   "Automatic &Increase"
  156.       Height          =   465
  157.       Left            =   2520
  158.       TabIndex        =   2
  159.       Top             =   90
  160.       Width           =   2265
  161.    End
  162.    Begin CommandButton Command1 
  163.       Caption         =   "Half of Current &Value"
  164.       Height          =   465
  165.       Left            =   90
  166.       TabIndex        =   0
  167.       Top             =   90
  168.       Width           =   2355
  169.    End
  170. End
  171. Option Explicit
  172.  
  173. Dim LoadFinish    As Integer
  174.  
  175. Dim Meter1        As tag3DMeter
  176. Dim Meter2        As tag3DMeter
  177.  
  178. Sub Check1_Click ()
  179.    
  180.    'swap the border style
  181.    If (Picture1.BorderStyle = 1) Then
  182.       Picture1.BorderStyle = 0
  183.    Else
  184.       Picture1.BorderStyle = 1
  185.    End If
  186.    
  187.    If (Picture2.BorderStyle = 1) Then
  188.       Picture2.BorderStyle = 0
  189.    Else
  190.       Picture2.BorderStyle = 1
  191.    End If
  192.    
  193.    Call Update3DMeter
  194.  
  195. End Sub
  196.  
  197. Sub Combo1_Click ()
  198.  
  199.    If (LoadFinish = True) Then
  200.       ' update the brush style
  201.       Meter1.HatchBrush = Combo1.ListIndex
  202.       Meter2.HatchBrush = Combo1.ListIndex
  203.  
  204.       Call Update3DMeter
  205.    End If
  206.  
  207. End Sub
  208.  
  209. Sub Command1_Click ()
  210.  
  211.    ' calculate the half value and refresh
  212.    Meter1.CrtValue = Meter1.CrtValue / 2
  213.    
  214.    ' calculate the half value and refresh
  215.    Meter2.CrtValue = Meter2.CrtValue / 2
  216.    
  217.    ' refresh the scroll bar
  218.    HScroll1.Value = Meter1.CrtValue
  219.  
  220.    Call Update3DMeter
  221.  
  222. End Sub
  223.  
  224. Sub Command2_Click ()
  225.  
  226.    Dim i As Integer
  227.  
  228.    ' automatic increase
  229.    For i = Meter1.CrtValue To Meter1.MaxValue
  230.       Meter1.CrtValue = i
  231.       Meter2.CrtValue = i
  232.       Call Update3DMeter
  233.    Next i
  234.  
  235.    ' refresh the scroll bar
  236.    HScroll1.Value = Meter1.CrtValue
  237.  
  238. End Sub
  239.  
  240. Sub Command3_Click ()
  241.  
  242.    Dim i As Integer
  243.  
  244.    ' automatic decrease
  245.    For i = Meter1.CrtValue To 0 Step -1
  246.       Meter1.CrtValue = i
  247.       Meter2.CrtValue = i
  248.       Call Update3DMeter
  249.    Next i
  250.  
  251.    ' refresh the scroll bar
  252.    HScroll1.Value = Meter1.CrtValue
  253.  
  254. End Sub
  255.  
  256. Sub Command4_Click ()
  257.  
  258.    ' swap the direction and refresh
  259.    Meter1.Direction = Not Meter1.Direction
  260.    
  261.    ' swap the direction and refresh
  262.    Meter2.Direction = Not Meter2.Direction
  263.    
  264.    ' refresh the scroll bar
  265.    HScroll1.Value = Meter1.CrtValue
  266.  
  267.    Call Update3DMeter
  268.  
  269. End Sub
  270.  
  271. Sub Command5_Click ()
  272.  
  273.    Dim i As Integer
  274.  
  275.    Randomize Timer
  276.  
  277.    ' automatic decrease
  278.    For i = 1 To 50
  279.       Meter1.CrtValue = Meter1.MaxValue * Rnd(1)
  280.       Meter2.CrtValue = Meter2.MaxValue * Rnd(1)
  281.       Call Update3DMeter
  282.    Next i
  283.  
  284.    ' refresh the scroll bar
  285.    HScroll1.Value = Meter1.CrtValue
  286.  
  287. End Sub
  288.  
  289. Sub Form_Load ()
  290.  
  291.    ' some initialization
  292.    LoadFinish = False
  293.  
  294.    ' initialize the random generator
  295.    Randomize Timer
  296.  
  297.    ' initialize the combo box
  298.    Combo1.AddItem "Solid brush"
  299.    Combo1.AddItem "Horizontal"
  300.    Combo1.AddItem "Vertical"
  301.    Combo1.AddItem "Downward diagonal"
  302.    Combo1.AddItem "Upward diagonal"
  303.    Combo1.AddItem "Cross"
  304.    Combo1.AddItem "Diagonal cross"
  305.  
  306.    Combo1.ListIndex = 0
  307.  
  308.    ' initialize the first 3D-Meter
  309.    Meter1.MaxValue = 100
  310.    Meter1.CrtValue = Meter1.MaxValue / 2
  311.    Meter1.BackColor = &HC0C0C0
  312.    Meter1.ForeColor = &H808080
  313.    Meter1.Polygon = 0
  314.    Meter1.BarSize = 7      'default = 10
  315.    Meter1.SpaceBars = 0    'default = 2
  316.    Meter1.Direction = 0
  317.    Meter1.Thickness = 0
  318.    Meter1.ThreeD = -1
  319.    Meter1.HatchBrush = Combo1.ListIndex
  320.    
  321.    ' initialize the second 3D-Meter
  322.    Call cTypesCopy(Meter1, Meter2, Len(Meter1))
  323.    Meter2.Direction = Not Meter1.Direction
  324.    Meter1.ThreeD = 1
  325.    
  326.    ' initialize the scroll bar
  327.    HScroll1.LargeChange = Meter1.MaxValue / 10
  328.    HScroll1.SmallChange = Meter1.MaxValue / 20
  329.    HScroll1.Max = Meter1.MaxValue
  330.    HScroll1.Value = Meter1.MaxValue / 2
  331.  
  332.    ' initialize backcolor of picture
  333.    Picture1.BackColor = Meter1.BackColor
  334.    Picture2.BackColor = Meter2.BackColor
  335.  
  336.    LoadFinish = True
  337.  
  338. End Sub
  339.  
  340. Sub Form_Paint ()
  341.  
  342.    Call Update3DMeter
  343.  
  344.    ' refresh some 3D controls
  345.    c3D HScroll1, 0, 0
  346.    c3D Check1, 0, 0
  347.  
  348.    c3D Option1(0), 0, 0
  349.    c3D Option1(1), 0, 0
  350.    c3D Option1(2), 0, 0
  351.    c3D Option1(3), 0, 0
  352.    c3D Option1(4), 0, 0
  353.  
  354. End Sub
  355.  
  356. Sub HScroll1_Change ()
  357.  
  358.    Call Update3DMeterScrollBar
  359.  
  360. End Sub
  361.  
  362. Sub HScroll1_Scroll ()
  363.  
  364.    Call Update3DMeterScrollBar
  365.  
  366. End Sub
  367.  
  368. Sub Option1_Click (Index As Integer)
  369.  
  370.    ' set the form of the 3D Meter
  371.    Meter1.Polygon = Index
  372.    Meter2.Polygon = Index
  373.    
  374.    Call Update3DMeter
  375.  
  376. End Sub
  377.  
  378. Sub Update3DMeter ()
  379.  
  380.    ' refresh the 3D-Meter
  381.    Call c3DMeter(Picture1, Meter1)
  382.    Call c3DMeter(Picture2, Meter2)
  383.  
  384. End Sub
  385.  
  386. Sub Update3DMeterScrollBar ()
  387.  
  388.    ' update current value
  389.    Meter1.CrtValue = HScroll1.Value
  390.    Meter2.CrtValue = HScroll1.Value
  391.  
  392.    Call Update3DMeter
  393.  
  394. End Sub
  395.  
  396.