home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 September / Chip_2001-09_cd1.bin / zkuste / delphi / kolekce / d123456 / DFS.ZIP / DFSSplitter.txt < prev    next >
Text File  |  2001-06-28  |  12KB  |  199 lines

  1. TdfsSplitter v2.03
  2.  
  3.  
  4. Description:
  5.   A descendant of the TSplitter component (D3, C3, & D4) that adds a
  6.   "maximize - restore" button.  This mimics the behavior of the splitter in
  7.   Netscape Communicator v4.5.  Clicking the button moves the splitter to its
  8.   farthest extreme.  Clicking again returns it to the last position.
  9.  
  10.  
  11. Contact Information:
  12.   The lateset version will always be available on the web at:
  13.     http://www.delphifreestuff.com
  14.   If you have any questions, comments or suggestions, please use the Delphi
  15.   Free Stuff Support Forum at: 
  16.     http://www.delphifreestuff.com/discus/
  17.   If, for some reason, you can not use the web-based support forum, you can
  18.   email me at bstowers@delphifreestuff.com.  However, the support forum will
  19.   always take precedence over direct email since it provides a resource that
  20.   others can use when they have a problem.  Every message posted to the forum
  21.   is emailed directly to this account, so emailing me directly will not get 
  22.   your message to me any faster.  It will only make the message less important
  23.   for me to respond to since only one person (you) is benefiting from it
  24.   instead of everyone interested.  Having said all that, please do email me 
  25.   directly if it is regarding something that isn't really support related, 
  26.   i.e. just to say thanks (as novel as that idea is).  
  27.  
  28.  
  29. Installation:
  30.   Delphi 1, Delphi 2, C++Builder 1:
  31.     * This component is not compatible with Delphi 1, 2, or C++Builder 1.
  32.   
  33.   Delphi 3, 4, 5, C++Builder 3 & 4:
  34.     * Do one of the following:
  35.       + Create a new package by selecting File | New and choosing Package from
  36.         the New tab in the dialog.
  37.       + Open an existing package file.  I suggest you do this if you already
  38.         have a package that you like to use for small, third party components.
  39.         I specifically have a package named "3rdParty.dpk" that I use for
  40.         small components that come from other people.  Or, if you are using
  41.         several of my components, you might create a "DFS.dpk" package and
  42.         use it for all of my DFS components.
  43.     * In the resulting package window, click the Add button.
  44.     * In the Add dialog, on the Add Unit tab, enter the full path name of the
  45.       component's registration unit (the unit that ends with 'Reg.pas', i.e.
  46.       'BrowseDrReg.pas') and click OK.
  47.     * You may want to add the other source files (*.pas) to the package as
  48.       well in the same manner as you did the registration unit.  While this is
  49.       not required, not doing it will cause compiler warnings when the package
  50.       is compiled.  The component will function fine either way, but I
  51.       personally find the warnings very irritating and am not happy until
  52.       every compiler warning and hint is gone.
  53.     * If this package is new, or it has never been installed, click the
  54.       Install button in the package window.  If this package is already
  55.       installed in Delphi, click the Compile button.
  56.  
  57.   C++Builder 5 and up:
  58.     * Perform the "Delphi 3 and up, C++Builder 3 and up" steps above, except
  59.       for the last step (Compile or Install).
  60.     * Select the package the component has been added to, and choose 
  61.       Project | Edit Option Source to open the package options in the editor.
  62.     * In the entry for PFLAGS, add the "-LUvcl50" option.  For example:
  63.         <PFLAGS value="-$YD -$W -$O -v -JPHNE -M -LUvcl50"/>
  64.     * Perform the final step from above, Compile or Install.
  65.     * For Borland's official word on this situation, open the C++Builder help
  66.       file and search the index for "dsgnintf.dcu" and see the "Compiling
  67.       packages with DsgnIntf" section.
  68.  
  69.   Delphi 6 and up:
  70.     * Perform the "Delphi 3, 4, 5, C++Builder 3 & 4" steps above, except
  71.       for the last step (Compile or Install).
  72.     * Add the DesignIDE package to the Requires list of the package into which
  73.       the component is being installed.
  74.     * Perform the final step from above, Compile or Install.
  75.     * This is necessary because of changes to the design-time support units
  76.       introduced in Delphi 6.  For complete information, see the Del6New.hlp
  77.       file in your Delphi 6 Help directory.  In the index, search for
  78.       "upgrade issues" and in the resulting list of topics, select the
  79.       "DsgnIntf renamed and related changes" topic.
  80.  
  81.  
  82. Notes:
  83.   * If you like this Netscape style enhancement, you may also be interested in
  84.     the TdfsToolBar component on my web site.
  85.   * Button arrow directions follow the Align property.  I tried with an
  86.     independent ButtonDirection property, but it turned out to be just to nasty
  87.     from both a coding and usage perspective.
  88.   * A possible future enhancement if there is any interest: The D4 version of
  89.     TSplitter has an OnPaint event.  The button paint's after this fires, so you
  90.     can paint the bar without worrying about the button itself.  It might be
  91.     nice to have an OnPaintButton event so that could be painted differently as
  92.     well.
  93.  
  94. Known Issues:
  95.   * The fix implemented here for the TSplitter bug may not work on all versions
  96.     of Delphi.  It does work on Build 5.37 (from About box), but I've had one
  97.     other person tell me he has Build 5.33 and the DoCanResize method is not
  98.     protected virtual in that.
  99.   * I can't control when the OnMoved event fires, and the way TSplitter is set
  100.     up, it fires before the controls are actually moved in the maximize and
  101.     restore processes.  So, do not rely on positions if you code only for the
  102.     OnMove event.  The OnMaximize and OnRestore events do fire after the
  103.     controls have moved, so if you need that information, you can get it there.
  104.   * It is possible to get the direction arrows to paint outside of the button
  105.     if you use silly values (like a button width of 25 and height of 40).  If
  106.     you're silly enough to do it, you're silly enough to like it.  I don't
  107.     consider it worth the trouble to fix. If you can make a reasonable case
  108.     otherwise, send me email.
  109.  
  110.  
  111. TdfsSplitter Revision History:
  112.   2.03   + Updated for Delphi 6 compatibility.  See updated install directions
  113.            above.
  114.   2.02   + bsNetscape style wouldn't always minimize in the correct direction.
  115.          + bsWindows style sometimes thought the close button was the
  116.            minimize button, and vice versa.
  117.          + Updated for C++Builder 5 compatibility.
  118.   2.01   + Changed ordering of window buttons on vertically aligned bsWindows
  119.            style splitters.  Close is now at the top, with maximize and
  120.            minimize following in that order.  It seemed much more correct that
  121.            way.
  122.   2.00   + Added ButtonCursor property to control the cursor that is displayed
  123.            when the mouse is over a splitter button.
  124.          + Fixed problem of bsNetscape style not minimizing in the right
  125.            direction for some alignments (bsNetscape was the only style in
  126.            previous versions).
  127.          + Added a ButtonStyle property that offers a new style of splitter.
  128.            bsNetscape style makes the splitter behave as it always has.
  129.            bsWindows offers a new style where you can have window caption style
  130.            buttons (minimize, maximize, close).  Minimize always moves the
  131.            splitter down for horizontal and left for vertical, and vice versa
  132.            for maximize.  Added supporting properties for this new style:
  133.            WindowsButtons to specify which buttons are to be displayed;
  134.            OnMinimize event (bsNetscape always uses OnMaximize to simplify
  135.            things for you); OnClose event for close button click.  Because the
  136.            component has no way of knowing what it should do for a "close" event,
  137.            it does nothing except fire OnClose.  That event must do whatever it
  138.            deems necessary for a "close".
  139.            Many properties are now only used for bsNetscape style:
  140.              ArrowColor, AutoHighlightColor, ButtonColor, ButtonHighlightColor,
  141.              ButtonWidth, ButtonWidthType, TextureColor1 & 2 are never used for
  142.              bsWindows style.  Buttons are always sized to be square based on
  143.              the available area, and are always draw in the same color as normal
  144.              caption buttons.
  145.          + Made Minimized and Maximized properties published.  Remember,
  146.          + Splitter aligned right or bottom would not restore from maximized
  147.            position.  The position would gradually increase each time.
  148.   1.10:  + New property, AllowDrag, that indicates whether the splitter can be
  149.            moved by dragging with the mouse or not.  If false, only the button
  150.            can be used.
  151.          + Fixed problem where splitter could not be dragged back to the minimum
  152.            position just after it had been restored via the button.
  153.          + The button arrow directions will now correctly update when dragging
  154.            the splitter to/from the minimum position.  That is, in previous
  155.            versions, dragging to the min position would still leave the button
  156.            in the old state.  Hard to explain, but in a nutshell it works like
  157.            Netscape now.
  158.   1.07:  + It's *really* D5 compatible now.  Small change between the D5 eval
  159.            version and the real, shipping D5 version broke it.
  160.          + Added simple demo.
  161.   1.06:  + Updated for Delphi 5 compatibility.
  162.   1.05:  + Updated for C++Builder 4 compatibility.
  163.   1.04:  + Enabled property added.  Thanks to Bob Arnson for implementing and
  164.            sharing with us.  If the splitter is not enabled, the button is not
  165.            shown and the cursor reverts to the default instead of a splitter.
  166.          + Added DFSSplitterReg unit.  All IDE specific code (i.e. registering
  167.            the component, property editors, etc.) are contained in this unit.
  168.            This was done for two primary reasons:  1) Using the component in a
  169.            Delphi or C++Builder expert would register the component as well.
  170.            2) Reduce code size in some cases -- usually the smart linker removes
  171.            this sort of stuff since the app never references it, but now it's
  172.            for certain since it isn't even in the unit.  This change means that
  173.            you need to install the component using the new "registration" unit
  174.            instead of the unit containing the component.
  175.   1.03:  + AutoHighlightColor property added by Ken Semerkant
  176.            (ksemerkant@usa.net).  Setting this property to TRUE will calculate
  177.            the highlight color for the splitter button based on the user's
  178.            window caption system color.
  179.   1.02:  + Clicking beside (but not right on) the button when it was in the
  180.            maximized state would cause it to lose it's maximized state.
  181.          + Did the DoMaximize and DoRestore methods wrong.  The OnMaximize and
  182.            OnRestore events didn't fire if you set Maximized property in code.
  183.   1.01:  + Added RestorePos property to public declaraions.  It is the position
  184.            that a maximized splitter will return to.  It is useful for saving
  185.            and restoring the state of a splitter between sessions.  Thanks to
  186.            Marcus Monning (info@mmsoftware.com) for this suggestion.
  187.          + Fixed the nasty bug in D4 where TSplitter (not just TdfsSplitter)
  188.            could get "stuck" at one of it's extremes.  Thanks again to Marcus
  189.            Monning for tracking this ExtCtrls.pas bug down.
  190.          + Wasn't honoring the MOVEMENT_TOLERANCE value that's used to tell it
  191.            when a small move is considered really a move and when it is a button
  192.            click.
  193.          + Certain conditions could cause the arrows to not be redrawn.
  194.          + Cursor setting changed a bit to make it more like Netscape.
  195.          + Marked Version property as not stored since it doesn't need to be.
  196.            It would only add to the size of your EXE, and that's silly.
  197.   1.00:  + Initial release
  198.  
  199.