home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 5 Developer's Kit / vb5 dev kit.iso / dev / ct_ocx / ct_push.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-12-31  |  14.0 KB  |  459 lines

  1. VERSION 4.00
  2. Begin VB.Form w_push_demo 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "ctPush (Enhanced Push Button) Demo"
  5.    ClientHeight    =   5400
  6.    ClientLeft      =   1140
  7.    ClientTop       =   1770
  8.    ClientWidth     =   7800
  9.    Height          =   5805
  10.    Icon            =   "ct_push.frx":0000
  11.    Left            =   1080
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MDIChild        =   -1  'True
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   5400
  17.    ScaleWidth      =   7800
  18.    ShowInTaskbar   =   0   'False
  19.    Top             =   1425
  20.    Width           =   7920
  21.    Begin VB.CheckBox Check4 
  22.       Caption         =   "Draw Focus"
  23.       BeginProperty Font 
  24.          name            =   "MS Sans Serif"
  25.          charset         =   0
  26.          weight          =   700
  27.          size            =   8.25
  28.          underline       =   0   'False
  29.          italic          =   0   'False
  30.          strikethrough   =   0   'False
  31.       EndProperty
  32.       Height          =   255
  33.       Left            =   420
  34.       TabIndex        =   17
  35.       Top             =   3840
  36.       Value           =   1  'Checked
  37.       Width           =   1635
  38.    End
  39.    Begin VB.Frame Frame2 
  40.       Caption         =   "Windows Style"
  41.       BeginProperty Font 
  42.          name            =   "MS Sans Serif"
  43.          charset         =   0
  44.          weight          =   700
  45.          size            =   8.25
  46.          underline       =   0   'False
  47.          italic          =   0   'False
  48.          strikethrough   =   0   'False
  49.       EndProperty
  50.       Height          =   915
  51.       Left            =   2340
  52.       TabIndex        =   6
  53.       Top             =   2880
  54.       Width           =   2595
  55.       Begin VB.OptionButton Option6 
  56.          Caption         =   "Win 95"
  57.          Height          =   375
  58.          Left            =   1440
  59.          TabIndex        =   12
  60.          Top             =   360
  61.          Value           =   -1  'True
  62.          Width           =   855
  63.       End
  64.       Begin VB.OptionButton Option5 
  65.          Caption         =   "Win 3.1"
  66.          Height          =   255
  67.          Left            =   240
  68.          TabIndex        =   11
  69.          Top             =   420
  70.          Width           =   1095
  71.       End
  72.    End
  73.    Begin VB.Frame Frame1 
  74.       Caption         =   "Picture Position"
  75.       BeginProperty Font 
  76.          name            =   "MS Sans Serif"
  77.          charset         =   0
  78.          weight          =   700
  79.          size            =   8.25
  80.          underline       =   0   'False
  81.          italic          =   0   'False
  82.          strikethrough   =   0   'False
  83.       EndProperty
  84.       Height          =   1395
  85.       Left            =   2340
  86.       TabIndex        =   5
  87.       Top             =   1140
  88.       Width           =   2595
  89.       Begin VB.OptionButton Option4 
  90.          Caption         =   "Right"
  91.          Height          =   315
  92.          Left            =   1440
  93.          TabIndex        =   10
  94.          Top             =   840
  95.          Width           =   975
  96.       End
  97.       Begin VB.OptionButton Option3 
  98.          Caption         =   "Left"
  99.          Height          =   315
  100.          Left            =   1440
  101.          TabIndex        =   9
  102.          Top             =   360
  103.          Value           =   -1  'True
  104.          Width           =   975
  105.       End
  106.       Begin VB.OptionButton Option2 
  107.          Caption         =   "Bottom"
  108.          Height          =   315
  109.          Left            =   240
  110.          TabIndex        =   8
  111.          Top             =   840
  112.          Width           =   915
  113.       End
  114.       Begin VB.OptionButton Option1 
  115.          Caption         =   "Top"
  116.          Height          =   315
  117.          Left            =   240
  118.          TabIndex        =   7
  119.          Top             =   360
  120.          Width           =   795
  121.       End
  122.    End
  123.    Begin VB.CheckBox Check3 
  124.       Caption         =   "Expand Picture"
  125.       BeginProperty Font 
  126.          name            =   "MS Sans Serif"
  127.          charset         =   0
  128.          weight          =   700
  129.          size            =   8.25
  130.          underline       =   0   'False
  131.          italic          =   0   'False
  132.          strikethrough   =   0   'False
  133.       EndProperty
  134.       Height          =   315
  135.       Left            =   420
  136.       TabIndex        =   4
  137.       Top             =   3480
  138.       Width           =   1755
  139.    End
  140.    Begin VB.CheckBox Check2 
  141.       Caption         =   "Picture Only"
  142.       BeginProperty Font 
  143.          name            =   "MS Sans Serif"
  144.          charset         =   0
  145.          weight          =   700
  146.          size            =   8.25
  147.          underline       =   0   'False
  148.          italic          =   0   'False
  149.          strikethrough   =   0   'False
  150.       EndProperty
  151.       Height          =   315
  152.       Left            =   420
  153.       TabIndex        =   3
  154.       Top             =   3120
  155.       Width           =   1755
  156.    End
  157.    Begin VB.CheckBox Check1 
  158.       Caption         =   "Disable Button"
  159.       BeginProperty Font 
  160.          name            =   "MS Sans Serif"
  161.          charset         =   0
  162.          weight          =   700
  163.          size            =   8.25
  164.          underline       =   0   'False
  165.          italic          =   0   'False
  166.          strikethrough   =   0   'False
  167.       EndProperty
  168.       Height          =   315
  169.       Left            =   420
  170.       TabIndex        =   2
  171.       Top             =   2760
  172.       Width           =   1875
  173.    End
  174.    Begin PushLib.ctPush ctPush1 
  175.       Height          =   1215
  176.       Left            =   360
  177.       TabIndex        =   22
  178.       Top             =   1260
  179.       Width           =   1695
  180.       _version        =   65536
  181.       _extentx        =   2990
  182.       _extenty        =   2143
  183.       _stockprops     =   70
  184.       caption         =   "OK"
  185.       BeginProperty font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  186.          name            =   "MS Sans Serif"
  187.          charset         =   0
  188.          weight          =   700
  189.          size            =   9.75
  190.          underline       =   0   'False
  191.          italic          =   0   'False
  192.          strikethrough   =   0   'False
  193.       EndProperty
  194.       picture         =   "ct_push.frx":030A
  195.       picturedisabled =   "ct_push.frx":0A64
  196.       picturedown     =   "ct_push.frx":11BE
  197.       picposition     =   3
  198.       buttonheight    =   81
  199.       buttonwidth     =   113
  200.    End
  201.    Begin VB.Label Label3 
  202.       Alignment       =   2  'Center
  203.       Caption         =   "The above buttons have been set up in a toggle state. "
  204.       ForeColor       =   &H00800000&
  205.       Height          =   555
  206.       Left            =   5400
  207.       TabIndex        =   21
  208.       Top             =   2340
  209.       Width           =   2175
  210.    End
  211.    Begin PushLib.ctPush btn_tog3 
  212.       Height          =   675
  213.       Left            =   6720
  214.       TabIndex        =   20
  215.       Top             =   1320
  216.       Width           =   555
  217.       _version        =   65536
  218.       _extentx        =   979
  219.       _extenty        =   1191
  220.       _stockprops     =   70
  221.       caption         =   "#3"
  222.       picture         =   "ct_push.frx":11DA
  223.       picturedown     =   "ct_push.frx":136C
  224.       picposition     =   1
  225.       buttonheight    =   45
  226.       buttonwidth     =   37
  227.       toggle          =   -1  'True
  228.    End
  229.    Begin PushLib.ctPush btn_tog2 
  230.       Height          =   675
  231.       Left            =   6180
  232.       TabIndex        =   19
  233.       Top             =   1320
  234.       Width           =   555
  235.       _version        =   65536
  236.       _extentx        =   979
  237.       _extenty        =   1191
  238.       _stockprops     =   70
  239.       caption         =   "#2"
  240.       picture         =   "ct_push.frx":14FE
  241.       picturedown     =   "ct_push.frx":1690
  242.       picposition     =   1
  243.       buttonheight    =   45
  244.       buttonwidth     =   37
  245.       toggle          =   -1  'True
  246.    End
  247.    Begin PushLib.ctPush btn_tog1 
  248.       Height          =   675
  249.       Left            =   5640
  250.       TabIndex        =   18
  251.       Top             =   1320
  252.       Width           =   555
  253.       _version        =   65536
  254.       _extentx        =   979
  255.       _extenty        =   1191
  256.       _stockprops     =   70
  257.       caption         =   "#1"
  258.       picture         =   "ct_push.frx":1822
  259.       picturedown     =   "ct_push.frx":19B4
  260.       picposition     =   1
  261.       buttonheight    =   45
  262.       buttonwidth     =   37
  263.       toggle          =   -1  'True
  264.    End
  265.    Begin SpinLib.ctSpin ctSpin1 
  266.       Height          =   435
  267.       Left            =   4680
  268.       TabIndex        =   16
  269.       Top             =   4020
  270.       Width           =   255
  271.       _version        =   65536
  272.       _extentx        =   450
  273.       _extenty        =   767
  274.       _stockprops     =   64
  275.    End
  276.    Begin VB.Label txt_bevel 
  277.       Alignment       =   2  'Center
  278.       BorderStyle     =   1  'Fixed Single
  279.       Caption         =   "1"
  280.       BeginProperty Font 
  281.          name            =   "MS Sans Serif"
  282.          charset         =   0
  283.          weight          =   700
  284.          size            =   9.75
  285.          underline       =   0   'False
  286.          italic          =   0   'False
  287.          strikethrough   =   0   'False
  288.       EndProperty
  289.       ForeColor       =   &H00808080&
  290.       Height          =   435
  291.       Left            =   4020
  292.       TabIndex        =   15
  293.       Top             =   4020
  294.       Width           =   675
  295.    End
  296.    Begin VB.Label lbl_bevel 
  297.       Caption         =   "Picture Bevel :"
  298.       BeginProperty Font 
  299.          name            =   "MS Sans Serif"
  300.          charset         =   0
  301.          weight          =   700
  302.          size            =   9.75
  303.          underline       =   0   'False
  304.          italic          =   0   'False
  305.          strikethrough   =   0   'False
  306.       EndProperty
  307.       ForeColor       =   &H00808080&
  308.       Height          =   315
  309.       Left            =   2340
  310.       TabIndex        =   14
  311.       Top             =   4020
  312.       Width           =   1635
  313.    End
  314.    Begin VB.Label Label2 
  315.       Alignment       =   2  'Center
  316.       Caption         =   $"ct_push.frx":1B46
  317.       ForeColor       =   &H00800000&
  318.       Height          =   495
  319.       Left            =   240
  320.       TabIndex        =   13
  321.       Top             =   4740
  322.       Width           =   5355
  323.    End
  324.    Begin PushLib.ctPush ctPush2 
  325.       Height          =   975
  326.       Left            =   6360
  327.       TabIndex        =   1
  328.       Top             =   4260
  329.       Width           =   1215
  330.       _version        =   65536
  331.       _extentx        =   2143
  332.       _extenty        =   1720
  333.       _stockprops     =   70
  334.       caption         =   "E&xit the Demo"
  335.       BeginProperty font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  336.          name            =   "MS Sans Serif"
  337.          charset         =   0
  338.          weight          =   700
  339.          size            =   8.25
  340.          underline       =   0   'False
  341.          italic          =   0   'False
  342.          strikethrough   =   0   'False
  343.       EndProperty
  344.       picture         =   "ct_push.frx":1BDA
  345.       picturedown     =   "ct_push.frx":20DC
  346.       picposition     =   1
  347.       multiline       =   3
  348.       picyoffset      =   4
  349.       buttonheight    =   65
  350.       buttonwidth     =   81
  351.    End
  352.    Begin VB.Label Label1 
  353.       Alignment       =   2  'Center
  354.       Caption         =   $"ct_push.frx":25DE
  355.       BeginProperty Font 
  356.          name            =   "MS Sans Serif"
  357.          charset         =   0
  358.          weight          =   700
  359.          size            =   8.25
  360.          underline       =   0   'False
  361.          italic          =   0   'False
  362.          strikethrough   =   0   'False
  363.       EndProperty
  364.       ForeColor       =   &H00800000&
  365.       Height          =   735
  366.       Left            =   240
  367.       TabIndex        =   0
  368.       Top             =   180
  369.       Width           =   7155
  370.    End
  371. Attribute VB_Name = "w_push_demo"
  372. Attribute VB_Creatable = False
  373. Attribute VB_Exposed = False
  374. Dim nBevel As Integer
  375. Private Sub btn_tog1_Click()
  376.    If btn_tog1.State = False Then
  377.       btn_tog2.State = True
  378.       btn_tog3.State = True
  379.    End If
  380. End Sub
  381. Private Sub btn_tog2_Click()
  382.    If btn_tog2.State = False Then
  383.       btn_tog1.State = True
  384.       btn_tog3.State = True
  385.    End If
  386. End Sub
  387. Private Sub btn_tog3_Click()
  388.    If btn_tog3.State = False Then
  389.       btn_tog1.State = True
  390.       btn_tog2.State = True
  391.    End If
  392. End Sub
  393. Private Sub Check1_Click()
  394.    If Check1.Value Then
  395.       ctPush1.Enabled = False
  396.    Else
  397.       ctPush1.Enabled = True
  398.    End If
  399. End Sub
  400. Private Sub Check2_Click()
  401.    ctPush1.PicOnly = Check2.Value
  402.    If Check2.Value = False Then
  403.       txt_bevel.Enabled = False
  404.       ctSpin1.Enabled = False
  405.       lbl_bevel.ForeColor = RGB(80, 80, 80)
  406.       txt_bevel.ForeColor = RGB(80, 80, 80)
  407.    Else
  408.       txt_bevel.Enabled = True
  409.       ctSpin1.Enabled = True
  410.       lbl_bevel.ForeColor = RGB(0, 0, 0)
  411.       txt_bevel.ForeColor = RGB(0, 0, 0)
  412.    End If
  413. End Sub
  414. Private Sub Check3_Click()
  415.    ctPush1.PicExpand = Check3.Value
  416. End Sub
  417. Private Sub Check4_Click()
  418.    ctPush1.DrawFocus = Check4.Value
  419. End Sub
  420. Private Sub ctPush2_Click()
  421.    Unload w_push_demo
  422. End Sub
  423. Private Sub ctSpin1_Click(nButton As Integer)
  424.    If (nButton = 0) Then
  425.       If (nBevel + 1 < 15) Then
  426.          nBevel = nBevel + 1
  427.       End If
  428.    Else
  429.       If (nBevel > 0) Then
  430.          nBevel = nBevel - 1
  431.       End If
  432.    End If
  433.    txt_bevel.Caption = LTrim(Str(nBevel))
  434.    ctPush1.PicBevel = nBevel
  435. End Sub
  436. Private Sub Form_Load()
  437.    ' Center the window on the screen
  438.    Move (Screen.Width - Width) / 2, (Screen.Height - Height) * 0.15
  439.    nBevel = 1
  440. End Sub
  441. Private Sub Option1_Click()
  442.    ctPush1.PicPosition = 1
  443. End Sub
  444. Private Sub Option2_Click()
  445.    ctPush1.PicPosition = 2
  446. End Sub
  447. Private Sub Option3_Click()
  448.    ctPush1.PicPosition = 3
  449. End Sub
  450. Private Sub Option4_Click()
  451.    ctPush1.PicPosition = 4
  452. End Sub
  453. Private Sub Option5_Click()
  454.    ctPush1.WinStyle = 0
  455. End Sub
  456. Private Sub Option6_Click()
  457.    ctPush1.WinStyle = 1
  458. End Sub
  459.