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

  1. VERSION 2.00
  2. Begin Form w_ctlist_demo 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "ctLIST (Virtual Picture List) Demo"
  6.    ClientHeight    =   5625
  7.    ClientLeft      =   1740
  8.    ClientTop       =   1305
  9.    ClientWidth     =   8220
  10.    Height          =   6150
  11.    Icon            =   CT_LIST.FRX:0000
  12.    Left            =   1680
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MDIChild        =   -1  'True
  16.    ScaleHeight     =   5625
  17.    ScaleWidth      =   8220
  18.    Top             =   840
  19.    Width           =   8340
  20.    Begin ctLIST ctList2 
  21.       BackColor       =   &H00FFFFFF&
  22.       BorderType      =   5  'Inset
  23.       Columns         =   3
  24.       ColumnWidths    =   "100,70"
  25.       ForeColor       =   &H00000000&
  26.       GridLineColor   =   &H00C0C0C0&
  27.       GridLines       =   -1  'True
  28.       Height          =   2655
  29.       HeightOffset    =   0
  30.       HScroll         =   -1  'True
  31.       Left            =   4260
  32.       ListCount       =   20
  33.       PicCols         =   6
  34.       PicRows         =   4
  35.       Picture         =   CT_LIST.FRX:0302
  36.       PicXOffset      =   0
  37.       PicYOffset      =   0
  38.       Range           =   0
  39.       Selected        =   -1
  40.       SelectedBackColor=   &H00800000&
  41.       SelectedTextColor=   &H00FFFFFF&
  42.       ShadowColor     =   &H00808080&
  43.       Style           =   0  'Normal
  44.       TabIndex        =   8
  45.       TextPosition    =   0  'Right
  46.       TextXOffset     =   0
  47.       TextYOffset     =   0
  48.       Top             =   1620
  49.       UpdateList      =   0
  50.       VScroll         =   -1  'True
  51.       Width           =   3795
  52.    End
  53.    Begin ctGROUP ctGroup1 
  54.       Alignment       =   0  'Left
  55.       BackColor       =   &H00C0C0C0&
  56.       BorderColor     =   &H00808080&
  57.       BorderType      =   4  'Lowered Inset
  58.       Caption         =   "Text Position"
  59.       ForeColor       =   &H00000000&
  60.       Height          =   1155
  61.       Left            =   300
  62.       TabIndex        =   3
  63.       TextPosition    =   0  'Top
  64.       Top             =   4200
  65.       Width           =   3015
  66.       Begin ctRADIO ctRadio4 
  67.          Alignment       =   0  'Left Justify
  68.          BackColor       =   &H00C0C0C0&
  69.          Caption         =   "Bottom"
  70.          DisableColor    =   &H00808080&
  71.          ForeColor       =   &H00000000&
  72.          Height          =   255
  73.          Left            =   1740
  74.          PicStyle        =   1  'Style #1
  75.          ShowFocus       =   -1  'True
  76.          TabIndex        =   7
  77.          Top             =   720
  78.          Value           =   0   'False
  79.          Width           =   975
  80.       End
  81.       Begin ctRADIO ctRadio3 
  82.          Alignment       =   0  'Left Justify
  83.          BackColor       =   &H00C0C0C0&
  84.          Caption         =   "Top"
  85.          DisableColor    =   &H00808080&
  86.          ForeColor       =   &H00000000&
  87.          Height          =   255
  88.          Left            =   1740
  89.          PicStyle        =   1  'Style #1
  90.          ShowFocus       =   -1  'True
  91.          TabIndex        =   6
  92.          Top             =   360
  93.          Value           =   0   'False
  94.          Width           =   915
  95.       End
  96.       Begin ctRADIO ctRadio2 
  97.          Alignment       =   0  'Left Justify
  98.          BackColor       =   &H00C0C0C0&
  99.          Caption         =   "Right"
  100.          DisableColor    =   &H00808080&
  101.          ForeColor       =   &H00000000&
  102.          Height          =   255
  103.          Left            =   270
  104.          PicStyle        =   1  'Style #1
  105.          ShowFocus       =   -1  'True
  106.          TabIndex        =   5
  107.          Top             =   720
  108.          Value           =   -1  'True
  109.          Width           =   915
  110.       End
  111.       Begin ctRADIO ctRadio1 
  112.          Alignment       =   0  'Left Justify
  113.          BackColor       =   &H00C0C0C0&
  114.          Caption         =   "Left"
  115.          DisableColor    =   &H00808080&
  116.          ForeColor       =   &H00000000&
  117.          Height          =   255
  118.          Left            =   270
  119.          PicStyle        =   1  'Style #1
  120.          ShowFocus       =   -1  'True
  121.          TabIndex        =   4
  122.          Top             =   360
  123.          Value           =   0   'False
  124.          Width           =   945
  125.       End
  126.    End
  127.    Begin CommandButton Command1 
  128.       Caption         =   "E&xit"
  129.       Height          =   435
  130.       Left            =   6900
  131.       TabIndex        =   1
  132.       Top             =   4980
  133.       Width           =   975
  134.    End
  135.    Begin ctLIST ctList1 
  136.       BackColor       =   &H00C0C0C0&
  137.       BorderType      =   0  'Regular
  138.       Columns         =   1
  139.       ColumnWidths    =   "15"
  140.       ForeColor       =   &H00000000&
  141.       GridLineColor   =   &H00C0C0C0&
  142.       GridLines       =   0   'False
  143.       Height          =   2445
  144.       HeightOffset    =   1
  145.       HScroll         =   0   'False
  146.       Left            =   240
  147.       ListCount       =   20
  148.       PicCols         =   6
  149.       PicRows         =   4
  150.       Picture         =   CT_LIST.FRX:145C
  151.       PicXOffset      =   0
  152.       PicYOffset      =   0
  153.       Range           =   0
  154.       Selected        =   -1
  155.       SelectedBackColor=   &H00808080&
  156.       SelectedTextColor=   &H00000000&
  157.       ShadowColor     =   &H00808080&
  158.       Style           =   1  'Raised
  159.       TabIndex        =   0
  160.       TextPosition    =   0  'Right
  161.       TextXOffset     =   0
  162.       TextYOffset     =   0
  163.       Top             =   1620
  164.       UpdateList      =   0
  165.       VScroll         =   0   'False
  166.       Width           =   3705
  167.    End
  168.    Begin Label Label4 
  169.       BackColor       =   &H00C0C0C0&
  170.       Caption         =   "Double click on any of the records above to change the image"
  171.       FontBold        =   0   'False
  172.       FontItalic      =   0   'False
  173.       FontName        =   "MS Sans Serif"
  174.       FontSize        =   8.25
  175.       FontStrikethru  =   0   'False
  176.       FontUnderline   =   0   'False
  177.       ForeColor       =   &H00800000&
  178.       Height          =   435
  179.       Left            =   4260
  180.       TabIndex        =   11
  181.       Top             =   4440
  182.       Width           =   2655
  183.    End
  184.    Begin Label Label3 
  185.       BackColor       =   &H00C0C0C0&
  186.       Caption         =   "List with pictures"
  187.       FontBold        =   0   'False
  188.       FontItalic      =   0   'False
  189.       FontName        =   "MS Sans Serif"
  190.       FontSize        =   8.25
  191.       FontStrikethru  =   0   'False
  192.       FontUnderline   =   0   'False
  193.       Height          =   255
  194.       Left            =   240
  195.       TabIndex        =   10
  196.       Top             =   1320
  197.       Width           =   1455
  198.    End
  199.    Begin Label Label2 
  200.       BackColor       =   &H00C0C0C0&
  201.       Caption         =   "List with grid lines, horizontal scroll bar, and option to change a rows background color"
  202.       FontBold        =   0   'False
  203.       FontItalic      =   0   'False
  204.       FontName        =   "MS Sans Serif"
  205.       FontSize        =   8.25
  206.       FontStrikethru  =   0   'False
  207.       FontUnderline   =   0   'False
  208.       Height          =   435
  209.       Left            =   4260
  210.       TabIndex        =   9
  211.       Top             =   1140
  212.       Width           =   3615
  213.    End
  214.    Begin Label Label1 
  215.       Alignment       =   2  'Center
  216.       BackColor       =   &H00C0C0C0&
  217.       BackStyle       =   0  'Transparent
  218.       Caption         =   "the ctLIST VBX is a virtual list box capable of displaying a variety of different images. The image, alignment, color, and text can all be declared as the control is being painted. Since a virtual list box does not directly store the data, it can display very large amounts of data. In this case, the control can display up to 32,767 records."
  219.       ForeColor       =   &H00800000&
  220.       Height          =   825
  221.       Left            =   360
  222.       TabIndex        =   2
  223.       Top             =   180
  224.       Width           =   7635
  225.    End
  226. Dim cString(20) As String
  227. Dim nChecks(20) As Integer
  228. Sub Command1_Click ()
  229.    Unload w_ctlist_demo
  230. End Sub
  231. Sub ctList1_GetText (ListIndex As Integer, Text As String, Picture As Integer, Alignment As Integer, BackColor As Long, ForeColor As Long)
  232.    Picture = ListIndex
  233.    Text = cString(ListIndex)
  234. End Sub
  235. Sub ctList2_DblClick ()
  236.    Dim nSel As Integer
  237.    nSel = ctList2.Selected + 1
  238.    If nSel > 0 Then
  239.       If nChecks(nSel) = 5 Then
  240.          nChecks(nSel) = 17
  241.       Else
  242.          nChecks(nSel) = 5
  243.       End If
  244.       ctList2.UpdateList = 0
  245.    End If
  246. End Sub
  247. Sub ctList2_GetText (ListIndex As Integer, Text As String, Picture As Integer, Alignment As Integer, BackColor As Long, ForeColor As Long)
  248.    Text = "Record #" + LTrim(Str(ListIndex)) + Chr(9) + "Column" + Chr(9) + cString(ListIndex)
  249.    Picture = nChecks(ListIndex)
  250.    If ListIndex = 5 Or ListIndex = 10 Or ListIndex = 15 Then
  251.       ForeColor = RGB(255, 0, 0)
  252.       BackColor = RGB(255, 255, 80)
  253.    End If
  254. End Sub
  255. Sub ctRadio1_Click ()
  256.    ctList1.TextPosition = 1
  257. End Sub
  258. Sub ctRadio2_Click ()
  259.    ctList1.TextPosition = 0
  260. End Sub
  261. Sub ctRadio3_Click ()
  262.    ctList1.TextPosition = 3
  263. End Sub
  264. Sub ctRadio4_Click ()
  265.    ctList1.TextPosition = 2
  266. End Sub
  267. Sub Form_Load ()
  268.    ' Center the window on the screen
  269.    Move (Screen.Width - Width) / 2, (Screen.Height - Height) * .1
  270.    w_mdi_main.bt_list = BUTTON_DISABLE
  271.    cString(1) = "Stop Sign"
  272.    cString(2) = "Happy Face"
  273.    cString(3) = "Empty Diamond"
  274.    cString(4) = "Blue Diamond"
  275.    cString(5) = "Empty Box"
  276.    cString(6) = "Cross Box"
  277.    cString(7) = "Green Start"
  278.    cString(8) = "Previous Page"
  279.    cString(9) = "Last Record"
  280.    cString(10) = "Next Record"
  281.    cString(11) = "Next Page"
  282.    cString(12) = "Green End"
  283.    cString(13) = "Stop Sign (down)"
  284.    cString(14) = "Happy Face (down)"
  285.    cString(15) = "Empty Diamond (down)"
  286.    cString(16) = "Blue Diamond (down)"
  287.    cString(17) = "Empty Box (down)"
  288.    cString(18) = "Cross Box (down)"
  289.    cString(19) = "Green Start (down)"
  290.    cString(20) = "Previous Page (down)"
  291.    For nCntr = 1 To 20
  292.       nChecks(nCntr) = 5
  293.    Next
  294. End Sub
  295. Sub Form_Unload (Cancel As Integer)
  296.    w_mdi_main.bt_list = BUTTON_UP
  297. End Sub
  298.