home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 March / Chip_2002-03_cd1.bin / zkuste / delphi / kompon / d5 / CSDBPACK.ZIP / TCSDBBrowse.txt < prev   
Text File  |  2001-12-21  |  4KB  |  119 lines

  1. TCSDBBrowse Component Ver 0.2.1 for Delphi 5
  2. --------------------------------------------
  3.  
  4. Copyright (⌐) 2001 by Cin Sieng
  5. Updated 21 December 2001
  6.  
  7. Email:         bayikiddo@gmx.co.uk
  8.  
  9. Description: TCSDBBrowse
  10.  
  11. This component is a browsing utility for databases where you would normally find
  12. in DBase, foxpro using the 'browse' command.
  13.  
  14. This component not just do this, but can return the selected key(s) value as well
  15. with the ability to multiselect records.
  16.  
  17. All you have to do is to supply tablename, order by field list, display field list,
  18. and return key(s).
  19.  
  20. Below is the parameter that needs to be supplied. See sample project.
  21.  
  22. TMyParam = class(TObject)
  23.    Tablename: String;  // table name to use (M)
  24.    WhereSQL:String;    // any sql WHERE clause (O)
  25.    MultipleSelect:Boolean; // specify if user can select multiple rows (O) default FALSE
  26.  
  27.    Key : TStringList; // the key fields to return (M)
  28.    TitleStr: TStringList; // column title of the grid (O)
  29.                           // separate column name with | (pipe)
  30.                           // uses DisplayToUse as index
  31.  
  32.    IndexName: TStringList; // sorting name (M)
  33.    IndexStr: TStringList; // for use with ORDER BY clause, should contain actual field names
  34.                           // field names w/ spaces should be enclosed in '[]' (M)
  35.  
  36.    IndexToUse: Byte;      // select which ORDER BY to use in IndexStr (O) default 0
  37.  
  38.    DisplayName: TStringList; // name of Display for field lists. (M)
  39.    DisplayStr: TStringList;  // list of field names to list in the browse window (M)
  40.    DisplayToUse: Byte;       // select which Display to use (O) default 0
  41.  
  42.    ResultStr: TStringList;   // selected records key field value will be returned here
  43.                              // if 3 keys items are supplied & multipleselect=TRUE
  44.                              // first three items of ResultStr is the key to the first
  45.                              // selected record, second three items is for the second one
  46.                              // and so on.
  47. end;
  48.  
  49. ****NOTE**** (M) = Mandatory, (O) = Optional
  50.  
  51. ColorSet property
  52. -----------------
  53. StripeColor1 = odd row back ground color
  54. StripeColor2 = even row background color
  55. FontColor    = display font color
  56. BkColor      = background display color
  57. SelectedFontColor   = selected display font color
  58. SelectedBkColor     = selected background display color
  59. SelectedHLFontColor = selected and highlighted display font color
  60. SelectedHLBkColor   = selected and highlighted background display color
  61.  
  62. Thanks To everyone in the borland newsgroups that help me.
  63.  
  64. You are free to use the TCSDBBrowse Component in compiled form for any
  65. purpose.
  66.  
  67. This component is provided 'as-is', without any express or implied warranty.
  68. In no event shall the author be held liable for any damages arising from the
  69. use of this component.
  70.  
  71. Installation
  72. ------------
  73. Delphi 5 -  Just open CS.DPK and compile to install, ignore the warnings if any.
  74.  
  75. Usage
  76. -----
  77. Available key when browsing:
  78.  
  79. Cursor keys            - to move around
  80. Z                      - to maximize/restore window
  81. Ctrl-A                 - Select all records (when multipleselect = TRUE)
  82. Ctrl-U                 - Unselect all records (when multipleselect = TRUE)
  83. Ctrl-R                 - Refreshes Dataset
  84. F4/right click on grid - show popup menu for sorting & display selection
  85.  
  86.  
  87. Limitation
  88. ----------
  89. - Works on any data access component that have the 'SQL' property only.
  90.   e.g: TQuery, TADOQuery
  91. - No checks on field names if it's in the table.
  92.  
  93. Bugs report
  94. -----------
  95. Before making any bug reports please first verify you are
  96. using the latest version from the website you downloaded from
  97. Please include sample code if possible.
  98.  
  99. Any suggested enhancements would also be appreciated.
  100.  
  101.  
  102. Future Enhancements
  103. -------------------
  104. - improve on the search interface
  105. - verification on field names supplied 
  106.  
  107. History
  108. -------
  109. 14 December 2001
  110. - ver 0.1 first release
  111.  
  112. 18 December 2001
  113. - ver 0.1 include the DFM file, oops :)
  114.  
  115. 19 December 2001
  116. - ver 0.2 added grid color setting (TGridColor) property
  117.  
  118. 21 December 2001
  119. - ver 0.2.1 fix the TitleStr to allow different column header name for each DisplayStr