home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 17 / CD_ASCQ_17_101194.iso / dos / prg / czlist / demo.frm < prev    next >
Text File  |  1994-07-10  |  25KB  |  830 lines

  1. Version 1.00
  2. BEGIN Form frmCzList
  3.     AutoRedraw   = -1
  4.     BackColor    = QBColor(7)
  5.     BorderStyle  = 2
  6.     Caption      = "CzList Demo"
  7.     ControlBox   = -1
  8.     Enabled      = -1
  9.     ForeColor    = QBColor(0)
  10.     Height       = Char(24)
  11.     Left         = Char(2)
  12.     MaxButton    = -1
  13.     MinButton    = -1
  14.     MousePointer = 0
  15.     Tag          = ""
  16.     Top          = Char(0)
  17.     Visible      = -1
  18.     Width        = Char(74)
  19.     WindowState  = 0
  20.     BEGIN Label Label10
  21.         Alignment    = 0
  22.         AutoSize     = 0
  23.         BackColor    = QBColor(7)
  24.         BorderStyle  = 0
  25.         Caption      = "With the mouse: Click on the top or bottom box line to scroll as well."
  26.         DragMode     = 0
  27.         Enabled      = -1
  28.         ForeColor    = QBColor(15)
  29.         Height       = Char(1)
  30.         Left         = Char(1)
  31.         MousePointer = 0
  32.         TabIndex     = 17
  33.         Tag          = ""
  34.         Top          = Char(1)
  35.         Visible      = -1
  36.         Width        = Char(70)
  37.     END
  38.     BEGIN Frame Frame1
  39.         BackColor    = QBColor(7)
  40.         Caption      = "General Information:"
  41.         DragMode     = 0
  42.         Enabled      = -1
  43.         ForeColor    = QBColor(0)
  44.         Height       = Char(6)
  45.         Left         = Char(2)
  46.         MousePointer = 0
  47.         TabIndex     = 2
  48.         Tag          = ""
  49.         Top          = Char(16)
  50.         Visible      = -1
  51.         Width        = Char(57)
  52.         BEGIN Label Label4
  53.             Alignment    = 0
  54.             AutoSize     = 0
  55.             BackColor    = QBColor(7)
  56.             BorderStyle  = 0
  57.             Caption      = "(Press ENTER to display!)"
  58.             DragMode     = 0
  59.             Enabled      = -1
  60.             ForeColor    = QBColor(15)
  61.             Height       = Char(1)
  62.             Left         = Char(19)
  63.             MousePointer = 0
  64.             TabIndex     = 5
  65.             Tag          = ""
  66.             Top          = Char(0)
  67.             Visible      = -1
  68.             Width        = Char(25)
  69.         END
  70.         BEGIN Label Label2
  71.             Alignment    = 0
  72.             AutoSize     = 0
  73.             BackColor    = QBColor(7)
  74.             BorderStyle  = 0
  75.             Caption      = "Label2"
  76.             DragMode     = 0
  77.             Enabled      = -1
  78.             ForeColor    = QBColor(0)
  79.             Height       = Char(1)
  80.             Left         = Char(1)
  81.             MousePointer = 0
  82.             TabIndex     = 6
  83.             Tag          = ""
  84.             Top          = Char(1)
  85.             Visible      = -1
  86.             Width        = Char(30)
  87.         END
  88.         BEGIN Label Label3
  89.             Alignment    = 0
  90.             AutoSize     = 0
  91.             BackColor    = QBColor(7)
  92.             BorderStyle  = 0
  93.             Caption      = "Label3"
  94.             DragMode     = 0
  95.             Enabled      = -1
  96.             ForeColor    = QBColor(0)
  97.             Height       = Char(1)
  98.             Left         = Char(1)
  99.             MousePointer = 0
  100.             TabIndex     = 7
  101.             Tag          = ""
  102.             Top          = Char(2)
  103.             Visible      = -1
  104.             Width        = Char(49)
  105.         END
  106.         BEGIN Label Label7
  107.             Alignment    = 0
  108.             AutoSize     = 0
  109.             BackColor    = QBColor(7)
  110.             BorderStyle  = 0
  111.             Caption      = "Label7"
  112.             DragMode     = 0
  113.             Enabled      = -1
  114.             ForeColor    = QBColor(0)
  115.             Height       = Char(1)
  116.             Left         = Char(1)
  117.             MousePointer = 0
  118.             TabIndex     = 16
  119.             Tag          = ""
  120.             Top          = Char(3)
  121.             Visible      = -1
  122.             Width        = Char(49)
  123.         END
  124.         BEGIN Label Label5
  125.             Alignment    = 0
  126.             AutoSize     = 0
  127.             BackColor    = QBColor(7)
  128.             BorderStyle  = 0
  129.             Caption      = "ListIndex ="
  130.             DragMode     = 0
  131.             Enabled      = -1
  132.             ForeColor    = QBColor(0)
  133.             Height       = Char(1)
  134.             Index        = 0
  135.             Left         = Char(1)
  136.             MousePointer = 0
  137.             TabIndex     = 3
  138.             Tag          = ""
  139.             Top          = Char(0)
  140.             Visible      = -1
  141.             Width        = Char(11)
  142.         END
  143.         BEGIN Label lblListIndex
  144.             Alignment    = 0
  145.             AutoSize     = 0
  146.             BackColor    = QBColor(7)
  147.             BorderStyle  = 0
  148.             Caption      = "Label1"
  149.             DragMode     = 0
  150.             Enabled      = -1
  151.             ForeColor    = QBColor(0)
  152.             Height       = Char(1)
  153.             Left         = Char(12)
  154.             MousePointer = 0
  155.             TabIndex     = 4
  156.             Tag          = ""
  157.             Top          = Char(0)
  158.             Visible      = -1
  159.             Width        = Char(7)
  160.         END
  161.     END
  162.     BEGIN Frame Frame2
  163.         BackColor    = QBColor(7)
  164.         Caption      = "Tagging:"
  165.         DragMode     = 0
  166.         Enabled      = -1
  167.         ForeColor    = QBColor(0)
  168.         Height       = Char(6)
  169.         Left         = Char(2)
  170.         MousePointer = 0
  171.         TabIndex     = 8
  172.         Tag          = ""
  173.         Top          = Char(10)
  174.         Visible      = -1
  175.         Width        = Char(68)
  176.         BEGIN Label Label5
  177.             Alignment    = 0
  178.             AutoSize     = 0
  179.             BackColor    = QBColor(7)
  180.             BorderStyle  = 0
  181.             Caption      = "Items Tagged ="
  182.             DragMode     = 0
  183.             Enabled      = -1
  184.             ForeColor    = QBColor(0)
  185.             Height       = Char(1)
  186.             Index        = 1
  187.             Left         = Char(33)
  188.             MousePointer = 0
  189.             TabIndex     = 12
  190.             Tag          = ""
  191.             Top          = Char(0)
  192.             Visible      = -1
  193.             Width        = Char(14)
  194.         END
  195.         BEGIN Label Label8
  196.             Alignment    = 0
  197.             AutoSize     = 0
  198.             BackColor    = QBColor(7)
  199.             BorderStyle  = 0
  200.             Caption      = "Keyboard: SPACE to tag/untag"
  201.             DragMode     = 0
  202.             Enabled      = -1
  203.             ForeColor    = QBColor(15)
  204.             Height       = Char(1)
  205.             Left         = Char(1)
  206.             MousePointer = 0
  207.             TabIndex     = 14
  208.             Tag          = ""
  209.             Top          = Char(3)
  210.             Visible      = -1
  211.             Width        = Char(30)
  212.         END
  213.         BEGIN Label Label9
  214.             Alignment    = 0
  215.             AutoSize     = 0
  216.             BackColor    = QBColor(7)
  217.             BorderStyle  = 0
  218.             Caption      = "Mouse: RIGHT button to tag/untag"
  219.             DragMode     = 0
  220.             Enabled      = -1
  221.             ForeColor    = QBColor(15)
  222.             Height       = Char(1)
  223.             Left         = Char(33)
  224.             MousePointer = 0
  225.             TabIndex     = 15
  226.             Tag          = ""
  227.             Top          = Char(3)
  228.             Visible      = -1
  229.             Width        = Char(32)
  230.         END
  231.         BEGIN CommandButton cmdTag
  232.             BackColor    = QBColor(7)
  233.             Cancel       = 0
  234.             Caption      = "&Tag All Items"
  235.             Default      = 0
  236.             DragMode     = 0
  237.             Enabled      = -1
  238.             Height       = Char(1)
  239.             Left         = Char(33)
  240.             MousePointer = 0
  241.             TabIndex     = 18
  242.             TabStop      = -1
  243.             Tag          = ""
  244.             Top          = Char(1)
  245.             Visible      = -1
  246.             Width        = Char(19)
  247.         END
  248.         BEGIN CommandButton cmdUntag
  249.             BackColor    = QBColor(7)
  250.             Cancel       = 0
  251.             Caption      = "&Untag All Items"
  252.             Default      = 0
  253.             DragMode     = 0
  254.             Enabled      = -1
  255.             Height       = Char(1)
  256.             Left         = Char(33)
  257.             MousePointer = 0
  258.             TabIndex     = 19
  259.             TabStop      = -1
  260.             Tag          = ""
  261.             Top          = Char(2)
  262.             Visible      = -1
  263.             Width        = Char(19)
  264.         END
  265.         BEGIN CheckBox chkKeybTag
  266.             BackColor    = QBColor(7)
  267.             Caption      = "&Keyboard Tag-Scrolling"
  268.             DragMode     = 0
  269.             Enabled      = -1
  270.             ForeColor    = QBColor(0)
  271.             Height       = Char(1)
  272.             Left         = Char(1)
  273.             MousePointer = 0
  274.             TabIndex     = 10
  275.             TabStop      = -1
  276.             Tag          = ""
  277.             Top          = Char(1)
  278.             Value        = 0
  279.             Visible      = -1
  280.             Width        = Char(26)
  281.         END
  282.         BEGIN CheckBox chkMouseTag
  283.             BackColor    = QBColor(7)
  284.             Caption      = "&Mouse Tag-Scrolling"
  285.             DragMode     = 0
  286.             Enabled      = -1
  287.             ForeColor    = QBColor(0)
  288.             Height       = Char(1)
  289.             Left         = Char(1)
  290.             MousePointer = 0
  291.             TabIndex     = 11
  292.             TabStop      = -1
  293.             Tag          = ""
  294.             Top          = Char(2)
  295.             Value        = 0
  296.             Visible      = -1
  297.             Width        = Char(26)
  298.         END
  299.         BEGIN Label lblItemsTagged
  300.             Alignment    = 0
  301.             AutoSize     = 0
  302.             BackColor    = QBColor(7)
  303.             BorderStyle  = 0
  304.             Caption      = "Label6"
  305.             DragMode     = 0
  306.             Enabled      = -1
  307.             ForeColor    = QBColor(0)
  308.             Height       = Char(1)
  309.             Left         = Char(47)
  310.             MousePointer = 0
  311.             TabIndex     = 13
  312.             Tag          = ""
  313.             Top          = Char(0)
  314.             Visible      = -1
  315.             Width        = Char(7)
  316.         END
  317.         BEGIN CheckBox chkAllowTag
  318.             BackColor    = QBColor(7)
  319.             Caption      = "&Allow Tagging"
  320.             DragMode     = 0
  321.             Enabled      = -1
  322.             ForeColor    = QBColor(0)
  323.             Height       = Char(1)
  324.             Left         = Char(1)
  325.             MousePointer = 0
  326.             TabIndex     = 9
  327.             TabStop      = -1
  328.             Tag          = ""
  329.             Top          = Char(0)
  330.             Value        = 0
  331.             Visible      = -1
  332.             Width        = Char(22)
  333.         END
  334.     END
  335.     BEGIN Custom CzList
  336.         Action       = 0
  337.         Alignment    = 0
  338.         Archive      = 0
  339.         AutoRedraw   = 0
  340.         BackColor    = QBColor(7)
  341.         BorderStyle  = 1
  342.         Caption      = ""
  343.         Checked      = 0
  344.         Column       = 0
  345.         DragMode     = 0
  346.         Drive        = ""
  347.         Enabled      = -1
  348.         Filename     = ""
  349.         ForeColor    = QBColor(0)
  350.         Height       = Char(8)
  351.         Hidden       = 0
  352.         Interval     = 0
  353.         LargeChange  = 0
  354.         Left         = Char(2)
  355.         ListCount    = 0
  356.         ListIndex    = 0
  357.         Max          = 0
  358.         Min          = 0
  359.         Mode         = 0
  360.         MousePointer = 0
  361.         MultiLine    = 0
  362.         Normal       = 0
  363.         Path         = ""
  364.         Pattern      = ""
  365.         ReadOnly     = -1
  366.         Row          = 0
  367.         ScrollBars   = 0
  368.         SelLength    = 0
  369.         SelStart     = 0
  370.         SelText      = ""
  371.         SmallChange  = 0
  372.         Sorted       = 0
  373.         Style        = 0
  374.         System       = 0
  375.         TabIndex     = 0
  376.         TabStop      = -1
  377.         Tag          = ""
  378.         Text         = ""
  379.         Top          = Char(2)
  380.         TypeID       = "CzList"
  381.         Value        = 0
  382.         Visible      = -1
  383.         Width        = Char(68)
  384.     END
  385.     BEGIN CommandButton cmdCancel
  386.         BackColor    = QBColor(7)
  387.         Cancel       = -1
  388.         Caption      = "&Cancel"
  389.         Default      = 0
  390.         DragMode     = 0
  391.         Enabled      = -1
  392.         Height       = Char(3)
  393.         Left         = Char(60)
  394.         MousePointer = 0
  395.         TabIndex     = 1
  396.         TabStop      = -1
  397.         Tag          = ""
  398.         Top          = Char(19)
  399.         Visible      = -1
  400.         Width        = Char(10)
  401.     END
  402.     BEGIN CommandButton cmdCzDir
  403.         BackColor    = QBColor(7)
  404.         Cancel       = 0
  405.         Caption      = "Cz&Dir"
  406.         Default      = 0
  407.         DragMode     = 0
  408.         Enabled      = -1
  409.         Height       = Char(3)
  410.         Left         = Char(60)
  411.         MousePointer = 0
  412.         TabIndex     = 20
  413.         TabStop      = -1
  414.         Tag          = ""
  415.         Top          = Char(16)
  416.         Visible      = -1
  417.         Width        = Char(10)
  418.     END
  419. END
  420. '****************************************************************************
  421. '
  422. '                             CzarList v1.01
  423. '                               July, 1994
  424. '                        Listbox Controls for VBDOS
  425. '                   Copyright (c) 1994 by CZAR Software
  426. '                           All Rights Reserved.
  427. '
  428. '                              CZAR Software
  429. '                             P.O. Box 370087
  430. '                          El Paso, TX 79937-0087
  431. '                                   USA
  432. '
  433. '                              FIDO: 1:381/99
  434. '                           Voice: 915-593-5007
  435. '                            BBS: 915-595-8705
  436. '                            Fax: 915-595-8787
  437. '                             CIS: 71031,3614
  438. '                              AOL: czarsoft
  439. '                        InterNet: czarsoft@aol.com
  440. '
  441. ' This is a fully functional shareware version. It is not freeware. It
  442. ' demonstrates the functionality of the custom controls CzList,
  443. ' CzDir, and CzFile. You can test and run the custom controls
  444. ' in the VBDOS programming environment using the included .QLB file. Or,
  445. ' run the DEMO.EXE file. The DEMO.EXE file shows three examples of all
  446. ' custom controls. The shareware version does not include the .LIB object
  447. ' library which is required to produce .EXE files.
  448. '
  449. ' If you would like to compile and create .EXE files with the custom
  450. ' controls, you have to register CzarList. Please use file REGISTER.DOC
  451. ' to register.
  452. '
  453. ' Here is what you get when you register CzList:
  454. '
  455. '    o  The CZLIST.LIB object library to build your own EXE files
  456. '    o  A professionally printed and bound manual
  457. '    o  Most current Version of CZLIST.LIB
  458. '    o  Bonus Certificate to get a Shareware CD-ROM for $9.95 + S/H
  459. '    o  Discounts on other CZAR Software products (see CATALOG.DOC)
  460. '    o  FREE, update notices and bug reports
  461. '    o  FREE, lifetime voice Support at 915-593-5007
  462. '    o  FREE, lifetime fax Support
  463. '    o  FREE, lifetime BBS Support at 915-595-8705
  464. '    o  FREE, lifetime CompuServe Support at 71031,3614
  465. '    o  FREE, lifetime AOL Support at czarsoft
  466. '    o  FREE, lifetime InterNet Support at czarsoft@aol.com
  467. '
  468. '****************************************************************************
  469.  
  470. DEFINT A-Z
  471.  
  472. '$FORM frmDemoDir
  473. '$FORM frmGeneral
  474. '$FORM frmOrder
  475.  
  476. ' CzList Internal functions. These functions have to be declared if you
  477. ' want to use them.
  478. DECLARE FUNCTION CzGetWhatKindMem% ()
  479. DECLARE FUNCTION CzItemsTagged% ()
  480. DECLARE FUNCTION CzAllowTagging% (YesNo%)
  481. DECLARE FUNCTION CzKeybTagScrolling% (YesNo%)
  482. DECLARE FUNCTION CzMouTagScrolling% (YesNo%)
  483. DECLARE FUNCTION CzSetVirtualPath% (PathToSet$)
  484.  
  485. ' Demo functions
  486. DECLARE SUB OpeningScreen ()
  487. DECLARE SUB ShowThreeParts ()
  488. DECLARE SUB AboutCzList ()
  489.  
  490. SUB AboutCzList ()
  491.  
  492.     a$ = "CzList is a general listbox control for VBDOS. You can use it to display and list any kind of information. Each element in the listbox can be up to 63 characters long. It fully supports tagging and untagging."
  493. a$ = a$ + CHR$(13) + CHR$(10)
  494. a$ = a$ + CHR$(13) + CHR$(10) + "CzList will first try to use XMS Memory. If no XMS memory is available, it will try to use EMS Memory. If no XMS and no EMS memory is available, CzList will use the disk as virtual memory."
  495. a$ = a$ + CHR$(13) + CHR$(10)
  496. a$ = a$ + CHR$(13) + CHR$(10) + "Keep a close eye on the amount of conventional memory used during this demo. The amount of conventional memory used will not change no matter how many elements you put into CzList."
  497. MSGBOX a$, 0, "CzList Demo"
  498.  
  499. END SUB
  500.  
  501. SUB chkAllowTag_Click ()
  502.  
  503. IF chkAllowTag.Value = 1 THEN
  504.     Result = CzAllowTagging(0)
  505.     Result = CzKeybTagScrolling(0)
  506.     Result = CzMouTagScrolling(0)
  507.     chkKeybTag.Enabled = -1
  508.     chkMouseTag.Enabled = -1
  509.     chkKeybTag.Value = 1
  510.     chkMouseTag.Value = 1
  511. ELSE
  512.     Result = CzAllowTagging(1)
  513.     Result = CzKeybTagScrolling(1)
  514.     Result = CzMouTagScrolling(1)
  515.     chkKeybTag.Enabled = 0
  516.     chkMouseTag.Enabled = 0
  517. END IF
  518.  
  519. END SUB
  520.  
  521. SUB chkKeybTag_Click ()
  522.  
  523. IF chkKeybTag.Value = 1 THEN
  524.     Result = CzKeybTagScrolling(0)
  525. ELSE
  526.     Result = CzKeybTagScrolling(1)
  527. END IF
  528.  
  529. END SUB
  530.  
  531. SUB chkMouseTag_Click ()
  532.  
  533. IF chkMouseTag.Value = 1 THEN
  534.     Result = CzMouTagScrolling(0)
  535. ELSE
  536.     Result = CzMouTagScrolling(1)
  537. END IF
  538.  
  539. END SUB
  540.  
  541. SUB cmdCancel_Click ()
  542.  
  543. ' You must UNLOAD the form or control(s) before you end your program. CzList
  544. ' will then remove itself from memory. If you do not unload the form or
  545. ' control, the memory used by CzList (either XMS, EMS, or disk space) will
  546. ' not be released and unpredictable results may occur.
  547. UNLOAD frmCzList
  548. frmOrder.SHOW 1
  549. END
  550.  
  551. END SUB
  552.  
  553. SUB cmdCzDir_Click ()
  554.  
  555. ' You must UNLOAD the form or control(s) before you end your program. CzList
  556. ' will then remove itself from memory. If you do not unload the form or
  557. ' control, the memory used by CzList (either XMS, EMS, or disk space) will
  558. ' not be released and unpredictable results may occur.
  559. UNLOAD frmCzList
  560. frmDemoDir.SHOW 1
  561.  
  562. END SUB
  563.  
  564. SUB cmdTag_Click ()
  565.  
  566. ' Tag all elements
  567. ' Value = 1     : tag alll elements in CzList
  568. ' Value = 2     : untag alll elements in CzList
  569. CzList.Value = 1
  570.  
  571. ' Display the number of items tagged.
  572. lblItemsTagged.Caption = STR$(CzItemsTagged)
  573.  
  574. CzList.SETFOCUS
  575.  
  576. END SUB
  577.  
  578. SUB cmdUntag_Click ()
  579.  
  580. ' Untag all elements
  581. ' Value = 1     : tag alll elements in CzList
  582. ' Value = 2     : untag alll elements in CzList
  583. CzList.Value = 2
  584.  
  585. ' Display the number of items tagged.
  586. lblItemsTagged.Caption = STR$(CzItemsTagged)
  587.  
  588. CzList.SETFOCUS
  589.  
  590. END SUB
  591.  
  592. SUB CzList_DblClick ()
  593.  
  594. ' Get the current element and display it.
  595. ' CzList.ListIndex is the current Index. You can also get any other
  596. ' index from 0 to ListCount. For example, to get element 189, use
  597. ' Dummy$ = CzList.List(188). Remember, the list starts with element 0.
  598. MSGBOX CzList.List(CzList.ListIndex), 0, "Mouse Double Click"
  599.  
  600. END SUB
  601.  
  602. SUB CzList_KeyDown (KeyCode AS INTEGER, Shift AS INTEGER)
  603.  
  604. ' Display the current index.
  605. lblListIndex.Caption = STR$(CzList.ListIndex)
  606.  
  607. ' Display the number of items tagged.
  608. lblItemsTagged.Caption = STR$(CzItemsTagged)
  609.  
  610. ' The ENTER key was pressed. Get the current element and display it.
  611. ' CzList.ListIndex is the current Index. You can also get any other
  612. ' index from 0 to ListCount. For example, to get element 189, use
  613. ' Dummy$ = CzList.List(188). Remember, the list starts with element 0.
  614. IF KeyCode = 13 THEN MSGBOX CzList.List(CzList.ListIndex), 0, "Pressed Enter Key"
  615.  
  616. END SUB
  617.  
  618. SUB CzList_MouseDown (Button AS INTEGER, Shift AS INTEGER, X AS SINGLE, Y AS SINGLE)
  619.  
  620. ' Display the number of items tagged.
  621. lblItemsTagged.Caption = STR$(CzItemsTagged)
  622.  
  623. END SUB
  624.  
  625. SUB CzList_MouseUp (Button AS INTEGER, Shift AS INTEGER, X AS SINGLE, Y AS SINGLE)
  626.  
  627. ' Display the current index.
  628. lblListIndex.Caption = STR$(CzList.ListIndex)
  629.  
  630. END SUB
  631.  
  632. SUB Form_Load ()
  633.  
  634. OpeningScreen
  635.  
  636. ShowThreeParts
  637.  
  638. AboutCzList
  639.  
  640. ' You can force CzList to use a specific method of storage using the MODE
  641. ' property. Use it only if you really need it. By default, CzList will first
  642. ' try to use XMS memory. If no XMS memory is available, CzList will try to
  643. ' use EMS memory instead. If no EMS memory is available, CzList will then
  644. ' use the disk as virtual memory.
  645. ' If you force CzList to use XMS Memory, CzList will still try to use EMS
  646. ' memory if no XMS memory is available. If no EMS memory is available,
  647. ' CzList will use the disk.
  648. 'CzList.Mode = -1              ' where = -1 (Use XMS Memory)
  649. '                              '       = -2 (Use EMS Memory)
  650. '                              '       = -3 (Use Disk)
  651. ' If you force CzList to use EMS memory, do NOT run your program in the
  652. ' VBDOS environment as it will not work correctly. You have to compile
  653. ' your program into an EXE file.
  654. '
  655. ' NOTE: The MODE property has to be set before you call any other CzList
  656. '       commands and before you load the form or control.
  657.  
  658.  
  659. ' The Max property tells CzList the maximum number of elements ever to
  660. ' be used. This simply means that during runtime you will never use
  661. ' more than Max of elements in the listbox. The default Max is 1023.
  662. ' You do not need to set the Max property if you are sure that you will
  663. ' never need more than 1024 elements. You can only set the Max property
  664. ' once. You should do this when your program first starts up or set the
  665. ' Max property in the Form Designer. Once the Max property has been set,
  666. ' it MUST not be changed during runtime.
  667. '
  668. ' The default value is 1023. The maximum is 32765. 32765 elements require
  669. ' apx. 2.1 MBytes (XMS, EMS, or disk) whereas 1024 elements require apx.
  670. ' 65 KBytes (XMS, EMS, or disk).
  671.  
  672. Dummy$ = INPUTBOX$("How many elements (Starting with element 0) would you like to put into the ListBox control? Maximum # of elements is 32765 (starting with element 0). It will use either XMS or EMS memory, or diskspace. Enter -1 for no elements." _
  673. , "", "1999")
  674. IF LEN(Dummy$) > 5 THEN
  675.     NumElements& = VAL(LEFT$(Dummy$, 5))
  676. ELSE
  677.     NumElements& = VAL(Dummy$)
  678. END IF
  679. IF NumElements& > 32765 THEN NumElements& = 32765
  680.  
  681. ' Display status window
  682. frmGeneral.Label1.Caption = "One moment...adding" + STR$(NumElements& + 1) + " elements."
  683. frmGeneral.SHOW
  684.  
  685. CzList.Max = NumElements&
  686.  
  687. FOR i = 0 TO NumElements&                    ' Create up to NumElements&
  688.     CzList.ADDITEM STR$(i) + STRING$(62, "*") ' elements and add them into
  689. NEXT                                         ' CzList. NOTE: The maximum
  690.                                                             ' length of each string is 63.
  691.                                                             ' The actual length stored is
  692.                                                             ' 63 plus 1 Tag character
  693.                                                             ' "√" = 64. If the string is
  694.                                                             ' not tagged, a space is used.
  695.                                                             ' Make sure you use a space
  696.                                                             ' (CHR$(32)) as the first
  697.                                                             ' character. Later in your
  698.                                                             ' program, you can check if the
  699.                                                             ' item is tagged or not by
  700.                                                             ' checking the first character
  701.                                                             ' for a CHR$(32) = Not tagged,
  702.                                                             ' or a CHR$(251) = Tagged.
  703.  
  704. 'CzList.Sorted = -1  ' Set the SORTED property to true (-1) if you want the
  705.               ' list to be sorted. CzList will only sort the list
  706.               ' everytime you set the SORTED property. It will not
  707.               ' sort the list when you use the ADDITEM method. The
  708.               ' more elements you have stored in CzList, the longer
  709.               ' it will take to sort CzList. This can take a very
  710.               ' long time if you have up to 32,765 elements. The
  711.               ' internal sorting method is a Shellsort. The Shellsort
  712.               ' is by far the fastet sorting method compared to other
  713.               ' sorting algorithms such as bubble sort, exchange sort,
  714.               ' quick sort, etc. The sorting routine in CzList is
  715.               ' written in optimized VBDOS source code because there
  716.               ' are no sorting algorithms for XMS or EMS data that
  717.               ' can be used with VBDOS custom controls.
  718.               
  719. lblListIndex.Caption = STR$(CzList.ListIndex) ' Display the current index.
  720.  
  721. lblItemsTagged.Caption = STR$(CzItemsTagged)  ' Display the number of items
  722.                             ' tagged.
  723.  
  724. ' Display the number of elements used.
  725. Label2.Caption = "Number of elements =" + STR$(NumElements& + 1)
  726.  
  727. 'Result = CzSetVirtualPath$("I:\TEMP")
  728. ' If CzList uses the disk as virtual memory, you will see a slowdown in
  729. ' performance the more elements you use. For this reason, you can tell
  730. ' CzList where to store the temporary disk file(s) by setting
  731. ' CzSetVirtualPath$ to the path you want to use. It is recommended to
  732. ' use a RAMDRIVE for this purpose. If you do not specify a path for
  733. ' CzSetVirtualPath$, CzList will use the current path.
  734. '
  735. ' Note: You MUST set CzSetVirtualPath$ before you set the Max Property.
  736. '       The best way to do this is to set CzSetVirtualPath$ as the first
  737. '       command in your FORM_LOAD procedure.
  738. '
  739. ' Make sure the drive has enough space left to save the disk file(s). You
  740. ' can calculate the amount of bytes needed using the following formular:
  741. '
  742. ' DiskSpace& = (CzList.Max + 1) * 64
  743. '
  744. ' For example, if you want to use 2000 elements and CzList needs to use
  745. ' the disk, you would have to make sure that there are at least
  746. ' 1,999 + 1 * 64 = 128,000 Bytes available.
  747.  
  748. MemoryUsed& = (NumElements& + 1) * 64
  749. SELECT CASE CzGetWhatKindMem
  750.     CASE -1   ' Use XMS
  751.         d$ = "XMS Memory"
  752.     CASE -2   ' Use EMS
  753.         d$ = "EMS Memory"
  754.         ' EMS requires additional 16 KBytes for memory page slackspace
  755.         MemoryUsed& = ((NumElements& + 1) * 64) + 16384
  756.     CASE ELSE
  757.         d$ = "Disk"
  758. END SELECT
  759.  
  760. ' Show the amount of memory or disk space used.
  761. Label3.Caption = "Used =" + STR$(MemoryUsed&) + " Bytes (" + d$ + ")"
  762.  
  763. ' Show the amount of conventional memory used.
  764. Label7.Caption = "Conventional Memory Free =" + STR$(FRE(-1)) + " Bytes"
  765.  
  766. ' ***** Setup Scrolling and Tagging *****
  767. ' Result = The current status, which is either 0 or 1
  768. ' Result = CzAllowTagging(0)       ' 1 = Disable, 0 = Enable
  769. ' Result = CzKeybTagScrolling(0)   ' 1 = Disable, 0 = Enable
  770. ' Result = CzMouTagScrolling(0)    ' 1 = Disable, 0 = Enable
  771.  
  772. IF CzAllowTagging(0) = 0 THEN
  773.     chkAllowTag.Value = 1
  774.     IF CzKeybTagScrolling(0) = 0 THEN
  775.         chkKeybTag.Value = 1
  776.     ELSE
  777.         chkKeybTag.Value = 2
  778.     END IF
  779.     IF CzMouTagScrolling(0) = 0 THEN
  780.         chkMouseTag.Value = 1
  781.     ELSE
  782.         chkMouseTag.Value = 2
  783.     END IF
  784. END IF
  785.  
  786. ' Unload status window
  787. UNLOAD frmGeneral
  788.  
  789. Left = ((SCREEN.Width - Width) / 2)   ' Center form horizontally
  790. Top = ((SCREEN.Height - Height) / 2)  ' Center form vertically
  791.  
  792. END SUB
  793.  
  794. SUB OpeningScreen ()
  795.  
  796.     a$ = "             CzarList v1.01"
  797. a$ = a$ + CHR$(13) + CHR$(10) + "       Listbox Controls for VBDOS"
  798. a$ = a$ + CHR$(13) + CHR$(10) + "   Copyright (c) 1994 by CZAR Software"
  799. a$ = a$ + CHR$(13) + CHR$(10) + "          All Rights Reserved"
  800. a$ = a$ + CHR$(13) + CHR$(10)
  801. a$ = a$ + CHR$(13) + CHR$(10) + "             CZAR Software"
  802. a$ = a$ + CHR$(13) + CHR$(10) + "            P.O. Box 370087"
  803. a$ = a$ + CHR$(13) + CHR$(10) + "         El Paso, TX 79937-0087"
  804. a$ = a$ + CHR$(13) + CHR$(10) + "                  USA"
  805. a$ = a$ + CHR$(13) + CHR$(10)
  806. a$ = a$ + CHR$(13) + CHR$(10) + "          Voice: 915-593-5007"
  807. a$ = a$ + CHR$(13) + CHR$(10) + "           BBS: 915-595-8705"
  808. a$ = a$ + CHR$(13) + CHR$(10) + "           Fax: 915-595-8787"
  809. a$ = a$ + CHR$(13) + CHR$(10) + "            FIDO: 1:381/99"
  810. a$ = a$ + CHR$(13) + CHR$(10) + "            CIS: 71031,3614"
  811. a$ = a$ + CHR$(13) + CHR$(10) + "             AOL: czarsoft"
  812. a$ = a$ + CHR$(13) + CHR$(10) + "       InterNet: czarsoft@aol.com"
  813. MSGBOX (a$)
  814.  
  815. END SUB
  816.  
  817. SUB ShowThreeParts ()
  818.  
  819.     a$ = "This demo consists of three parts:"
  820. a$ = a$ + CHR$(13) + CHR$(10)
  821. a$ = a$ + CHR$(13) + CHR$(10) + "    ■ A demonstration of CzList (a general listbox)"
  822. a$ = a$ + CHR$(13) + CHR$(10) + "    ■ A demonstration of CzDir (a directory listbox)"
  823. a$ = a$ + CHR$(13) + CHR$(10) + "    ■ A demonstration of CzFile (a file listbox)"
  824. a$ = a$ + CHR$(13) + CHR$(10)
  825. a$ = a$ + CHR$(13) + CHR$(10) + "To see the demonstration for CzList, click the OK button."
  826. MSGBOX (a$)
  827.  
  828. END SUB
  829.  
  830.