home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / tool / various / ctdemo / ct_slide.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-02-26  |  12.0 KB  |  373 lines

  1. VERSION 2.00
  2. Begin Form w_ctslide_demo 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "ctSLIDE (Slider Control) Demo"
  6.    ClientHeight    =   5580
  7.    ClientLeft      =   105
  8.    ClientTop       =   945
  9.    ClientWidth     =   9330
  10.    Height          =   6105
  11.    Icon            =   CT_SLIDE.FRX:0000
  12.    Left            =   45
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MDIChild        =   -1  'True
  16.    ScaleHeight     =   5580
  17.    ScaleWidth      =   9330
  18.    Top             =   480
  19.    Width           =   9450
  20.    Begin ctTEXT lbl_time 
  21.       Alignment       =   0  'Left Justified
  22.       BackColor       =   &H00FFFFFF&
  23.       BorderColor     =   &H00000000&
  24.       BorderType      =   3  'Lowered
  25.       Caption         =   "12:00 PM"
  26.       FontBold        =   0   'False
  27.       FontItalic      =   0   'False
  28.       FontName        =   "MS Sans Serif"
  29.       FontSize        =   8.25
  30.       FontStrikethru  =   0   'False
  31.       FontUnderline   =   0   'False
  32.       ForeColor       =   &H00000000&
  33.       Height          =   375
  34.       Left            =   7140
  35.       PicPosition     =   0  'Center
  36.       ShadowColor     =   &H00000000&
  37.       SingleLine      =   -1  'True
  38.       TabIndex        =   1
  39.       TextAngle       =   0
  40.       TextPosition    =   1  'Center
  41.       ThreeDColor     =   &H00808080&
  42.       ThreeDText      =   0   'False
  43.       Top             =   2160
  44.       Width           =   1095
  45.    End
  46.    Begin ctGROUP ctGroup1 
  47.       Alignment       =   0  'Left
  48.       BackColor       =   &H00C0C0C0&
  49.       BorderColor     =   &H00808080&
  50.       BorderType      =   4  'Lowered Inset
  51.       Caption         =   "Time"
  52.       ForeColor       =   &H00000000&
  53.       Height          =   1095
  54.       Left            =   3600
  55.       TabIndex        =   10
  56.       TextPosition    =   0  'Top
  57.       Top             =   1560
  58.       Width           =   1695
  59.       Begin ctRADIO rb_pm 
  60.          Alignment       =   0  'Left Justify
  61.          BackColor       =   &H00C0C0C0&
  62.          Caption         =   "P.M."
  63.          DisableColor    =   &H00808080&
  64.          ForeColor       =   &H00000000&
  65.          Height          =   255
  66.          Left            =   240
  67.          PicStyle        =   2  'Style #2
  68.          ShowFocus       =   -1  'True
  69.          TabIndex        =   12
  70.          Top             =   660
  71.          Value           =   -1  'True
  72.          Width           =   915
  73.       End
  74.       Begin ctRADIO rb_am 
  75.          Alignment       =   0  'Left Justify
  76.          BackColor       =   &H00C0C0C0&
  77.          Caption         =   "A.M."
  78.          DisableColor    =   &H00808080&
  79.          ForeColor       =   &H00000000&
  80.          Height          =   255
  81.          Left            =   240
  82.          PicStyle        =   2  'Style #2
  83.          ShowFocus       =   -1  'True
  84.          TabIndex        =   11
  85.          Top             =   300
  86.          Value           =   0   'False
  87.          Width           =   915
  88.       End
  89.    End
  90.    Begin ctSLIDE ctSlide1 
  91.       BackColor       =   &H00C0C0C0&
  92.       BorderColor     =   &H00000000&
  93.       FontBold        =   -1  'True
  94.       FontItalic      =   0   'False
  95.       FontName        =   "Times New Roman"
  96.       FontSize        =   8.25
  97.       FontStrikethru  =   0   'False
  98.       FontUnderline   =   0   'False
  99.       ForeColor       =   &H00800000&
  100.       Height          =   735
  101.       InnerBorder     =   3  'Lowered
  102.       InnerBottom     =   14
  103.       InnerColor      =   &H00E0FFFF&
  104.       InnerLeft       =   10
  105.       InnerRight      =   10
  106.       InnerTop        =   9
  107.       KeyMove         =   1
  108.       Left            =   180
  109.       MaxValue        =   144
  110.       MinValue        =   0
  111.       OuterBorder     =   0  'Regular
  112.       PageMove        =   5
  113.       ShowDivisions   =   4
  114.       ShowIncrement   =   1
  115.       ShowMax         =   12
  116.       ShowMin         =   0
  117.       ShowMultiply    =   1
  118.       SliderOffset    =   2
  119.       SliderStyle     =   0  'Horizontal
  120.       SliderType      =   1  'Ruler
  121.       TabIndex        =   3
  122.       ThumbHorz       =   0
  123.       ThumbStyle      =   1  'Pointer #1
  124.       ThumbVert       =   19
  125.       Top             =   660
  126.       Value           =   0
  127.       Width           =   8955
  128.    End
  129.    Begin ctSLIDE ctSlide_blue 
  130.       BackColor       =   &H00C0C0C0&
  131.       BorderColor     =   &H00000000&
  132.       ForeColor       =   &H00FFFFFF&
  133.       Height          =   3915
  134.       InnerBorder     =   3  'Lowered
  135.       InnerBottom     =   10
  136.       InnerColor      =   &H00FF0000&
  137.       InnerLeft       =   10
  138.       InnerRight      =   10
  139.       InnerTop        =   10
  140.       KeyMove         =   1
  141.       Left            =   2040
  142.       MaxValue        =   255
  143.       MinValue        =   0
  144.       OuterBorder     =   2  'Raised
  145.       PageMove        =   5
  146.       ShowDivisions   =   4
  147.       ShowIncrement   =   1
  148.       ShowMax         =   4
  149.       ShowMin         =   0
  150.       ShowMultiply    =   64
  151.       SliderOffset    =   8
  152.       SliderStyle     =   1  'Vertical
  153.       SliderType      =   1  'Ruler
  154.       TabIndex        =   4
  155.       ThumbHorz       =   0
  156.       ThumbStyle      =   0  'Regular
  157.       ThumbVert       =   0
  158.       Top             =   1560
  159.       Value           =   0
  160.       Width           =   795
  161.    End
  162.    Begin ctSLIDE ctSlide_green 
  163.       BackColor       =   &H00C0C0C0&
  164.       BorderColor     =   &H00000000&
  165.       ForeColor       =   &H00000000&
  166.       Height          =   3915
  167.       InnerBorder     =   3  'Lowered
  168.       InnerBottom     =   10
  169.       InnerColor      =   &H0000FF00&
  170.       InnerLeft       =   10
  171.       InnerRight      =   10
  172.       InnerTop        =   10
  173.       KeyMove         =   1
  174.       Left            =   1140
  175.       MaxValue        =   255
  176.       MinValue        =   0
  177.       OuterBorder     =   2  'Raised
  178.       PageMove        =   5
  179.       ShowDivisions   =   4
  180.       ShowIncrement   =   1
  181.       ShowMax         =   4
  182.       ShowMin         =   0
  183.       ShowMultiply    =   64
  184.       SliderOffset    =   8
  185.       SliderStyle     =   1  'Vertical
  186.       SliderType      =   1  'Ruler
  187.       TabIndex        =   9
  188.       ThumbHorz       =   0
  189.       ThumbStyle      =   0  'Regular
  190.       ThumbVert       =   0
  191.       Top             =   1560
  192.       Value           =   0
  193.       Width           =   795
  194.    End
  195.    Begin ctSLIDE ctSlide_red 
  196.       BackColor       =   &H00C0C0C0&
  197.       BorderColor     =   &H00000000&
  198.       ForeColor       =   &H00FFFFFF&
  199.       Height          =   3945
  200.       InnerBorder     =   3  'Lowered
  201.       InnerBottom     =   10
  202.       InnerColor      =   &H000000FF&
  203.       InnerLeft       =   10
  204.       InnerRight      =   10
  205.       InnerTop        =   10
  206.       KeyMove         =   1
  207.       Left            =   240
  208.       MaxValue        =   255
  209.       MinValue        =   0
  210.       OuterBorder     =   2  'Raised
  211.       PageMove        =   5
  212.       ShowDivisions   =   4
  213.       ShowIncrement   =   1
  214.       ShowMax         =   4
  215.       ShowMin         =   0
  216.       ShowMultiply    =   64
  217.       SliderOffset    =   8
  218.       SliderStyle     =   1  'Vertical
  219.       SliderType      =   1  'Ruler
  220.       TabIndex        =   8
  221.       ThumbHorz       =   0
  222.       ThumbStyle      =   0  'Regular
  223.       ThumbVert       =   0
  224.       Top             =   1560
  225.       Value           =   0
  226.       Width           =   795
  227.    End
  228.    Begin ctFRAME uo_color 
  229.       BackColor       =   &H00000000&
  230.       BorderColor     =   &H00FFFFFF&
  231.       DistanceApart   =   5
  232.       Height          =   1155
  233.       InnerBorder     =   1  'None
  234.       InnerWidth      =   1
  235.       Left            =   3300
  236.       OuterBorder     =   0  'Regular
  237.       OuterWidth      =   1
  238.       ShadowColor     =   &H00808080&
  239.       ShowBottom      =   -1  'True
  240.       ShowLeft        =   -1  'True
  241.       ShowRight       =   -1  'True
  242.       ShowTop         =   -1  'True
  243.       TabIndex        =   7
  244.       Top             =   3360
  245.       Width           =   1935
  246.    End
  247.    Begin CommandButton Command1 
  248.       Caption         =   "E&xit"
  249.       Height          =   375
  250.       Left            =   7920
  251.       TabIndex        =   6
  252.       Top             =   5040
  253.       Width           =   855
  254.    End
  255.    Begin Label Label5 
  256.       BackStyle       =   0  'Transparent
  257.       Caption         =   "The Slider Control uses a ""SlideChange"" event to determine then the sliders value has changed. This offers an easy way to run a script as the user moves the thumb control."
  258.       FontBold        =   0   'False
  259.       FontItalic      =   0   'False
  260.       FontName        =   "MS Sans Serif"
  261.       FontSize        =   9.75
  262.       FontStrikethru  =   0   'False
  263.       FontUnderline   =   0   'False
  264.       Height          =   1515
  265.       Left            =   5760
  266.       TabIndex        =   14
  267.       Top             =   3240
  268.       Width           =   2895
  269.    End
  270.    Begin Label Label2 
  271.       BackStyle       =   0  'Transparent
  272.       Caption         =   "Time Selected :"
  273.       Height          =   255
  274.       Left            =   5700
  275.       TabIndex        =   2
  276.       Top             =   2220
  277.       Width           =   1455
  278.    End
  279.    Begin Label Label1 
  280.       BackColor       =   &H00C0C0C0&
  281.       Caption         =   "Move the thumb to change the selected time"
  282.       FontBold        =   0   'False
  283.       FontItalic      =   0   'False
  284.       FontName        =   "MS Sans Serif"
  285.       FontSize        =   8.25
  286.       FontStrikethru  =   0   'False
  287.       FontUnderline   =   0   'False
  288.       ForeColor       =   &H00800000&
  289.       Height          =   435
  290.       Left            =   5580
  291.       TabIndex        =   13
  292.       Top             =   1680
  293.       Width           =   2295
  294.    End
  295.    Begin Label Label4 
  296.       Alignment       =   2  'Center
  297.       BackColor       =   &H00C0C0C0&
  298.       Caption         =   "The ctSLIDE VBX is a slider control. It can be set up horizontally or vertically. It comes with pre-defined background styles, and thumbs, or the programmer can replace either with a bitmap image."
  299.       ForeColor       =   &H00800000&
  300.       Height          =   435
  301.       Left            =   180
  302.       TabIndex        =   5
  303.       Top             =   120
  304.       Width           =   8895
  305.    End
  306.    Begin Label Label3 
  307.       BackColor       =   &H00C0C0C0&
  308.       Caption         =   "Click on any of the thumbs and then adjust the slider control to change the box color"
  309.       FontBold        =   0   'False
  310.       FontItalic      =   0   'False
  311.       FontName        =   "MS Sans Serif"
  312.       FontSize        =   8.25
  313.       FontStrikethru  =   0   'False
  314.       FontUnderline   =   0   'False
  315.       Height          =   675
  316.       Left            =   3180
  317.       TabIndex        =   0
  318.       Top             =   4680
  319.       Width           =   2235
  320.    End
  321. Sub Command1_Click ()
  322.    Unload w_ctslide_demo
  323. End Sub
  324. Sub ctSlide_Blue_SlideChange ()
  325.    uo_color.BackColor = RGB(ctslide_red, ctslide_green, ctslide_blue)
  326. End Sub
  327. Sub ctSlide_Green_SlideChange ()
  328.    uo_color.BackColor = RGB(ctslide_red, ctslide_green, ctslide_blue)
  329. End Sub
  330. Sub ctSlide_Red_SlideChange ()
  331.    uo_color.BackColor = RGB(ctslide_red, ctslide_green, ctslide_blue)
  332. End Sub
  333. Sub ctSlide1_SlideChange ()
  334.    settime
  335. End Sub
  336. Sub Form_Load ()
  337.    ' Center the window on the screen
  338.    Move (Screen.Width - Width) / 2, (Screen.Height - Height) * .15
  339.    w_mdi_main.bt_slide = BUTTON_DISABLE
  340. End Sub
  341. Sub Form_Unload (Cancel As Integer)
  342.    w_mdi_main.bt_slide = BUTTON_UP
  343. End Sub
  344. Sub rb_am_Click ()
  345.    settime
  346. End Sub
  347. Sub rb_pm_Click ()
  348.    settime
  349. End Sub
  350. Sub settime ()
  351. Dim cHour As String
  352. Dim cMin As String
  353. Dim cTime As String
  354. Dim nHour  As Integer
  355. Dim nMin As Integer
  356. nHour = Int(ctSlide1.Value / 12)
  357. nMin = (ctSlide1.Value Mod 12) * 5
  358. If nHour = 0 Then
  359.    cHour = "12"
  360.    cHour = Str(nHour)
  361. End If
  362. cMin = Right$("00" + Trim$(Str$(nMin)), 2)
  363. If (ctSlide1.Value = 144 And Not rb_pm) Then
  364.    cTime = "P.M."
  365. ElseIf (ctSlide1.Value = 144 And rb_pm) Then
  366.    cTime = "A.M."
  367. ElseIf (rb_pm) Then
  368.    cTime = "P.M."
  369.    cTime = "A.M."
  370. End If
  371. lbl_time.Caption = (cHour + ":" + cMin + " " + cTime)
  372. End Sub
  373.