home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 26 / CD_ASCQ_26_1295.iso / vrac / mlist460.zip / README.TXT < prev    next >
Text File  |  1995-09-06  |  43KB  |  1,134 lines

  1. ***************************************************************************
  2. *
  3. *  README.TXT
  4. *
  5. *  Klasman Quality Consulting, Inc.
  6. *  13 Vespa Lane
  7. *  Nashua, NH 03060
  8. *
  9. *  CompuServe:     70233,1476
  10. *  Internet:    klasman@kqc.mv.com
  11. *
  12. *  MLIST.VBX    V4.60.0000
  13. *
  14. *  11:51 PM 9/4/95
  15. *
  16. *  Multi-Purpose List Box Control for Visual Basic 3.0
  17. *
  18. ***************************************************************************
  19.  
  20. ATTENTION
  21.  
  22. Now under new ownership. On August 1, 1995, Robin McKean transfered
  23. ownership of his VB Custom Control suite (MLIST.VBX, MCOMBO.VBX,
  24. MPOPUP.VBX, TBAR.VBX) to my company, Klasman Quality Consulting,
  25. Inc.
  26.  
  27. I would like to thank Robin, for without his vision, skills and 
  28. determination, this software would not exist. And also for giving us 
  29. the opportunity and responsibility for moving this software into the 
  30. future.
  31.  
  32. Kevin M. Klasman, President
  33.  
  34. ***************************************************************************
  35.  
  36. MLIST is a custom control for managing the way your data appears in a list
  37. box.  MLIST is a property for property replacement of the standard List Box
  38. control which comes with Visual Basic 3.0.  In addition, there are many more
  39. features which MLIST can do that you can't do with the normal List Box.  Some
  40. of these features are:
  41.  
  42.     * Set up owner draw columnar data in the list box.  This is NOT a
  43.       MULTI-COLUMN list box.  MLIST now has this feature, but the MLIST
  44.       List Box scrolls vertically, like a normal list box.  Your data is
  45.       arranged in columns, with specific drawing flags setup for each
  46.       "Drawing Region".  Think of each line as being broken up into
  47.       different areas, each with its own drawing flags and data.
  48.  
  49.     * Make a drawing region a bitmap or a checkbox.  You have control
  50.       over the entire list's bitmaps through the default bitmap property,
  51.       or you can set individual lines bitmap properties.
  52.  
  53.     * Control individual line colors in the list box
  54.  
  55.     * Total control over the checked and unchecked states of lines
  56.  
  57.     * Now MLIST has aligned bitmaps as well.  You specifiy the bitmap,
  58.       the text, and the alignment (top, bottom, right, left), and MLIST
  59.       will draw the text and the bitmap in the area you define.
  60.  
  61.     * New in verions 4.00.  You can now have true MUTLIPLE COLUMN list
  62.       boxes, with bitmaps and check boxes.  Multiple columns are set
  63.       up through setting the LBS_MULTICOLUMN style for the list box.
  64.       You control the width of each item.  This attribute differs in
  65.       that each line has a certain width.  So it may take two or more
  66.       columns of items to actually fill a line
  67.  
  68.     * Checking and Selecting a range of line items
  69.  
  70.     * Properties to find closest match and find exact matches in the
  71.       list box.
  72.  
  73.     * Complete control over colors in the list box.  Colors can be
  74.       set for normal lines, individual lines, normal highlight colors,
  75.       and individual highlight colors.
  76.  
  77.     * MList V4.10 now has 3-D effects
  78.  
  79.     * You can now setup vertical and horizontal grids
  80.  
  81.     * Virtual List Boxes.  A notification event is sent when more data
  82.       is required by the application.
  83.  
  84.     * Properties to aide you in drag and drop, including identifying
  85.       which line item was dropped upon, and being able to select
  86.       multiple line items before starting a drag
  87.  
  88.     * New ScrollMessage event for drawing column headers over scrolling
  89.       list boxes
  90.  
  91.     * Handle entire drawing of items in your code
  92.  
  93.     * Set individual fonts for individual lines
  94.  
  95.     * Resort entire lists
  96.  
  97.     * Resize list box to fit windows
  98.  
  99.     * Improved string searching
  100.  
  101.     * Variable height lines in the list box
  102.  
  103. ***************************************************************************
  104.  
  105. NEW IN VERSION 4.60
  106.  
  107.     Little has changed since version 4.58. Help has been 
  108.     updated, since several minor revisions had been released
  109.     without updating Help. Several bugs have also been fixed.
  110.     See BUG.TXT for details.
  111.  
  112.     This release is primarily in response to the transfer of 
  113.     ownership. Look for a release in the fall... the contents 
  114.     of which remain to be seen...
  115.  
  116. ***************************************************************************
  117.  
  118. This ZIP file contains:
  119.  
  120.     BUG.TXT        List of bug fixes.
  121.  
  122.     FINDSTR.FRM    Form for FindString Demo
  123.     FINDSTR.MAK    FindString and FindStringExact Demo
  124.  
  125.     DEMO.MAK        Sample project file for MLIST
  126.     DEMO.FRM           Form used by the DEMO.MAK
  127.     DEMO.FRX           Binary part of form used by DEMO.MAK
  128.     PLUS.BMP        Bitmap used in DEMO.MAK
  129.     PAGE.BMP        Ditto
  130.  
  131.     MLIST.VBX       VB version of the MLIST custom control
  132.     MLIST.HLP       Windows Help file for MLIST
  133.  
  134.     README.TXT      This file
  135.  
  136.     ITEMPIC.MAK     ItemPicture property example
  137.     ITEMPIC.FRM     Form for this project (follow instructions
  138.               in Help)
  139.  
  140.     SCROLL.MAK      Scrolling column header examples
  141.     SCROLL.FRM      Form for scrolling example
  142.  
  143.     VIRTUAL.MAK     Virtual List Box example
  144.     VIRTUAL.FRM     Form for virtual list box
  145.  
  146. ***************************************************************************
  147.  
  148. REGISTRATION
  149.  
  150. This Multi-Column List Box is Shareware.  It is NOT crippled in anyway.
  151. When you download this custom control, you have the same custom control that
  152. I am using in my everyday VB programming.  As a Shareware contributor, I am
  153. counting on the honor and moral fiber of every person who downloads this
  154. custom control to do the right thing.  
  155.  
  156. Right now, the maximum region size in the List Box is 2048 characters.  You
  157. can have as many 2048 regions as you want.  Let me know if this causes a
  158. problem.  I don't anticipate anyone needing to display more than this number
  159. of characters to the screen.
  160.  
  161. If you like and appreciate (and more importantly, use) this custom control...
  162.  
  163.   1)  Send $25.00 to the address listed above, or
  164.   2)  Register in the Compuserve SWREG forum, ID 7286
  165.  
  166. Registered users may purchase the source...
  167.  
  168.   1)  Send $50.00 to me at the above address.
  169.   2)  Register in the SWREG Forum, ID tbd.
  170.  
  171.   If you register via CompuServe, the source will be e-mailed to you.  Please
  172.   remember, you may not purchase source unless you are a registered user.
  173.  
  174.   This control is written in C++ and has been compiled using Visual C++ 1.52.
  175.  
  176. You may now register this control in the SWREG on Compuserve.  Type GO SWREG, 
  177. ID 7286.
  178.  
  179. ***************************************************************************
  180.  
  181. WARRANTY
  182.  
  183. Klasman Quality Consulting, Inc. disclaims all warranties, either express or 
  184. implied, including, but not limited to, implied warranties of merchantibility 
  185. and fitness for a particular purpose, with regard to the SOFTWARE, the sample 
  186. applications and the accompanying written materials.
  187.  
  188. ***************************************************************************
  189.  
  190. WARNING
  191.  
  192. MList is an owner draw list box.  Therefore, use the SendMessage API call
  193. with care when MList is your target.  Some messages assume that the list
  194. box has the LBS_HASSTRINGS style, which MList does not.  MList will GPF 
  195. when these messages are processed.
  196.  
  197. ***************************************************************************
  198.  
  199. PROGRAMMER'S NOTES (or, what I need to know to use this custom control)
  200.  
  201. The Multi-Column List Box is an enhanced List Box control. MLIST now
  202. contains all standard listbox properties. The following is a description of 
  203. each additional property.  What it does, and how to use it in your own VB 
  204. programming.  For help with these properties, see the Help included with VB.  
  205. The ones listed below are additions.
  206.  
  207.  
  208. ItemHeight
  209.  
  210. This property is responsible for controlling the height of each individual
  211. line item in the list box.  It defaults to 195 Twips, the height of the
  212. font used by the standard list box.  You should adjust this height if you
  213. change the font, font size, etc..
  214.  
  215. I'm not sure whether or not this property will change the height of the lines
  216. after the list box has already been created.  I did not design the list box
  217. control to have the height of the items change dynamically.  Set the height
  218. of this item at design time, and the font, and your list box will be fine.
  219. Experiment with this during run-time if you like, and let me know how it
  220. works out, and how I can make this item work more to your liking.
  221.  
  222. DrawRegions
  223.  
  224. This item determines the number of drawing regions on each line.  This is
  225. basically equivelent to the number of COLUMNS, but this list box will still
  226. scroll like a normal list box.  When setting this property, the control
  227. clears the flags for the draw regions and sets them to left aligned, single
  228. line, and centered vertically.  Consult the Windows API for DrawText to
  229. see what exactly these flags mean.
  230.  
  231. ItemLength
  232.  
  233. This is an indexed property which corresponds to the length of each drawing
  234. region.  If you want a drawing region to be a specific length, set that
  235. drawing region's length to the desired setting in twips.  For example...
  236.  
  237.     MList1.DrawRegions = 2
  238.     MList.ItemLength(1) = 500
  239.     MList.ItemLength(2) = 500
  240.  
  241.     ' Generates an out of index error
  242.     MList1.ItemLength(0) = XXX
  243.     MList1.ItemLength(3) = XXX
  244.  
  245. It is probably a good idea to set the lengths of all drawing regions when you
  246. are changing the defaults.
  247.  
  248. DrawFlags
  249.  
  250. This is an indexed property which corresponds to the flags of each drawing
  251. region.  If you want a drawing region to be drawn in a specific manner, set
  252. that drawing region's flags to the desired settings.  For specific flags,
  253. look up the DrawText API function in the Windows API Reference.  In the
  254. following example, I setup two drawing regions and set the second drawing
  255. region's flags to right justify the text.  In this example, the second
  256. drawing region displays currency values.
  257.  
  258.     Const DT_RIGHT = 2
  259.     Const DT_VCENTER = 4
  260.     Const DT_SINGLELINE = 32
  261.  
  262.     MList1.DrawRegions = 2
  263.     MList1.DrawFlags(2) = DT_RIGHT + DT_VCENTER + DT_SINGLELINE
  264.     MList.ItemLength(1) = 500
  265.     MList.ItemLength(2) = 500
  266.  
  267. If you are planning to include the '&' character in your strings, you
  268. should include the DT_NOPREFIX flag to avoid the underline.  I do NOT
  269. automatically add this flag for you, as I want you to have total control
  270. over the flags.
  271.  
  272. ActiveRegion
  273.  
  274. Setting this property affects the next two properties.  It defines the
  275. DrawingRegion (or index or column) that TextRegion and ListRegion will
  276. return.  Perhaps an example is in order.
  277.  
  278. My list box is divided up into three columns, name, account number, dollar
  279. amount.  I want to get the account number for the currently selected line
  280. as well as the first item...
  281.  
  282.     MList1.ActiveRegion = 2
  283.     aString$ = MList1.TextRegion    ' Gets 2nd column of current text
  284.     bString$ = MList1.ListRegion(0) ' 2nd column of item at index 0
  285.  
  286. TextRegion
  287.  
  288. This property will return the ActiveRegion in the currently selected text.
  289. See the above "ActiveRegion".  Corresponds to a DrawRegion of the Text property.
  290. These values can also be written to at run time.
  291.  
  292. ListRegion
  293.  
  294. This property will return the ActiveRegion in the item at the specific index.
  295. See the above "ActiveRegion".  Corresponds to a DrawRegion of the List property.
  296. These values can also be written to at run time.
  297.  
  298. DefPicture
  299.  
  300. This is the default bitmap to be displayed in the ImageRegion when a specific
  301. bitmap has not been assigned to that items ItemPicture property.  Please see
  302. the demo on setting your own default picture and ItemPicture properties.
  303.  
  304. ImageType
  305.  
  306. This determines what type of image we are dealing with in our image region.
  307. If this property is set to 0, then the ImageRegion property is ignored and
  308. only text is displayed.  If this image type is valid, then a checkbox or
  309. bitmap/icon is displayed in the ImageRegion.
  310.  
  311. Note that when the image type is set to AlignBitmap, the normal drawing
  312. regions no longer apply.  Anybody got a problem with that???
  313.  
  314. ImageRegion
  315.  
  316. This property specifies which region contains the image region.  This value
  317. should be any number between 1 and the number of DrawRegions.  You may not
  318. set this property to a value of less than zero or greater then DrawRegions.
  319. When setting up your DrawRegions, the following is a good example:
  320.  
  321.     MList1.DrawRegions = 3
  322.     MList1.ImageRegion = 1
  323.  
  324.     MList1.ItemLength(1) = 100              ' Bitmap or Icon is in here
  325.     MList1.ItemLength(2) = 500
  326.     MList1.ItemLength(3) = 750
  327.  
  328.     ' Don't leave a space for the ImageRegion in your strings
  329.     MList1.AddItem "Region2" + Chr$(9) + "Region3"
  330.     MList1.AddItem "Region22" + Chr$(9) + "Region33"
  331.  
  332. The ImageRegion is ignored when calculating the "piece" of text that goes in
  333. that region.
  334.  
  335. Checked
  336.  
  337. This property is very similar to the Selected property.  In a Multi-Column
  338. list box with the ImageType set 2 (CheckBox), this property will return to
  339. you whether or not that line item is checked or not.  For example:
  340.  
  341.     For X% = 0 To MList1.ListCount - 1
  342.  
  343.         If MList1.Checked(X%) Then
  344.             Debug.Print "I am Checked! "; X%
  345.         Else
  346.             Debug.Print "I am not checked! "; X%
  347.         End If
  348.     Next X%
  349.  
  350.     ' Check the first item
  351.     MList1.Checked(0) = True
  352.  
  353. ItemPicture
  354.  
  355. This property is an array of pictures which correspond to the bitmaps for
  356. each line item in the list box.  If this item is not set by you, then
  357. the MList uses the DefPicture property.
  358.  
  359.     ' Change the first items picture in the list box
  360.     MList1.ItemPicture(0) = Image1.Picture
  361.  
  362. ItemForeColor
  363.  
  364. This property is an array of color which correspond to the foreground color
  365. for each line item in the list box.  If this item is not set by you, then
  366. the MList uses the default foreground color property.
  367.  
  368.     ' Change the first items foreground color to white
  369.     MList1.ItemForeColor(0) = RGB(255,255,255)
  370.  
  371. ItemBkColor
  372.  
  373. This property is an array of color which correspond to the background color
  374. for each line item in the list box.  If this item is not set by you, then
  375. the MList uses the default background color property.
  376.  
  377.     ' Change the first items background color to black
  378.     MList1.ItemBkColor(0) = RGB(0,0,0)
  379.  
  380. Alignment
  381.  
  382. This property controls the placement of the bitmap when the image type is
  383. set to 4, AlignBitmap.  See the demo for details, but basically the values
  384. for this property are:
  385.  
  386. 1 - Align the bitmap or icon to the left, centered, then the text, centered
  387.     vertically and left justified.
  388. 2 -     Align the bitmap or on top, centered, then the text, centered
  389.     horizontally and vertically.
  390. 3 - Align the bitmap or icon to the right, centered, then the text, centered
  391.     vertically and left justified.
  392. 4 -     Align the bitmap or icon on bottom, centered, then the text, centered
  393.     horizontally and vertically.
  394.  
  395. Note that when the image type is set to AlignBitmap, the normal drawing
  396. regions no longer apply.  Anybody got a problem with that???
  397.  
  398. MultiColumn
  399.  
  400. This turns the list box into a true multiple column list box.  The list box
  401. will scroll horizontal instead of vertical.  A default item width is provided,
  402. but you, the developer, should override this property.  This property should
  403. be set to true for multi-column, or false (the default) for normal list box
  404. behavior.
  405.  
  406. ItemWidth
  407.  
  408. The property specifies the width of each line in a multiple column list box.
  409. The width is set in Twips.  The normal drawing regions still apply, but I
  410. can't think of a reason why someone would want to divide line items in a
  411. column list box into more columns.
  412.  
  413. FindString
  414.  
  415. Setting this property will cause the list box to search for a string with
  416. the closest match from the current ListIndex.  If one is found, that string
  417. is set to the current ListIndex.  This is useful for moving items through
  418. a list box while typing the string in an edit control, ie.  Search in Help.
  419.  
  420. FindStringExact
  421.  
  422. This property is the same as above, except that it will search for an exact
  423. match.
  424.  
  425. RangeStart
  426.  
  427. This property marks the beginning line item for RangeSelected or RangeChecked.
  428. The offset is 0 based, so the first item is 0.
  429.  
  430. RangeEnd
  431.  
  432. This property marks the ending line item for RangeSelected or RangeChecked.
  433.  
  434. RangeSelected
  435.  
  436. All items in the range RangeStart to RangeEnd are marked as selected in the
  437. list box.  If the list box is not multi-select, then this is ignored.
  438.  
  439.     MList1.RangeStart = 0
  440.     MList1.RangeEnd = 3
  441.     MList1.RangeSelected = True
  442.  
  443. RangeChecked
  444.  
  445. All items in the range RangeStart to RangeEnd are marked as checked in the
  446. list box.
  447.  
  448.     MList1.RangeStart = 0
  449.     MList1.RangeEnd = 3
  450.     MList1.RangeChecked = False
  451.  
  452. SetHzScroll
  453.  
  454. When all is said and done, and you are through setting up your list box, and
  455. your columns extend past the displayable area of the list box, setting this
  456. property to True will cause the MLIST control to add up all of the drawing
  457. regions and add a horizontal scroll bar to the list box if one is neccessary.
  458.  
  459.  
  460. HiliteForeColor,
  461.  
  462. This is the default foreground color to use when a line in the list box is
  463. hilited.  If these colors are set, then the normal colors are ignored, and
  464. the HiliteForeColor is used to draw the text, and HiliteBackColor is used
  465. to draw the background.
  466.  
  467. You may force MList to use the default colors by setting this color equal
  468. HiliteBackColor.
  469.  
  470. HiliteBackColor,
  471.  
  472. This is the default background color to use when a line in the list box is
  473. hilited.  If these colors are set, then the normal colors are ignored, and
  474. the HiliteForeColor is used to draw the text, and HiliteBackColor is used
  475. to draw the background.
  476.  
  477. You may force MList to use the default colors by setting this color equal
  478. HiliteForeColor.
  479.  
  480. ItemHiliteForeColor,
  481.  
  482. This is a property array, which corresponds to each line item in the list box.
  483. Using this property, you can set the foreground and background hilited color
  484. of individual line items.
  485.  
  486.     MList1.ItemHiliteForeColor(0) = RGB(0,0,0)
  487.     MList1.ItemHiliteBackColor(0) = RGB(255,255,255)
  488.  
  489. ItemHiliteBackColor,
  490.  
  491. This is a property array, which corresponds to each line item in the list box.
  492. Using this property, you can set the foreground and background hilited color
  493. of individual line items.
  494.  
  495.     MList1.ItemHiliteForeColor(0) = RGB(0,0,0)
  496.     MList1.ItemHiliteBackColor(0) = RGB(255,255,255)
  497.  
  498. MaskingColor
  499.  
  500. This color is used to mask out colors in your bitmaps when they are included
  501. in your MList Box.  For example, lets say that you know you are not going
  502. to use the color white in your bitmaps or list boxes, so, you can set all the
  503. pixels in your bitmap, which you want to be transparent to white, and the
  504. natural color of the list box will show through your bitmap wherever the color
  505. white is.  Think of this as the transparent color, like in Icons, except you
  506. get to determine what it is.
  507.  
  508. HorizontalGrids
  509.  
  510. Set this property to true, if you want to allow horizontal grid lines to be
  511. drawn on your list box.
  512.  
  513. VerticalGrids
  514.  
  515. Set this property to true, if you want to allow vertical grid lines to be
  516. drawn on your list box.
  517.  
  518. GridStyle
  519.  
  520. This determines what line style is used to draw the grid lines.  This didn't
  521. quite turn out the way I wanted, but experiment if you like, and give me
  522. some suggestions.
  523.  
  524. BorderStyle
  525.  
  526. This property controls the border style of the list box.  Valid values are normal,
  527. raised, and inset.
  528.  
  529. RiseColor
  530.  
  531. This is the color of the rising edge of a 3-D list box.  Default color is white.
  532.  
  533. FallColor
  534.  
  535. This is the color of the falling edge of the 3-D list box.  The default color
  536. is a dark grey color.
  537.  
  538. Version
  539.  
  540. This property was included by me to insure backwards compatibility.  You don't
  541. need to be concerned with its use, as I use it for different things.
  542.  
  543. ExtendedSelect
  544.  
  545. This property will allow multiple select list boxes to be accessed via
  546. extended selection.  This causes the listbox to be created with the
  547. LBS_EXENDEDSEL style.  See the MS-Windows SDK help for more on extended
  548. select.
  549.  
  550. GridColor
  551.  
  552. This property determines the color of the horizontal and vertical grids.
  553. The default color is black.  I prefer light grey.
  554.  
  555. FindDirection
  556.  
  557. This property now determines which direction a FindString, FindPattern,
  558. FindPatternColumn, FindStringExact will search the list.  If set to 0,
  559. the search will begin at the currently active ListIndex and search to
  560. the bottom of the list.  If set to one, MList will begin at the current
  561. ListIndex and search to the top of the list.
  562.  
  563. EnableVirtualMsgs
  564.  
  565. This property enables virtual messages.  Setting this property to True
  566. causes a message to be sent to the VirtualMessage event whenever the
  567. user approaches the beginning or end of the list.  These messages are
  568. sent whether caused by a mouse or keyboard event.  See VirtualMessage
  569. event for details.
  570.  
  571. VirtualMsgZone
  572.  
  573. This property determines when a virtual message event is sent.  This
  574. property indicates then "zone" at the beggining and end of the list
  575. that triggers the event.  For example, setting this property to 100,
  576. would cause a VIRTUAL_END event to be sent to VirtualMessage when the
  577. user got within a 100 lines of the end of the list box, and a
  578. VIRTUAL_BEGIN event when the user gets within 100 lines of the begging
  579. of the list box.  The event is only triggered if the user is heading
  580. towards the respective end of the list box.
  581.  
  582. CheckStyle
  583.  
  584. This property deterines the type of "checkbox" displayed by a checkbox
  585. style MList.  When this property is set to 0, the normal "cross/diagonal"
  586. check box is used.  When set to one, a check mark is placed in the box
  587. instead.
  588.  
  589. CheckColor
  590.  
  591. This property determines the color of the check mark.
  592.  
  593. SortColumn
  594.  
  595. When using the DrawRegions property, this property can be used to determine
  596. which piece of your string determines the sort order.  For example:
  597.  
  598.     MList1.DrawRegions = 2
  599.     MList1.SortColumn = 2
  600.     MList1.AddItem "100" + Chr$(9) + "High"
  601.     Mlist1.AddItem "101" + Chr$(9) + "Critical"
  602.  
  603. This example would sort the list box by priority.  Only strings added after
  604. this property is set will be affected.  If this property is changed after
  605. the strings are added, you will have to remove all the strings and then re-add
  606. them.  I thought about doing this myself, but the issues over preserving
  607. pictures, drawing info, and all that other stuff made it a little more difficult
  608. than I care to tackle at this moment.
  609.  
  610. Setting this property to 0 sorts based on the entire string.
  611.  
  612. SelectMode
  613.  
  614. This property will help you when you want to drag and drop with a mutli-select/
  615. extended select list box.  When using the normal extended select/multi-select
  616. list box, after selecting X number of items, if you select a hilited item with
  617. the mouse, all the other items are de-selected.  This is a problem when trying
  618. to drag and drop multiple items from the list.  Setting this property to 1
  619. (Drag and Drop) causes the left mouse click to "Ignored" when the item begin
  620. selected is already hilited.  This allows the user to start the drag (MouseMove),
  621. and you, the developer, can then set MList1.Drag 1, so dragging can begin.  If the
  622. user releases the drag over the same list box, nothing changes.  If the user moves
  623. over other controls, you will get the appropriate messages.
  624.  
  625. Clicking on a hilited item, and not moving the mouse, then releasing the mouse over
  626. the same spot, will de-select all other items in the list box, except for the one
  627. over which the mouse was released.
  628.  
  629. All in all, this property causes MList to behave like the File Manager program which
  630. comes with Windows.  See the Demo and File Manager for examples of the behavior.
  631.  
  632. ItemX
  633.  
  634. This property is available only at run time.  You may set this property in conjunction
  635. with ItemY to determine which item in the list is currently under mouse events.
  636.  
  637. ItemY
  638.  
  639. This property is available only at run time.  You may set this property in conjunction
  640. with ItemX to determine which item in the list is currently under mouse events.
  641.  
  642. Item
  643.  
  644. This property returns the Index of the string at ItemX and ItemY.  Here is
  645. an example that determines over which item a control was dropped:
  646.  
  647.     Sub MList1_DragDrop (Source As Control, X As Single, Y As Single)
  648.  
  649.         MList1.ItemX = X
  650.         MList1.ItemY = Y
  651.  
  652.         Debug.Print "Control was dropped over item at Index";Str$(MList1.Item)
  653.  
  654.     End Sub
  655.  
  656. This property starts the search at TopIndex, since it assumes that the
  657. item you are looking for is currently displayed in the list box.
  658.  
  659. StringCompare
  660.  
  661. This property determines whether compares are case sensitive or case
  662. insensitive.  This only affects the compare when determining placement
  663. in a Sorted list box.  This does not affect FindString and FindStringExact
  664. properties.
  665.  
  666. Resort
  667.  
  668. Setting this property to 1 causes the list box to resort itself, provided
  669. of course that it is a sorted list box.  Additionally, the sort may fail
  670. if there is not enough disk space for resorting.
  671.  
  672. NoIntegralHeight
  673.  
  674. Set this property to True if you want to be able to size the list box to fit
  675. inside the entire window.  Normal Windows forces the list box to be an exact
  676. fit for the height of each line item.  For example:  If you have room for ten
  677. line items, and each line item is 195 twips high, Windows will resize the list
  678. box to 1950 even if you tell it to set the list box to 2015.
  679.  
  680. DisableDrawing
  681.  
  682. I added this property to enable the developer to suspend drawing until font
  683. changes, position changes, etc. are completed.  For example, you might want
  684. to set this property to True while you are changing the font characteristics
  685. of a line that is visible in the list box.  Before you set the last font
  686. attribute, set this value to False, and the line will redisplay itself with
  687. the correct font.
  688.  
  689. ItemFontBold
  690.  
  691. This property controls the bold attribute of an individual line item.  Set this
  692. property to true to cause that lines text to be displayed in bold.  A word of
  693. caution...  Setting the individual font attributes of each line will cause a
  694. font for that line to be created.  Windows will only support so many fonts.
  695. If you are going to be setting individual fonts, consider using the UNIMPLEMENTED
  696. property which will accept an actual font handle.  See UNIMPLENTED for details.
  697.  
  698.     MList1.ItemFontBold = True
  699.  
  700. ** You should set the font name before setting this property. **
  701.  
  702. ItemFontItalic
  703.  
  704. This property controls the italicized property of the font for a specific line.
  705. If you want a lines text to appear italicized, set this property to true for
  706. a specific line.
  707.  
  708.     MList1.ItemFontItalic = True
  709.  
  710. ** You should set the font name before setting this property. **
  711.  
  712. ItemFontName
  713.  
  714. This property controls the font name for a specific line of text.  You should
  715. set this property first and then set the others.  See your VB Help for details
  716. on this property "FontName".
  717.  
  718.     MList1.FontName = "MS Sans Serif"
  719.  
  720. ItemFontSize
  721.  
  722. This property controls the individual size for a specific line of text.
  723.  
  724.     MList1.ItemFontSize = 7.8
  725.  
  726. ** You should set the font name before setting this property. **
  727.  
  728. ItemFontStrikeThru
  729.  
  730. Set this property to True if you want the font for a particular line of
  731. text to have a line through it.
  732.  
  733.     MList1.ItemFontStrikeThru = True
  734.  
  735. ** You should set the font name before setting this property. **
  736.  
  737. ItemFontUnderline
  738.  
  739. Set this property to True if you want the font for a particular line of
  740. text to have an underline beneath it.
  741.  
  742.     MList1.ItemFontUnderline = True
  743.  
  744. ** You should set the font name before setting this property. **
  745.  
  746. OwnerDraw
  747.  
  748. Set this property to True if you want to control all drawing of a line.
  749. See the DrawItem event for handling drawing of a line.
  750.  
  751. ListBoxStyle
  752.  
  753. This property determines whether the lines in a list box are a fixed
  754. height or a variable height.  Setting this property to 0 means all the
  755. lines in the list box are a fixed height, as determined by the
  756. ItemHeight property.  If this property is set to 1, then the lines in
  757. the list box are variable height.  The property AddItemHeight should
  758. be set before adding an item to the list.  After that, you can use
  759. IndItemHeight to adjust the height of a line.  The reason for this is
  760. because I need the height of the line before the line is displayed,
  761. otherwise, the entire list must be redrawn when you change the height
  762. of that line with IndItemHeight.
  763.  
  764. AddItemHeight
  765.  
  766. This property determines the height of the next line to be added when
  767. the list is a variable height list box.  See ListBoxStyle above.
  768.  
  769.     MList1.AddItemHeight = 195              ' Default line height
  770.  
  771. IndItemHeight
  772.  
  773. This property can be used to adjust the height of a line item after
  774. it has been added to the list box.  Be aware that this causes the
  775. entire list box to be redrawn.  You might want to disable redrawing
  776. while you adjust he height of a lot of lines.
  777.  
  778.     MList1.IndItemHeight(0) = 395
  779.     MList1.IndItemHeight(2) = 595
  780.  
  781. InString
  782.  
  783. Like FindString, except this property looks for a string in a string.
  784.  
  785. FindColumn
  786.  
  787. Set this propery to the column you want to search when using the
  788. FindColumnString property.
  789.  
  790. FindColumnString
  791.  
  792. The string you want to search for in FindColumn.
  793.  
  794. FindResult
  795.  
  796. This property controls the action of MList after it finds a string via
  797. FindString, FindStringExact, FindColumnString, or InString.  If set to
  798. 0, then ListIndex is updated, and the image of the list box is updated
  799. as well.  If set to one, the list box is not updated.  In either case,
  800. FindIndex is updated with the ListIndex of the found item, when an item
  801. is successfully found.
  802.  
  803. FindIndex
  804.  
  805. This property contains the ListIndex of the last successful find of an
  806. item.  This property is updated whether FindResult is set to Update List
  807. Index or or Update FindIndex.  Compare this to ListIndex or previously
  808. set FindIndex to see if a find is successful.
  809.  
  810. In version 4.51, FindIndex will be set to -1 if the search should fail.
  811.  
  812. OwnerCompare
  813.  
  814. This property determines if the internal compare function is used to
  815. compare strings during sorting, or whether the CompareItem function
  816. will be called.
  817.  
  818. FindPattern
  819.  
  820. You can use this property to find a pattern in the listbox.  This property
  821. behaves exactly as FindString except that you may use wild cards.  For
  822. example:
  823.  
  824.     MList1.FindPattern = "Robin W. Mc*"
  825.  
  826. would find yours truly if it where in the list box.  The starting point is
  827. determined by the FindDirection.  SearchCompare also determines the case
  828. sensitivity of the search.
  829.  
  830. FindPatternColumn
  831.  
  832. Set FindColumn to the column you want to search, then use this property
  833. to search for the pattern of the string in that column.
  834.  
  835.     MList1.FindColumn = 2
  836.     MList1.FindPatternColumn = "Bit*"
  837.  
  838. SearchCompare
  839.  
  840. This property determines the case sensitivity of the searches used by
  841. MList.  If set to 0, then FindString, FindPattern, FindStringExact,
  842. FindColumnString, and FindPatternColumn will search without concern for
  843. case.  If set to 1, then the search is case sensitive.  I set this
  844. property apart from StringCompare so that you can have different cases
  845. for the sort order and the searches.
  846.  
  847. Note:  This property does NOT affect InString.  InString is always case
  848. sensitive.
  849.  
  850. ItemFont
  851.  
  852. This property allows you to set the font property of many lines with
  853. the same font.
  854.  
  855.     Dim font As Integer
  856.  
  857.     font = CreateFont(...)
  858.  
  859.     MList1.ItemFont(1) = font
  860.     MList1.ItemFont(20) = font
  861.     MList1.ItemFont(21) = MList1.ItemFont(20)
  862.  
  863. You can create a font by calling CreateFont or CreateFontIndirect.  You
  864. can also get a system font by calling GetSystemObject.  You can then
  865. use this font to assign a font property to different lines in your list
  866. box.
  867.  
  868. It is your responsibilty to destroy the font.  If you use the standard
  869. VB font properties, FontName, FontBold, etc...  VB will destroy the font
  870. for you.  MList assumes that the font you have assigned to an individual
  871. line item through this property is spread out all over the galaxy.
  872. Therefore, you need to clean it up.
  873.  
  874. NOTE:  You can also use the font property of a line whose font was
  875. created with the regular ItemFont properties.  For example:
  876.  
  877.     MList1.ItemFontName(0) = "Arial"
  878.     MList1.ItemFontBold(0) = TRUE
  879.     MList1.ItemFont(1) = MList1.ItemFont(0)
  880.  
  881. MList will clean up the font used by ItemFont(0), since it was created
  882. with the normal VB properties.  Since the font is being cleaned up
  883. automatically, you do not have to clean up the same font which was
  884. assigned to ItemFont(1).
  885.  
  886. If you still have questions about this property, see CreateFont API.
  887.  
  888. SortOrder
  889.  
  890. Either Ascending or Descending.  Ascending is ASCII '0' - 'Z'.  Descending
  891. would be 'Z' - '0'.  This is pretty much self explanatory.
  892.  
  893. ClickRegion
  894.  
  895. This property contains the region in which the mouse was clicked for the
  896. given line pointed to by ListIndex.  This property is set on the MouseDown
  897. event.  This property is read only at runtime.
  898.  
  899. AutoCheck
  900.  
  901. Determines whether or not double clicking a line will toggle that line
  902. items checked state.  When set to TRUE (Default) the checked state will
  903. be toggled.  Otherwise, the double clicks are ignored.
  904.  
  905. SortType
  906.  
  907. Determines the type of data in the sort column.  The options are:
  908.  
  909.      0 - string, which is the default sort type
  910.   1 - number, assumed of type float, but any number will do!
  911.   2 - Date in the order MM/DD/YY or MM/DD/YYYY
  912.  
  913. This isn't fair to users of other countries, so look for an enhancement
  914. to the date format.
  915.  
  916. ***************************************************************************
  917.  
  918. New Events
  919.  
  920. SelChange()
  921.  
  922. This event is called whenever a selection in the list box is changed
  923. either through the keyboard or the mouse.  You might want to use the
  924. event instead of or in addition to the Click method if you want to
  925. respond to selection changes when the user use the arrow keys instead
  926. of the mouse.
  927.  
  928. SelCheck(Index As Integer, State As Integer)
  929.  
  930. This event is called whenever the checked status of a line in the list
  931. box is changed.  The first parameter to this event is the Index
  932. (line item) that has been effected.  The second parameter is the state
  933. of the checked box.  It is either True or False.
  934.  
  935. VirtualMessage(Message As Integer)
  936.  
  937. This is my first attempt at a virtual list box, so please don't laugh.
  938. I am basically providing the means by which to notify you when more
  939. data is needed.  For now, you will have to keep track of your own data.
  940.  
  941. The following Message(s) are sent to this event:
  942.  
  943.  
  944.     VIRTUAL_UP  - This should be defined as having a value of (1).  This
  945.     message will be sent when you need to add items to the end of the
  946.     list, because it is scrolling up.
  947.  
  948.     VIRTUAL_DOWN - This should be defined as having a value of (2).  This
  949.     message will be sent when you need to add items to the beginning of
  950.     the list, because it is scrolling down.
  951.  
  952.     VIRTUAL_END     - This is sent when the user is moving to the end of the
  953.     list.  You should load whatever number of lines you need to, then
  954.     MList will position ListIndex to the end of the list.  This item should
  955.     be defined as (3).
  956.  
  957.     VIRTUAL_HOME - This is sent when the user is moving to the beginning of
  958.     the list.  You should load whatever number of lines you need to, then
  959.     MList will position ListIndex to the start of the list.  This item should
  960.     be defined as (4).
  961.  
  962. MList will move the current ListIndex as Items are added to and removed from
  963. the list.  You should try to cache all the items you will load in memory, then
  964. add them to the list at one time.  Save off TopIndex and ListIndex, so that
  965. you can restore them.  You will need to subtract or add the number of new
  966. items loaded (and removed) depending on which direction you are moving in.
  967. See the example for details.
  968.  
  969. There are no properties like VirtualListIndex, VirtualTopIndex, VirtualCount,
  970. etc.  I am thinking hard about these, and hope to come up with an elegant
  971. solution.  Any suggestions???
  972.  
  973. I guess what I have done is provide virtual capabilities while leaving most
  974. of the implementation in your court.
  975.  
  976. ScrollMessage(Offset As Index)
  977.  
  978. This function is called when the list box is scrolling **HORIZONTALLY**.
  979. This allows you to scroll your own column headers over the list box.
  980. Offset is the number of **PIXELS** the window has been scrolled.  See
  981. the scroll demo for details.
  982.  
  983. Unforunately, due to Twips To Pixels and vis a vis, there is no exact
  984. relation between the number of pixels and the number of twips.  If you
  985. look at the example, you'll see that the more columns the right you go,
  986. the further off the column header is.  This can be solved manually placing
  987. each one to start with.  Once this is done, just copy the code and go!
  988.  
  989. DrawItem(ListIndex As Integer, ItemAction As Integer, ItemState As Integer,
  990.             ItemDC As Integer, ItemLeft As Integer, ItemTop As Integer,
  991.             ItemRight As Integer, ItemBottom As Integer, ItemText As String)
  992.  
  993. This event is called when OwnerDraw is set to True.  Owner draw basically
  994. forces you be responsible for drawing each and every line item.  The
  995. following is a brief description of the parameters.  Lookup Help for
  996. DRAWITEMSTRUCT in your WinAPI help for more details.
  997.  
  998.     ListIndex               - Index of item being drawn.  0 based.
  999.     ItemAction              - Action being performed (See DRAWITEMSTRUCT)
  1000.     ItemState               - State of line (See DRAWITEMSTRUCT)
  1001.     ItemDC                  - DC to do the drawing with.  DON'T use MList1.hDC
  1002.     ItemLeft                - Left coordinate of rectangle
  1003.     ItemTop                 - Top coordinate of rectangle
  1004.     ItemRight               - Right coordinate of rectangle
  1005.     ItemBottom              - Bottom coordinate of rectange
  1006.     ItemText                - The text that needs to be drawn
  1007.  
  1008. See the commented out code in SCROLL.MAK for details on how you might
  1009. get started ousing this feature (Set OwnerDraw to True!).
  1010.  
  1011. CompareItem(ListItem1 As String, ListItem2 As String, Result As Long)
  1012.  
  1013. If you set OwnerCompare to TRUE, then this function is called to compare
  1014. two strings.  You may parse the string out any way you like.  You should
  1015. store -1 in Result if ListItem1 is less then ListItem2, 1 if ListItem1 is
  1016. greater than ListItem2, or 0 if they are equal.
  1017.  
  1018. WARNING: Result will still be affected by SortOrder.  If you plan to
  1019. determine your own sort order, then set SortOrder to Ascending and
  1020. leave it.  Your sort order will not be affected.  A SortOrder of
  1021. Descending will effectively negate Result so it is the opposite of what
  1022. you set it to.
  1023.  
  1024. ***************************************************************************
  1025.  
  1026. FORMATTING STRINGS
  1027.  
  1028. You should place the Tab character between each column in your string.  The
  1029. following example formats a string for the DrawFlags example:
  1030.  
  1031.     MList1.AddItem "Robin W. McKean" + Chr$(9) + "$100.00"
  1032.  
  1033. The following string is for three columns:
  1034.  
  1035.     MList1.AddItem "Robin W. McKean"+Chr$(9)+"$100.00"+Chr$(9)+"True"
  1036.  
  1037. Remember, you do NOT have to include a column for the ImageRegion.  If
  1038. the ImageRegion property was 1 and the DrawRegions property was 3, then
  1039. the following line would work fine (3-1=2)
  1040.  
  1041.     MList1.AddItem "Robin W. McKean"+Chr$(9)+"$100.00"
  1042.  
  1043. ***************************************************************************
  1044.  
  1045. REACHING THE AUTHOR
  1046.  
  1047. Klasman Quality Consulting, Inc can be reached via US Mail at...
  1048.  
  1049. 13 Vespa Lane
  1050. Nashua, NH 03060
  1051.  
  1052. You can reach us via E-Mail at the following locations...
  1053.  
  1054. CompuServe:
  1055.     Kevin M. Klasman 70233,1476
  1056.  
  1057. INTERNET: 
  1058.     klasman@kqc.mv.com
  1059.  
  1060. ***************************************************************************
  1061.  
  1062. REVISION HISTORY
  1063.  
  1064. 3.00.0000    Initial release of the MLIST.VBX Custom Control
  1065. 3.01.0000     Fixed "Bad Index" error message when setting Selected
  1066.             property to True|False.
  1067.             Added ItemData property to control.
  1068.             Added ListIndex property to control.
  1069.             Fixed an apparent bug in the VB API that was passing right
  1070.             mouse button clicks to the Click event, but not the left
  1071.             mouse button.
  1072. 3.02.0000   Fixed a ton of problems.  Namely, the page down didn't work.
  1073.             Delete current controls and rebuild to fix this problem.
  1074.             Added ALL default controls for the standard list box.
  1075.             Tested all of them before uploading.
  1076. 3.03.0000   Fixed the index problem with the List property.  If anything,
  1077.             I am guilty of being over enthusiastic.  I apologize to those
  1078.             who got the previous version and thought it sucked.  Probably
  1079.             because it did.  I added bitmaps and checkboxes as well as
  1080.             the ability to change the color of a specific line.  You can
  1081.             also change the bitmap of a specific line item.
  1082. 3.04.0000   Fixed the bug with setting the Checked property, and then not
  1083.             having the user be able to double click it or click the box
  1084.             to change it back.  Added the AlignBitmap image type and
  1085.             the Alignment property.
  1086. 4.00.0000   Added the Multicolumn property and item width.  Added the
  1087.             FindString and FindStringExact properties for searching
  1088.             the list box.  Added the range properties for checking
  1089.             and selecting multiple line items.
  1090. 4.01.0000   Removed the 64k limit.  MLIST will now allow more than 64k
  1091.             worth of data to be added to it.  Also, quit handling default
  1092.             methods, such as Move (which didn't work), Refresh, and others.
  1093.             Fixed problem with RemoveItem not deleting lines data.
  1094.             Changing the way MLIST handled strings did the job.
  1095. 4.02.0000   Removed a bug which caused a GP fault when more than 16 drawing
  1096.             regions were requested by the user.  Reworked VB2.0 compatibility
  1097.             strategy.
  1098. 4.10.0000   Added 3-D, rise and fall colors, and SelChange event.
  1099. 4.11.0000   Hilighted lines will default to the system colors as controlled
  1100.             by the control panel.  User may still override useing the
  1101.             HiliteForeColor and HiliteBackColor.  Added the ExtendedSelect
  1102.             property.
  1103. 4.20.0000   Tightened up the difference between a multi-select list box
  1104.             and a normal list box.  I added grid color, virtual messages,
  1105.             check marks in check boxes, SelChange events when ListIndex is
  1106.             changed, SelCheck for when an item is checked/unchecked.
  1107. 4.30.0000   Changed the way that virtual list boxes determine when they are
  1108.             in the virtual region.  I used to use the TopIndex property,
  1109.             now I use the thumb position on the scroll bar.
  1110.             Added new properties for SortColumn and StringCompare.  These
  1111.             properties allow you sort on different columns as well as
  1112.             determine if the strings are case sensitive/insensitive.
  1113.             Added new properties for Drag and Drop.  The first, SelectedMode,
  1114.             doesn't allow items to become "de-selected" when dragging.  ItemX,
  1115.             ItemY, and Item help you determine which line item is being
  1116.             dragged over/dropped upon.  Fixed dynamic loading of an MList, and
  1117.             calling AddItem "MyString", 0 when there are no items in the list.
  1118.             Added ScrollMessage for scrolling column headers.
  1119.  
  1120. 4.50.0000   Added font support, complete owner draw, disable drawing, and
  1121.             NoIntegralHeight support.  Added InString, FindResult,
  1122.             FindColumn, and FindColumnString.  Added icon support.
  1123.  
  1124. 4.55.0000    Added help, changed memory allocation method, and added
  1125.             ClickRegion property.
  1126.  
  1127. 4.56.0000    Cleaned up a memory leak.  Added AutoCheck property.
  1128.             Fixed bug with hitting enter or tab key on sorted listbox.
  1129.  
  1130. 4.57.0000    Fixed the empty column GPF bug
  1131.  
  1132. ***************************************************************************
  1133.  
  1134.