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

  1. VERSION 2.00
  2. Begin Form w_clock_demo 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "ctCLOCK (Clock Control) Demo"
  6.    ClientHeight    =   5520
  7.    ClientLeft      =   285
  8.    ClientTop       =   1095
  9.    ClientWidth     =   9135
  10.    Height          =   6045
  11.    Icon            =   CT_CLOCK.FRX:0000
  12.    Left            =   225
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MDIChild        =   -1  'True
  16.    ScaleHeight     =   5520
  17.    ScaleWidth      =   9135
  18.    Top             =   630
  19.    Width           =   9255
  20.    Begin CommandButton Command2 
  21.       Caption         =   "Set Alarm"
  22.       Height          =   315
  23.       Left            =   3360
  24.       TabIndex        =   13
  25.       Top             =   1680
  26.       Width           =   1515
  27.    End
  28.    Begin CommandButton Command1 
  29.       Caption         =   "E&xit"
  30.       Height          =   435
  31.       Left            =   3540
  32.       TabIndex        =   11
  33.       Top             =   4800
  34.       Width           =   1035
  35.    End
  36.    Begin ctCHECK ctCheck3 
  37.       Alignment       =   0  'Left Justify
  38.       BackColor       =   &H00C0C0C0&
  39.       Caption         =   "Include AM/PM"
  40.       DisableColor    =   &H00808080&
  41.       ForeColor       =   &H00000000&
  42.       Height          =   315
  43.       Left            =   3240
  44.       PicStyle        =   1  'Style #1
  45.       ShowFocus       =   -1  'True
  46.       TabIndex        =   10
  47.       Top             =   3420
  48.       Value           =   -1  'True
  49.       Width           =   1695
  50.    End
  51.    Begin ctGROUP ctGroup1 
  52.       Alignment       =   0  'Left
  53.       BackColor       =   &H00C0C0C0&
  54.       BorderColor     =   &H00808080&
  55.       BorderType      =   4  'Lowered Inset
  56.       Caption         =   "Clock Type"
  57.       ForeColor       =   &H00000000&
  58.       Height          =   1155
  59.       Left            =   540
  60.       TabIndex        =   6
  61.       TextPosition    =   0  'Top
  62.       Top             =   3900
  63.       Width           =   1815
  64.       Begin ctRADIO ctRadio2 
  65.          Alignment       =   0  'Left Justify
  66.          BackColor       =   &H00C0C0C0&
  67.          Caption         =   "Analog"
  68.          DisableColor    =   &H00808080&
  69.          ForeColor       =   &H00000000&
  70.          Height          =   255
  71.          Left            =   120
  72.          PicStyle        =   1  'Style #1
  73.          ShowFocus       =   -1  'True
  74.          TabIndex        =   8
  75.          Top             =   720
  76.          Value           =   0   'False
  77.          Width           =   1395
  78.       End
  79.       Begin ctRADIO ctRadio1 
  80.          Alignment       =   0  'Left Justify
  81.          BackColor       =   &H00C0C0C0&
  82.          Caption         =   "Digital"
  83.          DisableColor    =   &H00808080&
  84.          ForeColor       =   &H00000000&
  85.          Height          =   255
  86.          Left            =   120
  87.          PicStyle        =   1  'Style #1
  88.          ShowFocus       =   -1  'True
  89.          TabIndex        =   7
  90.          Top             =   360
  91.          Value           =   -1  'True
  92.          Width           =   1395
  93.       End
  94.    End
  95.    Begin ctCHECK ctCheck2 
  96.       Alignment       =   0  'Left Justify
  97.       BackColor       =   &H00C0C0C0&
  98.       Caption         =   "Include Second"
  99.       DisableColor    =   &H00808080&
  100.       ForeColor       =   &H00000000&
  101.       Height          =   315
  102.       Left            =   3240
  103.       PicStyle        =   1  'Style #1
  104.       ShowFocus       =   -1  'True
  105.       TabIndex        =   5
  106.       Top             =   3120
  107.       Value           =   -1  'True
  108.       Width           =   1695
  109.    End
  110.    Begin ctCHECK ctCheck1 
  111.       Alignment       =   0  'Left Justify
  112.       BackColor       =   &H00C0C0C0&
  113.       Caption         =   "Military Time "
  114.       DisableColor    =   &H00808080&
  115.       ForeColor       =   &H00000000&
  116.       Height          =   315
  117.       Left            =   3240
  118.       PicStyle        =   1  'Style #1
  119.       ShowFocus       =   -1  'True
  120.       TabIndex        =   4
  121.       Top             =   2820
  122.       Value           =   0   'False
  123.       Width           =   1695
  124.    End
  125.    Begin ctCLOCK ctClock2 
  126.       Action          =   0
  127.       AlarmHour       =   -1
  128.       AlarmMinute     =   -1
  129.       AlarmSecond     =   -1
  130.       BackColor       =   &H00C0C0C0&
  131.       BorderColor     =   &H00000000&
  132.       BorderType      =   1  'None
  133.       ClockColor      =   &H00FFFFFF&
  134.       ClockType       =   1  'Analog
  135.       ClockXOffset    =   0
  136.       ClockYOffset    =   0
  137.       CurrentHour     =   1
  138.       CurrentMinute   =   50
  139.       CurrentSecond   =   32
  140.       FontBold        =   -1  'True
  141.       FontItalic      =   0   'False
  142.       FontName        =   "Times New Roman"
  143.       FontSize        =   18
  144.       FontStrikethru  =   0   'False
  145.       FontUnderline   =   0   'False
  146.       ForeColor       =   &H00000080&
  147.       Height          =   3015
  148.       HourColor       =   &H00FF0000&
  149.       HourSize        =   0
  150.       IncludeAmPm     =   -1  'True
  151.       IncludeSeconds  =   0   'False
  152.       Left            =   5580
  153.       MilitaryTime    =   0   'False
  154.       MinuteColor     =   &H00800000&
  155.       MinuteSize      =   0
  156.       NumberOffset    =   12
  157.       SecondColor     =   &H00000000&
  158.       SecondSize      =   0
  159.       SetHour         =   0
  160.       SetMinute       =   0
  161.       SetSecond       =   0
  162.       StartTimer      =   0   'False
  163.       TabIndex        =   1
  164.       TimeType        =   1  'Set by Mouse
  165.       Top             =   900
  166.       Width           =   3015
  167.    End
  168.    Begin ctCLOCK ctClock1 
  169.       Action          =   0
  170.       AlarmHour       =   -1
  171.       AlarmMinute     =   -1
  172.       AlarmSecond     =   -1
  173.       BackColor       =   &H00E0FFFF&
  174.       BorderColor     =   &H00000000&
  175.       BorderType      =   3  'Lowered
  176.       ClockColor      =   &H00FFFFFF&
  177.       ClockType       =   0  'Digital
  178.       ClockXOffset    =   0
  179.       ClockYOffset    =   0
  180.       CurrentHour     =   21
  181.       CurrentMinute   =   10
  182.       CurrentSecond   =   17
  183.       FontBold        =   0   'False
  184.       FontItalic      =   0   'False
  185.       FontName        =   "Arial"
  186.       FontSize        =   18
  187.       FontStrikethru  =   0   'False
  188.       FontUnderline   =   0   'False
  189.       ForeColor       =   &H00000000&
  190.       Height          =   2535
  191.       HourColor       =   &H00000000&
  192.       HourSize        =   0
  193.       IncludeAmPm     =   -1  'True
  194.       IncludeSeconds  =   -1  'True
  195.       Left            =   420
  196.       MilitaryTime    =   0   'False
  197.       MinuteColor     =   &H00000000&
  198.       MinuteSize      =   0
  199.       NumberOffset    =   8
  200.       SecondColor     =   &H00800000&
  201.       SecondSize      =   0
  202.       SetHour         =   0
  203.       SetMinute       =   0
  204.       SetSecond       =   0
  205.       StartTimer      =   -1  'True
  206.       TabIndex        =   0
  207.       TimeType        =   0  'Current Time
  208.       Top             =   1140
  209.       Width           =   2715
  210.    End
  211.    Begin Label Label3 
  212.       Alignment       =   2  'Center
  213.       BackStyle       =   0  'Transparent
  214.       Caption         =   "Set alarm for three seconds from now"
  215.       FontBold        =   0   'False
  216.       FontItalic      =   0   'False
  217.       FontName        =   "MS Sans Serif"
  218.       FontSize        =   8.25
  219.       FontStrikethru  =   0   'False
  220.       FontUnderline   =   0   'False
  221.       Height          =   375
  222.       Left            =   3240
  223.       TabIndex        =   12
  224.       Top             =   1200
  225.       Width           =   1695
  226.    End
  227.    Begin Label lbl_time 
  228.       Alignment       =   2  'Center
  229.       BackColor       =   &H00FFFFFF&
  230.       BorderStyle     =   1  'Fixed Single
  231.       Caption         =   "1:50"
  232.       FontBold        =   -1  'True
  233.       FontItalic      =   0   'False
  234.       FontName        =   "MS Sans Serif"
  235.       FontSize        =   12
  236.       FontStrikethru  =   0   'False
  237.       FontUnderline   =   0   'False
  238.       ForeColor       =   &H00000000&
  239.       Height          =   315
  240.       Left            =   6480
  241.       TabIndex        =   9
  242.       Top             =   4080
  243.       Width           =   1275
  244.    End
  245.    Begin Label Label2 
  246.       Alignment       =   2  'Center
  247.       BackStyle       =   0  'Transparent
  248.       Caption         =   "The control above has been set up to accept a new time from a mouse click. Clicking the control with the left button will change the minute hand. Clicking the control with the right button will change the hour hand."
  249.       FontBold        =   0   'False
  250.       FontItalic      =   0   'False
  251.       FontName        =   "MS Sans Serif"
  252.       FontSize        =   8.25
  253.       FontStrikethru  =   0   'False
  254.       FontUnderline   =   0   'False
  255.       ForeColor       =   &H00800000&
  256.       Height          =   795
  257.       Left            =   5100
  258.       TabIndex        =   3
  259.       Top             =   4500
  260.       Width           =   3915
  261.    End
  262.    Begin Label Label1 
  263.       Alignment       =   2  'Center
  264.       BackColor       =   &H00C0C0C0&
  265.       BackStyle       =   0  'Transparent
  266.       Caption         =   "The ctCLOCK VBX is a control that lets the user view and set the time in a visual manner. The control comes with a variety of options that allow the programmer to change the look and feel of the controls. This includes the ability to provide a bitmap image for the controls background."
  267.       ForeColor       =   &H00800000&
  268.       Height          =   615
  269.       Left            =   240
  270.       TabIndex        =   2
  271.       Top             =   180
  272.       Width           =   8415
  273.    End
  274. End
  275. Sub Command1_Click ()
  276.    Unload w_clock_demo
  277. End Sub
  278.  
  279. Sub Command2_Click ()
  280.    ctClock1.AlarmHour = ctClock1.CurrentHour
  281.    ctClock1.AlarmMinute = ctClock1.CurrentMinute
  282.    ctClock1.AlarmSecond = ctClock1.CurrentSecond + 3
  283.  
  284.    If (ctClock1.CurrentSecond + 3 >= 60) Then
  285.       ctClock1.AlarmMinute = ctClock1.CurrentMinute + 1
  286.    End If
  287. End Sub
  288.  
  289. Sub ctCheck1_Click ()
  290.    ctClock1.MilitaryTime = ctCheck1.Value
  291. End Sub
  292.  
  293. Sub ctCheck2_Click ()
  294.    ctClock1.IncludeSeconds = ctCheck2.Value
  295. End Sub
  296.  
  297. Sub ctCheck3_Click ()
  298.    ctClock1.IncludeAmPm = ctCheck3.Value
  299. End Sub
  300.  
  301. Sub ctClock2_TimeChange (nHour As Integer, nMinute As Integer, nSecond As Integer)
  302.    Dim cTime As String
  303.  
  304.    If nHour = 0 Then
  305.       cTime = "12" + ":"
  306.    Else
  307.       cTime = Str(nHour) + ":"
  308.    End If
  309.  
  310.    If (nMinute < 10) Then
  311.       cTime = cTime + "0"
  312.    End If
  313.  
  314.    lbl_time.Caption = cTime + LTrim(Str(nMinute))
  315. End Sub
  316.  
  317. Sub ctRadio1_Click ()
  318.    ctClock1.ClockType = 0
  319.    ctClock1.FontSize = 18
  320. End Sub
  321.  
  322. Sub ctRadio2_Click ()
  323.    ctClock1.ClockType = 1
  324.    ctClock1.FontSize = 8
  325. End Sub
  326.  
  327. Sub Form_Load ()
  328.    ' Center the window on the screen
  329.    Move (Screen.Width - Width) / 2, (Screen.Height - Height) * .25
  330.  
  331.    w_mdi_main.bt_clock = BUTTON_DISABLE
  332. End Sub
  333.  
  334. Sub Form_Unload (Cancel As Integer)
  335.    w_mdi_main.bt_clock = BUTTON_UP
  336. End Sub
  337.  
  338.