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

  1. VERSION 2.00
  2. Begin Form w_push_demo 
  3.    BackColor       =   &H00FFFFFF&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "ctPUSH (Picture Push Button) Demo"
  6.    ClientHeight    =   4575
  7.    ClientLeft      =   915
  8.    ClientTop       =   1920
  9.    ClientWidth     =   7755
  10.    Height          =   5100
  11.    Icon            =   CT_PUSH.FRX:0000
  12.    Left            =   855
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MDIChild        =   -1  'True
  16.    ScaleHeight     =   4575
  17.    ScaleWidth      =   7755
  18.    Top             =   1455
  19.    Width           =   7875
  20.    Begin ctSPIN ct_bevel 
  21.       ArrowColor      =   &H00000000&
  22.       ArrowSize       =   0  'Small
  23.       BackColor       =   &H00C0C0C0&
  24.       BevelSize       =   2
  25.       BorderColor     =   &H00000000&
  26.       DisableColor    =   &H00808080&
  27.       Enabled         =   0   'False
  28.       Height          =   375
  29.       InitialDelay    =   200
  30.       Left            =   4590
  31.       RepeatRate      =   100
  32.       SpinStyle       =   0  'Vertical
  33.       TabIndex        =   16
  34.       Top             =   2640
  35.       Width           =   225
  36.    End
  37.    Begin CheckBox Check2 
  38.       BackColor       =   &H00FFFFFF&
  39.       Caption         =   "Expand Picture"
  40.       ForeColor       =   &H00000000&
  41.       Height          =   285
  42.       Left            =   600
  43.       TabIndex        =   15
  44.       Top             =   2670
  45.       Width           =   1755
  46.    End
  47.    Begin CheckBox Check1 
  48.       BackColor       =   &H00FFFFFF&
  49.       Caption         =   "Picture Only"
  50.       ForeColor       =   &H00000000&
  51.       Height          =   225
  52.       Left            =   600
  53.       TabIndex        =   14
  54.       Top             =   2400
  55.       Width           =   1575
  56.    End
  57.    Begin CheckBox chk_disable 
  58.       BackColor       =   &H00FFFFFF&
  59.       Caption         =   "Disable Button"
  60.       ForeColor       =   &H00000000&
  61.       Height          =   255
  62.       Left            =   600
  63.       TabIndex        =   12
  64.       Top             =   2100
  65.       Width           =   1635
  66.    End
  67.    Begin Frame Frame1 
  68.       BackColor       =   &H00FFFFFF&
  69.       Caption         =   "Picture Position"
  70.       ForeColor       =   &H00000000&
  71.       Height          =   1335
  72.       Left            =   2730
  73.       TabIndex        =   7
  74.       Top             =   960
  75.       Width           =   2175
  76.       Begin OptionButton Option4 
  77.          BackColor       =   &H00FFFFFF&
  78.          Caption         =   "Right"
  79.          ForeColor       =   &H00000000&
  80.          Height          =   315
  81.          Left            =   1200
  82.          TabIndex        =   11
  83.          Top             =   870
  84.          Width           =   795
  85.       End
  86.       Begin OptionButton opt_left 
  87.          BackColor       =   &H00FFFFFF&
  88.          Caption         =   "Left"
  89.          ForeColor       =   &H00000000&
  90.          Height          =   285
  91.          Left            =   1200
  92.          TabIndex        =   10
  93.          Top             =   390
  94.          Value           =   -1  'True
  95.          Width           =   795
  96.       End
  97.       Begin OptionButton Option2 
  98.          BackColor       =   &H00FFFFFF&
  99.          Caption         =   "Bottom"
  100.          ForeColor       =   &H00000000&
  101.          Height          =   345
  102.          Left            =   180
  103.          TabIndex        =   9
  104.          Top             =   840
  105.          Width           =   975
  106.       End
  107.       Begin OptionButton Option1 
  108.          BackColor       =   &H00FFFFFF&
  109.          Caption         =   "Top"
  110.          ForeColor       =   &H00000000&
  111.          Height          =   315
  112.          Left            =   180
  113.          TabIndex        =   8
  114.          Top             =   390
  115.          Width           =   855
  116.       End
  117.    End
  118.    Begin ctPUSH ctPush 
  119.       BackColor       =   &H00C0C0C0&
  120.       BevelSize       =   2
  121.       ButtonHeight    =   69
  122.       ButtonWidth     =   87
  123.       Caption         =   "OK"
  124.       DisableColor    =   &H00808080&
  125.       FocusBorder     =   0   'False
  126.       ForeColor       =   &H00000000&
  127.       Height          =   1035
  128.       Left            =   510
  129.       MultiLine       =   0  'None
  130.       PicBevel        =   1
  131.       PicExpand       =   0   'False
  132.       PicOnly         =   0   'False
  133.       PicPosition     =   3  'Left
  134.       Picture         =   CT_PUSH.FRX:0302
  135.       PictureDisabled =   CT_PUSH.FRX:050C
  136.       PicXOffset      =   0
  137.       PicYOffset      =   0
  138.       RepeatRate      =   0
  139.       RoundCorners    =   -1  'True
  140.       State           =   -1  'True
  141.       TabIndex        =   4
  142.       TextXOffset     =   0
  143.       TextYOffset     =   0
  144.       Toggle          =   0   'False
  145.       Top             =   960
  146.       Width           =   1305
  147.    End
  148.    Begin ctPUSH btn_tog3 
  149.       BackColor       =   &H00C0C0C0&
  150.       BevelSize       =   2
  151.       ButtonHeight    =   43
  152.       ButtonWidth     =   41
  153.       Caption         =   "#3"
  154.       DisableColor    =   &H00808080&
  155.       FocusBorder     =   0   'False
  156.       FontBold        =   0   'False
  157.       FontItalic      =   0   'False
  158.       FontName        =   "Arial"
  159.       FontSize        =   8.25
  160.       FontStrikethru  =   0   'False
  161.       FontUnderline   =   0   'False
  162.       ForeColor       =   &H00000000&
  163.       Height          =   645
  164.       Left            =   1680
  165.       MultiLine       =   0  'None
  166.       PicBevel        =   1
  167.       PicExpand       =   0   'False
  168.       PicOnly         =   0   'False
  169.       PicPosition     =   1  'Top
  170.       Picture         =   CT_PUSH.FRX:0716
  171.       PictureDown     =   CT_PUSH.FRX:07E0
  172.       PicXOffset      =   0
  173.       PicYOffset      =   0
  174.       RepeatRate      =   0
  175.       RoundCorners    =   -1  'True
  176.       State           =   -1  'True
  177.       TabIndex        =   3
  178.       TextXOffset     =   0
  179.       TextYOffset     =   0
  180.       Toggle          =   -1  'True
  181.       Top             =   3570
  182.       Width           =   615
  183.    End
  184.    Begin ctPUSH btn_tog2 
  185.       BackColor       =   &H00C0C0C0&
  186.       BevelSize       =   2
  187.       ButtonHeight    =   43
  188.       ButtonWidth     =   41
  189.       Caption         =   "#2"
  190.       DisableColor    =   &H00808080&
  191.       FocusBorder     =   0   'False
  192.       FontBold        =   0   'False
  193.       FontItalic      =   0   'False
  194.       FontName        =   "Arial"
  195.       FontSize        =   8.25
  196.       FontStrikethru  =   0   'False
  197.       FontUnderline   =   0   'False
  198.       ForeColor       =   &H00000000&
  199.       Height          =   645
  200.       Left            =   1080
  201.       MultiLine       =   0  'None
  202.       PicBevel        =   1
  203.       PicExpand       =   0   'False
  204.       PicOnly         =   0   'False
  205.       PicPosition     =   1  'Top
  206.       Picture         =   CT_PUSH.FRX:08AA
  207.       PictureDown     =   CT_PUSH.FRX:0974
  208.       PicXOffset      =   0
  209.       PicYOffset      =   0
  210.       RepeatRate      =   0
  211.       RoundCorners    =   -1  'True
  212.       State           =   -1  'True
  213.       TabIndex        =   2
  214.       TextXOffset     =   0
  215.       TextYOffset     =   0
  216.       Toggle          =   -1  'True
  217.       Top             =   3570
  218.       Width           =   615
  219.    End
  220.    Begin ctPUSH btn_tog1 
  221.       BackColor       =   &H00C0C0C0&
  222.       BevelSize       =   2
  223.       ButtonHeight    =   43
  224.       ButtonWidth     =   41
  225.       Caption         =   "#1"
  226.       DisableColor    =   &H00808080&
  227.       FocusBorder     =   0   'False
  228.       FontBold        =   0   'False
  229.       FontItalic      =   0   'False
  230.       FontName        =   "Arial"
  231.       FontSize        =   8.25
  232.       FontStrikethru  =   0   'False
  233.       FontUnderline   =   0   'False
  234.       ForeColor       =   &H00000000&
  235.       Height          =   645
  236.       Left            =   480
  237.       MultiLine       =   0  'None
  238.       PicBevel        =   1
  239.       PicExpand       =   0   'False
  240.       PicOnly         =   0   'False
  241.       PicPosition     =   1  'Top
  242.       Picture         =   CT_PUSH.FRX:0A3E
  243.       PictureDown     =   CT_PUSH.FRX:0B08
  244.       PicXOffset      =   0
  245.       PicYOffset      =   0
  246.       RepeatRate      =   0
  247.       RoundCorners    =   -1  'True
  248.       State           =   -1  'True
  249.       TabIndex        =   1
  250.       TextXOffset     =   0
  251.       TextYOffset     =   0
  252.       Toggle          =   -1  'True
  253.       Top             =   3570
  254.       Width           =   615
  255.    End
  256.    Begin ctPUSH ctPush1 
  257.       BackColor       =   &H00C0C0C0&
  258.       BevelSize       =   2
  259.       ButtonHeight    =   61
  260.       ButtonWidth     =   75
  261.       Caption         =   "E&xit from Demo"
  262.       DisableColor    =   &H00808080&
  263.       FocusBorder     =   0   'False
  264.       ForeColor       =   &H00000000&
  265.       Height          =   915
  266.       Left            =   6300
  267.       MultiLine       =   3  'Center
  268.       PicBevel        =   1
  269.       PicExpand       =   0   'False
  270.       PicOnly         =   0   'False
  271.       PicPosition     =   1  'Top
  272.       Picture         =   CT_PUSH.FRX:0BD2
  273.       PictureDown     =   CT_PUSH.FRX:0D3C
  274.       PicXOffset      =   0
  275.       PicYOffset      =   2
  276.       RepeatRate      =   0
  277.       RoundCorners    =   -1  'True
  278.       State           =   -1  'True
  279.       TabIndex        =   0
  280.       TextXOffset     =   0
  281.       TextYOffset     =   -2
  282.       Toggle          =   0   'False
  283.       Top             =   3420
  284.       Width           =   1125
  285.    End
  286.    Begin Label txt_bevel 
  287.       Alignment       =   2  'Center
  288.       BackColor       =   &H00FFFFFF&
  289.       BorderStyle     =   1  'Fixed Single
  290.       Caption         =   "1"
  291.       ForeColor       =   &H00808080&
  292.       Height          =   375
  293.       Left            =   4110
  294.       TabIndex        =   18
  295.       Top             =   2640
  296.       Width           =   525
  297.    End
  298.    Begin Label lbl_bevel 
  299.       BackColor       =   &H00FFFFFF&
  300.       Caption         =   "Picture Bevel :"
  301.       ForeColor       =   &H00808080&
  302.       Height          =   255
  303.       Left            =   2730
  304.       TabIndex        =   17
  305.       Top             =   2700
  306.       Width           =   1335
  307.    End
  308.    Begin Label Label3 
  309.       BackStyle       =   0  'Transparent
  310.       Caption         =   "The ctPUSH control has separate offset attributes for the text and picture. This makes it easier to get the proper look and feel for the buttons"
  311.       FontBold        =   0   'False
  312.       FontItalic      =   0   'False
  313.       FontName        =   "MS Sans Serif"
  314.       FontSize        =   8.25
  315.       FontStrikethru  =   0   'False
  316.       FontUnderline   =   0   'False
  317.       ForeColor       =   &H00800000&
  318.       Height          =   1395
  319.       Left            =   5310
  320.       TabIndex        =   13
  321.       Top             =   1020
  322.       Width           =   2025
  323.    End
  324.    Begin Label Label2 
  325.       BackColor       =   &H00FFFFFF&
  326.       Caption         =   "The following buttons have been set up in a toggle state. "
  327.       ForeColor       =   &H00000000&
  328.       Height          =   495
  329.       Left            =   2460
  330.       TabIndex        =   6
  331.       Top             =   3660
  332.       Width           =   2655
  333.    End
  334.    Begin Label Label1 
  335.       Alignment       =   2  'Center
  336.       BackColor       =   &H00FFFFFF&
  337.       BackStyle       =   0  'Transparent
  338.       Caption         =   "The ctPUSH VBX is a picture push button control. It allows the user to place a picture anywhere within the button. The control can accept three different images (up, down, and disabled) and can be set up as a toggle button."
  339.       ForeColor       =   &H00800000&
  340.       Height          =   615
  341.       Left            =   120
  342.       TabIndex        =   5
  343.       Top             =   120
  344.       Width           =   7155
  345.    End
  346. Dim nBevel As Integer
  347. Sub btn_tog1_Click ()
  348.    If btn_tog1.State = False Then
  349.       btn_tog2.State = True
  350.       btn_tog3.State = True
  351.    End If
  352. End Sub
  353. Sub btn_tog2_Click ()
  354.    If btn_tog2.State = False Then
  355.       btn_tog1.State = True
  356.       btn_tog3.State = True
  357.    End If
  358. End Sub
  359. Sub btn_tog3_Click ()
  360.    If btn_tog3.State = False Then
  361.       btn_tog2.State = True
  362.       btn_tog1.State = True
  363.    End If
  364. End Sub
  365. Sub Check1_Click ()
  366.    ctPush.PicOnly = Check1.Value
  367.    If Check1.Value = False Then
  368.       txt_bevel.Enabled = False
  369.       ct_bevel.Enabled = False
  370.       lbl_bevel.ForeColor = RGB(80, 80, 80)
  371.       txt_bevel.ForeColor = RGB(80, 80, 80)
  372.    Else
  373.       txt_bevel.Enabled = True
  374.       ct_bevel.Enabled = True
  375.       lbl_bevel.ForeColor = RGB(0, 0, 0)
  376.       txt_bevel.ForeColor = RGB(0, 0, 0)
  377.    End If
  378. End Sub
  379. Sub Check2_Click ()
  380.    ctPush.PicExpand = Check2.Value
  381. End Sub
  382. Sub chk_disable_Click ()
  383.    If chk_disable.Value Then
  384.       ctPush.Enabled = False
  385.    Else
  386.       ctPush.Enabled = True
  387.    End If
  388. End Sub
  389. Sub ct_bevel_Click (nButton As Integer)
  390.    If (nButton = 1) Then
  391.       nBevel = Minimum(nBevel + 1, 15)
  392.    Else
  393.       nBevel = Maximum(nBevel - 1, 0)
  394.    End If
  395.    txt_bevel.Caption = LTrim(Str(nBevel))
  396.    ctPush.PicBevel = nBevel
  397. End Sub
  398. Sub ctPush1_Click ()
  399.    Unload w_push_demo
  400. End Sub
  401. Sub Form_Load ()
  402.    ' Center the window on the screen
  403.    Move (Screen.Width - Width) / 2, (Screen.Height - Height) * .25
  404.    w_mdi_main.bt_push = BUTTON_DISABLE
  405.    nBevel = 1
  406. End Sub
  407. Sub Form_Unload (Cancel As Integer)
  408.    w_mdi_main.bt_push = BUTTON_UP
  409. End Sub
  410. Function Maximum (x As Integer, y As Integer)
  411.    If x > y Then
  412.       Maximum = x
  413.    Else
  414.       Maximum = y
  415.    End If
  416. End Function
  417. Function Minimum (x As Integer, y As Integer)
  418.    If x < y Then
  419.       Minimum = x
  420.    Else
  421.       Minimum = y
  422.    End If
  423. End Function
  424. Sub opt_left_Click ()
  425.    ctPush.PicPosition = 3
  426. End Sub
  427. Sub Option1_Click ()
  428.    ctPush.PicPosition = 1
  429. End Sub
  430. Sub Option2_Click ()
  431.    ctPush.PicPosition = 2
  432. End Sub
  433. Sub Option4_Click ()
  434.    ctPush.PicPosition = 4
  435. End Sub
  436.