TMILFieldList v1.0.2
by Larry J. Rutledge

© Copyright 1998-1999, Millennial Software, All Rights Reserved

  1. Component Description
  2. Properties and Events
  3. Installation
  4. Revision History
  5. Contacting the Author
  6. Disclaimer

Description

I recently had to write an application at work that needed to display a visual representation of database tables and list the fields contained within those tables. I also needed some method of indicating that a field in one table should be linked to a field in another table. After playing with various ideas, TMILFieldList was born.

This component is unique in a couple of aspects. First, the visual appearance of the component is that of a Windows form. It has a 3D beveled border and a colored "caption bar" with the caption text. Second, if the Moveable property is set to True, the user can drag the component at run-time by clicking on the "caption bar". Finally, if the Sizable property is set to true, if the user moves the mouse cursor over the edges of the component at run-time, the cursor will change to one of the eight resize cursors. If the user then presses the left mouse button and drags, the component will resize.


To meet the applications requirements, the "caption bar" was created to allow the component to display the database table that it was representing. In addition, the remainder of the component contains a TListBox that displays the names of the fields contained in the database table.

The final requirement was the ability to visually set a link between tables. To accomplish this, if the user clicks on an item in the TListBox (field name) and drags it to an item in the TListBox of another TMILFieldList component on the form, the OnLink event for the destination component will be fired.

OnLink indicates the source and destination TMILFieldList components invovled in the drag and drop procedure. The application can then use the Items and ItemIndex properties of the components to determine which field was selected in each "table".


In addition to the properties mentioned, there are also properties to specify the color and font to use when painting the "caption bar" when it is Active and when it is not Active. Also, the TListBox that contains the list of field names may contain more items than are visible within the size of the component. In this case, the ScrollBars property will come in handy. Based on the desired functionality, either the Horizontal, Vertical, Both or None of the scroll bars can be displayed.

Return to the top


Properties and Events

Properties


Events
Return to the top


Installation

1. Unzip fieldlst.zip to a temporary directory.
2. Copy MILFieldList.PAS, MILFieldList.DCR, MILAbout.PAS, and MILAbout.DFM to your components directory.
3. Install component file MILFieldList.PAS.
4. The new component should appear on a tab titled "Millennial".

Return to the top


Revision History

Version Date Author Description
1.0.0 05/26/1999 Larry J. Rutledge Created initial component.
1.0.1 05/27/1999 Larry J. Rutledge Fixed Access Violation that occurred when changing the ActiveFont or InactiveFont properties.
1.0.2 06/04/1999 Larry J. Rutledge Added FMoveable and FSizeable properties to allow the component user to determine whether to allow Moving and Sizing at run-time.

Return to the top

Contacting the author

If you have questions, comments, bug reports, modifications, etc. please contact the author at:  Larry J. Rutledge


TMILFieldList is Freeware and can be used in freeware, shareware and commercial productions without my permission. You may modify the code, but please do not forget the documentation (and the credits).

You may not sell the component or the source without significant modifications.

Return to the top


Disclaimer

This software is provided "AS IS" without any warranty of any kind, either express or implied. The entire risk as to the quality and performance of the software is with you. Should the software prove defective, you assume the cost of all necessary servicing, repair or correction. In no event shall the author, copyright holder, or any other party who may redistribute the software be liable to you for damages, including any general, special, incidental, or consequental damages arising out of the use or inability to use the software (including, but not limited to, loss of data, data being rendered inaccurate, loss of business profits, loss of business information, business interruptions, loss sustained by you or third parties, or a failure of the software to operate with any other software) even if the author, copyright holder, or other party has been advised of the possibility of such damages.


For more information on various Delphi topics, visit the on-line newsletter "Delphi Gazette". You can find it at the following address:
http://www.prestwood.com/forums/delphi/sdug/newsletter/.


Return to the top
Last Updated: June 06, 1999