home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 September / Chip_2001-09_cd1.bin / zkuste / delphi / kolekce / d123456 / DFS.ZIP / SystemControlPack.inc < prev    next >
Text File  |  2000-01-09  |  9KB  |  125 lines

  1. (******************************************************************************)
  2. (* Conditional defines for the System Control Pack components.                *)
  3. (******************************************************************************)
  4. (*                                                                            *)
  5. (* These units makes extensive use of conditional defines to control many     *)
  6. (* aspects of how and what things are compiled.  Usually these are used to    *)
  7. (* effect code size or change how a feature works, but some are also for      *)
  8. (* debugging purposes.                                                        *)
  9. (*                                                                            *)
  10. (* The following is a list of the defines that are used and how.  These       *)
  11. (* defines are all found in the SystemControlPack.inc file.  The prefix used  *)
  12. (* in each name identifies what is effected:                                  *)
  13. (*   DFS   --  Prefix I use for all my defines to avoid clashing with other   *)
  14. (*             defines that may be in use.  DFS = Delphi Free Stuff           *)
  15. (*   SCP   --  Indicates that the define effects all components.  SCP = System*)
  16. (*             Control Pack                                                   *)
  17. (*   STV   --  Indicates that the define effects only the TSystemTreeView     *)
  18. (*             component.  STV = System Tree View                             *)
  19. (*   SLV   --  Indicates that the define effects only the TSystemListView     *)
  20. (*             component.                                                     *)
  21. (*   SCB   --  Indicates that the define effects only the TSystemComboBox     *)
  22. (*             component.  Currently, there are none of these.                *)
  23. (*                                                                            *)
  24. (* * DFS_SCP_SYSTREEVIEW, DFS_SCP_SYSLISTVIEW, DFS_SCP_SYSCOMBOBOX: If you    *)
  25. (*     undefine any of these, then that/those components will no longer be    *)
  26. (*     compiled.  For example, if you undefined DFS_SCP_SYSLISTVIEW, the      *)
  27. (*     TSystemListView component will not be compiled, and the tree view and  *)
  28. (*     combo box components will no longer have a ListView property to link   *)
  29. (*     to. This resulted in a 70k saving in the compiled EXE of a test app    *)
  30. (*     that uses only the TSystemTreeView component.  The down side to this   *)
  31. (*     is that if you use TSystemListView for some projects and not for       *)
  32. (*     others, you will either have to leave it enabled for all, or have one  *)
  33. (*     heck of a code maintenance nightmare.  One solution to this could be   *)
  34. (*     to remove the DFS_SCP_SYSLISTVIEW define from the include file         *)
  35. (*     completely and add it to the Project | Options | Directories/          *)
  36. (*     Conditionals of the design-time package you install the component in.  *)
  37. (*     Then, you would add DFS_SCP_SYSLISTVIEW to the options of the projects *)
  38. (*     that need it, and leave it out of those that don't. This would allow   *)
  39. (*     you to control what is compiled into the Delphi IDE independant of     *)
  40. (*     what is compiled into your projects without having to change the       *)
  41. (*     SystemControlPack.inc file in between.  I have not tested this         *)
  42. (*     solution, but it works in theory.  :)                                  *)
  43. (* * DFS_STV_FASTMODE and DFS_SLV_FASTMODE: These defines are not enabled by  *)
  44. (*     default.  If you enable them, the components will populate/display     *)
  45. (*     much faster.  The reason is that the actual item data such as the      *)
  46. (*     caption and subitem text, the image index, etc. aren't retrieved when  *)
  47. (*     the list/tree is populated.  Instead, the system will ask (via a       *)
  48. (*     CN_NOTIFY message) for the data when it needs a particular item's data *)
  49. (*     and it is supplied only then. So, it doesn't take nearly as long to    *)
  50. (*     add a large number of items.  But (there's always a price to be paid), *)
  51. (*     you will lose access to this data via the Nodes (treeview) or Items    *)
  52. (*     property (listview).  That means you won't be able to do stuff like:   *)
  53. (*                                                                            *)
  54. (*       ShowMessage(MySysListView.Items[0].Caption);                         *)
  55. (*                                                                            *)
  56. (*     However, you will still be able to do the equivalent using stuff like: *)
  57. (*                                                                            *)
  58. (*       ShowMessage(MyList.GetFullPath(MyList.Selected));                    *)
  59. (*                                                                            *)
  60. (*     So, if you need the text or image index stuff, leave the define off.   *)
  61. (*     But, if you don't, turn it on by removing the period and it'll be      *)
  62. (*     faster. In my informal testing, listing my windows directory went from *)
  63. (*     12 seconds to 2 seconds.  You'll only see these big gains on           *)
  64. (*     directories with a lot of files, though.  Many thanks go to Andei V.   *)
  65. (*     Rasskazov for pointing this technique out.                             *)
  66. (* * DFS_SLV_USE_ENHLISTVIEW and DFS_SLV_USE_EXTLISTVIEW: These are not       *)
  67. (*     enabled by default.  They are useful only if you also have my          *)
  68. (*     TEnhListView and TExtListView components.  You will need v3.13 or      *)
  69. (*     later of these components for this to work.  Enabling ONE of these     *)
  70. (*     (never enable both) will cause TSystemListView to descend from the     *)
  71. (*     corresponding TEnh/ExtListView class, giving you all of that class'    *)
  72. (*     features as well.  WARNING:  This is just a simple implemenation       *)
  73. (*     currently, and there are likely to be problems.  Only use these if you *)
  74. (*     want to help me work out the bugs in it.  Defining either of these     *)
  75. (*     will also cause DFS_SLV_USING_ELV to be defined.  I use this           *)
  76. (*     internally when I want to know if either of the above are defined and  *)
  77. (*     I don't care which one.  You should not define DFS_SLV_USING_ELV       *)
  78. (*     yourself.                                                              *)
  79. (* * DFS_STV_FILECHANGES: Controls whether the treeview will "watch" the      *)
  80. (*     directory that is currently displayed for changes, i.e. a new          *)
  81. (*     directory or file created, an existing one deleted, etc. and           *)
  82. (*     automatically refresh when this happens.  This was originally put in   *)
  83. (*     so that this feature could be turned off during development if nasty   *)
  84. (*     bugs were found. However, that was quite a while back, and "change     *)
  85. (*     watching" seems to be quite stable now.  The only reason you might     *)
  86. (*     want to turn it off now is to save yourself the 3.5 kb of space it     *)
  87. (*     adds to your compiled EXE. This define will probably be removed        *)
  88. (*     entirely unless someone makes a strong case for leaving it.            *)
  89. (* * DFS_DEBUG: This is a define that I use internally for debugging the      *)
  90. (*     components.  It causes a unit to be used that is not distributed, so   *)
  91. (*     it is most likely useless to anyone but me.                            *)
  92. (*                                                                            *)
  93. (******************************************************************************)
  94. (* Brad Stowers: bstowers@pobox.com                                           *)
  95. (* Delphi Free Stuff: http://www.delphifreestuff.com/                         *)
  96. (* September 21, 1999                                                         *)
  97. (******************************************************************************)
  98.  
  99. {$DEFINE DFS_SCP_SYSTREEVIEW}
  100. {$DEFINE DFS_SCP_SYSLISTVIEW}
  101. {$DEFINE DFS_SCP_SYSCOMBOBOX}
  102.  
  103. {.$DEFINE DFS_STV_FASTMODE}
  104. {.$DEFINE DFS_SLV_FASTMODE}
  105.  
  106. // Only use one of these, never both
  107. {.$DEFINE DFS_STV_USE_ENHLISTVIEW}
  108. {.$DEFINE DFS_SLV_USE_EXTLISTVIEW}
  109.  
  110. {$IFDEF DFS_SLV_USE_ENHLISTVIEW}
  111.   {$IFDEF DFS_SLV_USE_EXTLISTVIEW}
  112.     Error!  Use only one of these defines, never both!
  113.   {$ENDIF}
  114.   {$DEFINE DFS_SLV_USING_ELV} // Internal use only!
  115. {$ENDIF}
  116.  
  117. {$IFDEF DFS_SLV_USE_EXTLISTVIEW}
  118.   {$DEFINE DFS_SLV_USING_ELV} // Internal use only!
  119. {$ENDIF}
  120.  
  121. {$DEFINE DFS_STV_FILECHANGES}
  122.  
  123. {.$DEFINE DFS_DEBUG}
  124.  
  125.