home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / tool / various / ctdemo / ct_meter.frm < prev    next >
Text File  |  1995-02-26  |  16KB  |  476 lines

  1. VERSION 2.00
  2. Begin Form w_ctmeter 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "ctMETER and ctGAUGE (Meter and Gauge Controls) Demo"
  6.    ClientHeight    =   5445
  7.    ClientLeft      =   855
  8.    ClientTop       =   1005
  9.    ClientWidth     =   7215
  10.    FontBold        =   -1  'True
  11.    FontItalic      =   0   'False
  12.    FontName        =   "MS Sans Serif"
  13.    FontSize        =   9.75
  14.    FontStrikethru  =   0   'False
  15.    FontUnderline   =   0   'False
  16.    Height          =   5970
  17.    Icon            =   CT_METER.FRX:0000
  18.    Left            =   795
  19.    LinkTopic       =   "Form1"
  20.    MaxButton       =   0   'False
  21.    MDIChild        =   -1  'True
  22.    ScaleHeight     =   5445
  23.    ScaleWidth      =   7215
  24.    Top             =   540
  25.    Width           =   7335
  26.    Begin ctGAUGE ctGauge1 
  27.       AngleEnd        =   196
  28.       AngleStart      =   343
  29.       BackColor       =   &H00FFFFFF&
  30.       BorderColor     =   &H00000000&
  31.       BorderType      =   2  'Raised
  32.       Height          =   1965
  33.       Left            =   3780
  34.       MaxValue        =   100
  35.       MinValue        =   0
  36.       NeedleColor     =   &H000000FF&
  37.       NeedlePosition  =   4  'Middle Center
  38.       NeedleSize      =   0
  39.       NeedleSolid     =   -1  'True
  40.       NeedleThickness =   2
  41.       NeedleXOffset   =   0
  42.       NeedleYOffset   =   14
  43.       Picture         =   CT_METER.FRX:0302
  44.       ShadowColor     =   &H00808080&
  45.       TabIndex        =   16
  46.       Top             =   1680
  47.       Value           =   0
  48.       Width           =   2970
  49.    End
  50.    Begin Frame Frame2 
  51.       BackColor       =   &H00C0C0C0&
  52.       Caption         =   "Active Control"
  53.       FontBold        =   -1  'True
  54.       FontItalic      =   0   'False
  55.       FontName        =   "Arial"
  56.       FontSize        =   9.75
  57.       FontStrikethru  =   0   'False
  58.       FontUnderline   =   0   'False
  59.       Height          =   1455
  60.       Left            =   1140
  61.       TabIndex        =   13
  62.       Top             =   1560
  63.       Width           =   2235
  64.       Begin ctRADIO opt_gauge 
  65.          Alignment       =   0  'Left Justify
  66.          BackColor       =   &H00C0C0C0&
  67.          Caption         =   "Gauge Control"
  68.          DisableColor    =   &H00808080&
  69.          FontBold        =   0   'False
  70.          FontItalic      =   0   'False
  71.          FontName        =   "MS Sans Serif"
  72.          FontSize        =   8.25
  73.          FontStrikethru  =   0   'False
  74.          FontUnderline   =   0   'False
  75.          ForeColor       =   &H00000000&
  76.          Height          =   255
  77.          Left            =   240
  78.          PicStyle        =   1  'Style #1
  79.          ShowFocus       =   -1  'True
  80.          TabIndex        =   17
  81.          Top             =   1020
  82.          Value           =   0   'False
  83.          Width           =   1575
  84.       End
  85.       Begin ctRADIO opt_vert 
  86.          Alignment       =   0  'Left Justify
  87.          BackColor       =   &H00C0C0C0&
  88.          Caption         =   "Vertical Meter"
  89.          DisableColor    =   &H00808080&
  90.          FontBold        =   0   'False
  91.          FontItalic      =   0   'False
  92.          FontName        =   "MS Sans Serif"
  93.          FontSize        =   8.25
  94.          FontStrikethru  =   0   'False
  95.          FontUnderline   =   0   'False
  96.          ForeColor       =   &H00000000&
  97.          Height          =   285
  98.          Left            =   240
  99.          PicStyle        =   1  'Style #1
  100.          ShowFocus       =   -1  'True
  101.          TabIndex        =   15
  102.          Top             =   660
  103.          Value           =   0   'False
  104.          Width           =   1785
  105.       End
  106.       Begin ctRADIO opt_horz 
  107.          Alignment       =   0  'Left Justify
  108.          BackColor       =   &H00C0C0C0&
  109.          Caption         =   "Horizontal Meter"
  110.          DisableColor    =   &H00808080&
  111.          FontBold        =   0   'False
  112.          FontItalic      =   0   'False
  113.          FontName        =   "MS Sans Serif"
  114.          FontSize        =   8.25
  115.          FontStrikethru  =   0   'False
  116.          FontUnderline   =   0   'False
  117.          ForeColor       =   &H00000000&
  118.          Height          =   285
  119.          Left            =   240
  120.          PicStyle        =   1  'Style #1
  121.          ShowFocus       =   -1  'True
  122.          TabIndex        =   14
  123.          Top             =   330
  124.          Value           =   -1  'True
  125.          Width           =   1815
  126.       End
  127.    End
  128.    Begin ctCHECK ck_display 
  129.       Alignment       =   0  'Left Justify
  130.       BackColor       =   &H00C0C0C0&
  131.       Caption         =   "Display Text ( Meters Only )"
  132.       DisableColor    =   &H00808080&
  133.       FontBold        =   0   'False
  134.       FontItalic      =   0   'False
  135.       FontName        =   "Arial"
  136.       FontSize        =   9.75
  137.       FontStrikethru  =   0   'False
  138.       FontUnderline   =   0   'False
  139.       ForeColor       =   &H00000000&
  140.       Height          =   285
  141.       Left            =   4080
  142.       PicStyle        =   1  'Style #1
  143.       ShowFocus       =   -1  'True
  144.       TabIndex        =   12
  145.       Top             =   4020
  146.       Value           =   -1  'True
  147.       Width           =   2775
  148.    End
  149.    Begin Frame Frame1 
  150.       BackColor       =   &H00C0C0C0&
  151.       Caption         =   "Border Style"
  152.       FontBold        =   -1  'True
  153.       FontItalic      =   0   'False
  154.       FontName        =   "Arial"
  155.       FontSize        =   9.75
  156.       FontStrikethru  =   0   'False
  157.       FontUnderline   =   0   'False
  158.       Height          =   1365
  159.       Left            =   1140
  160.       TabIndex        =   5
  161.       Top             =   3900
  162.       Width           =   2715
  163.       Begin ctRADIO opt_style 
  164.          Alignment       =   0  'Left Justify
  165.          BackColor       =   &H00C0C0C0&
  166.          Caption         =   "Inset"
  167.          DisableColor    =   &H00808080&
  168.          FontBold        =   0   'False
  169.          FontItalic      =   0   'False
  170.          FontName        =   "MS Sans Serif"
  171.          FontSize        =   8.25
  172.          FontStrikethru  =   0   'False
  173.          FontUnderline   =   0   'False
  174.          ForeColor       =   &H00000000&
  175.          Height          =   285
  176.          Index           =   5
  177.          Left            =   1260
  178.          PicStyle        =   1  'Style #1
  179.          ShowFocus       =   -1  'True
  180.          TabIndex        =   11
  181.          Top             =   960
  182.          Value           =   0   'False
  183.          Width           =   1275
  184.       End
  185.       Begin ctRADIO opt_style 
  186.          Alignment       =   0  'Left Justify
  187.          BackColor       =   &H00C0C0C0&
  188.          Caption         =   "Drop Shadow"
  189.          DisableColor    =   &H00808080&
  190.          FontBold        =   0   'False
  191.          FontItalic      =   0   'False
  192.          FontName        =   "MS Sans Serif"
  193.          FontSize        =   8.25
  194.          FontStrikethru  =   0   'False
  195.          FontUnderline   =   0   'False
  196.          ForeColor       =   &H00000000&
  197.          Height          =   285
  198.          Index           =   4
  199.          Left            =   1260
  200.          PicStyle        =   1  'Style #1
  201.          ShowFocus       =   -1  'True
  202.          TabIndex        =   10
  203.          Top             =   660
  204.          Value           =   0   'False
  205.          Width           =   1365
  206.       End
  207.       Begin ctRADIO opt_style 
  208.          Alignment       =   0  'Left Justify
  209.          BackColor       =   &H00C0C0C0&
  210.          Caption         =   "Lowered"
  211.          DisableColor    =   &H00808080&
  212.          FontBold        =   0   'False
  213.          FontItalic      =   0   'False
  214.          FontName        =   "MS Sans Serif"
  215.          FontSize        =   8.25
  216.          FontStrikethru  =   0   'False
  217.          FontUnderline   =   0   'False
  218.          ForeColor       =   &H00000000&
  219.          Height          =   315
  220.          Index           =   3
  221.          Left            =   1260
  222.          PicStyle        =   1  'Style #1
  223.          ShowFocus       =   -1  'True
  224.          TabIndex        =   9
  225.          Top             =   360
  226.          Value           =   0   'False
  227.          Width           =   1365
  228.       End
  229.       Begin ctRADIO opt_style 
  230.          Alignment       =   0  'Left Justify
  231.          BackColor       =   &H00C0C0C0&
  232.          Caption         =   "Raised"
  233.          DisableColor    =   &H00808080&
  234.          FontBold        =   0   'False
  235.          FontItalic      =   0   'False
  236.          FontName        =   "MS Sans Serif"
  237.          FontSize        =   8.25
  238.          FontStrikethru  =   0   'False
  239.          FontUnderline   =   0   'False
  240.          ForeColor       =   &H00000000&
  241.          Height          =   315
  242.          Index           =   2
  243.          Left            =   180
  244.          PicStyle        =   1  'Style #1
  245.          ShowFocus       =   -1  'True
  246.          TabIndex        =   8
  247.          Top             =   960
  248.          Value           =   -1  'True
  249.          Width           =   1035
  250.       End
  251.       Begin ctRADIO opt_style 
  252.          Alignment       =   0  'Left Justify
  253.          BackColor       =   &H00C0C0C0&
  254.          Caption         =   "None"
  255.          DisableColor    =   &H00808080&
  256.          FontBold        =   0   'False
  257.          FontItalic      =   0   'False
  258.          FontName        =   "MS Sans Serif"
  259.          FontSize        =   8.25
  260.          FontStrikethru  =   0   'False
  261.          FontUnderline   =   0   'False
  262.          ForeColor       =   &H00000000&
  263.          Height          =   285
  264.          Index           =   1
  265.          Left            =   180
  266.          PicStyle        =   1  'Style #1
  267.          ShowFocus       =   -1  'True
  268.          TabIndex        =   7
  269.          Top             =   660
  270.          Value           =   0   'False
  271.          Width           =   1035
  272.       End
  273.       Begin ctRADIO opt_style 
  274.          Alignment       =   0  'Left Justify
  275.          BackColor       =   &H00C0C0C0&
  276.          Caption         =   "Regular"
  277.          DisableColor    =   &H00808080&
  278.          FontBold        =   0   'False
  279.          FontItalic      =   0   'False
  280.          FontName        =   "MS Sans Serif"
  281.          FontSize        =   8.25
  282.          FontStrikethru  =   0   'False
  283.          FontUnderline   =   0   'False
  284.          ForeColor       =   &H00000000&
  285.          Height          =   315
  286.          Index           =   0
  287.          Left            =   180
  288.          PicStyle        =   1  'Style #1
  289.          ShowFocus       =   -1  'True
  290.          TabIndex        =   6
  291.          Top             =   360
  292.          Value           =   0   'False
  293.          Width           =   1035
  294.       End
  295.    End
  296.    Begin ctMETER ctMeter2 
  297.       BackColor       =   &H00E0FFFF&
  298.       BorderColor     =   &H00000000&
  299.       BorderType      =   3  'Lowered
  300.       DisplayText     =   -1  'True
  301.       FontBold        =   -1  'True
  302.       FontItalic      =   0   'False
  303.       FontName        =   "System"
  304.       FontSize        =   9.75
  305.       FontStrikethru  =   0   'False
  306.       FontUnderline   =   0   'False
  307.       ForeColor       =   &H00008080&
  308.       Height          =   4215
  309.       Left            =   300
  310.       MaxValue        =   100
  311.       MeterStyle      =   1  'Vertical
  312.       MinValue        =   0
  313.       ShadowColor     =   &H00808080&
  314.       TabIndex        =   4
  315.       Top             =   1080
  316.       Value           =   50
  317.       Width           =   585
  318.    End
  319.    Begin HScrollBar HScroll1 
  320.       Height          =   240
  321.       LargeChange     =   5
  322.       Left            =   1140
  323.       Max             =   100
  324.       TabIndex        =   2
  325.       Top             =   3180
  326.       Value           =   50
  327.       Width           =   2235
  328.    End
  329.    Begin CommandButton Command1 
  330.       Caption         =   "E&xit"
  331.       Height          =   345
  332.       Left            =   6060
  333.       TabIndex        =   1
  334.       Top             =   4920
  335.       Width           =   915
  336.    End
  337.    Begin ctMETER ctMeter1 
  338.       BackColor       =   &H00FFFFFF&
  339.       BorderColor     =   &H00000000&
  340.       BorderType      =   2  'Raised
  341.       DisplayText     =   -1  'True
  342.       FontBold        =   -1  'True
  343.       FontItalic      =   -1  'True
  344.       FontName        =   "Times New Roman"
  345.       FontSize        =   12
  346.       FontStrikethru  =   0   'False
  347.       FontUnderline   =   0   'False
  348.       ForeColor       =   &H00FF0000&
  349.       Height          =   375
  350.       Left            =   1140
  351.       MaxValue        =   100
  352.       MeterStyle      =   0  'Horizontal
  353.       MinValue        =   0
  354.       ShadowColor     =   &H00808080&
  355.       TabIndex        =   0
  356.       Top             =   1080
  357.       Value           =   50
  358.       Width           =   5595
  359.    End
  360.    Begin Label Label2 
  361.       Alignment       =   2  'Center
  362.       BackStyle       =   0  'Transparent
  363.       Caption         =   "The ctMETER and ctGAUGE controls offer a way to view a numeric value in a visual manner. The ctGAUGE control is able to use any valid bitmap as its background. All needle properties, including size, color, starting and ending angle, and thickness can be set by the programmer."
  364.       ForeColor       =   &H00800000&
  365.       Height          =   855
  366.       Left            =   240
  367.       TabIndex        =   18
  368.       Top             =   120
  369.       Width           =   6735
  370.    End
  371.    Begin Label Label1 
  372.       BackStyle       =   0  'Transparent
  373.       Caption         =   "Move scroll bar to adjust the control"
  374.       FontBold        =   0   'False
  375.       FontItalic      =   0   'False
  376.       FontName        =   "Arial"
  377.       FontSize        =   8.25
  378.       FontStrikethru  =   0   'False
  379.       FontUnderline   =   0   'False
  380.       ForeColor       =   &H00800000&
  381.       Height          =   435
  382.       Left            =   1020
  383.       TabIndex        =   3
  384.       Top             =   3540
  385.       Width           =   2595
  386.    End
  387. End
  388. Sub ck_display_Click ()
  389.    If opt_horz.Value = True Then
  390.       ctmeter1.DisplayText = ck_display.Value
  391.    Else
  392.       ctmeter2.DisplayText = ck_display.Value
  393.    End If
  394. End Sub
  395.  
  396. Sub Command1_Click ()
  397.    Unload w_ctmeter
  398. End Sub
  399.  
  400. Sub Form_Load ()
  401.    ' Center the window on the screen
  402.    Move (Screen.Width - Width) / 2, (Screen.Height - Height) * .25
  403.  
  404.    w_mdi_main.bt_meter = BUTTON_DISABLE
  405. End Sub
  406.  
  407. Sub Form_Unload (Cancel As Integer)
  408.    w_mdi_main.bt_meter = BUTTON_UP
  409. End Sub
  410.  
  411. Sub HScroll1_Change ()
  412.    If opt_horz.Value = True Then
  413.       ctmeter1.Value = HScroll1.Value
  414.    ElseIf opt_vert.Value = True Then
  415.       ctmeter2.Value = HScroll1.Value
  416.    Else
  417.       ctgauge1.Value = HScroll1.Value
  418.    End If
  419. End Sub
  420.  
  421. Sub HScroll1_Scroll ()
  422.    If opt_horz.Value = True Then
  423.       ctmeter1.Value = HScroll1.Value
  424.    ElseIf opt_vert.Value = True Then
  425.       ctmeter2.Value = HScroll1.Value
  426.    Else
  427.       ctgauge1.Value = HScroll1.Value
  428.    End If
  429. End Sub
  430.  
  431. Sub opt_gauge_Click ()
  432.    ' Set the style buttons
  433.    opt_style(ctgauge1.BorderType) = True
  434.  
  435.    ' Set the display text button
  436.    ck_display.Enabled = False
  437.  
  438.    ' Set the scroll bar
  439.    HScroll1.Value = ctgauge1.Value
  440. End Sub
  441.  
  442. Sub opt_horz_Click ()
  443.    ' Set the style buttons
  444.    opt_style(ctmeter1.BorderType) = True
  445.  
  446.    ' Set the Diplay text box
  447.    ck_display.Enabled = True
  448.    ck_display.Value = ctmeter1.DisplayText
  449.    
  450.    ' Set the scroll bar
  451.    HScroll1.Value = ctmeter1.Value
  452. End Sub
  453.  
  454. Sub opt_style_Click (Index As Integer)
  455.    If opt_horz.Value = True Then
  456.       ctmeter1.BorderType = Index
  457.    ElseIf opt_vert.Value = True Then
  458.       ctmeter2.BorderType = Index
  459.    Else
  460.       ctgauge1.BorderType = Index
  461.    End If
  462. End Sub
  463.  
  464. Sub opt_vert_Click ()
  465.    ' Set the style buttons
  466.    opt_style(ctmeter2.BorderType) = True
  467.  
  468.    ' Set the display text button
  469.    ck_display.Enabled = True
  470.    ck_display.Value = ctmeter2.DisplayText
  471.  
  472.    ' Set the scroll bar
  473.    HScroll1.Value = ctmeter2.Value
  474. End Sub
  475.  
  476.