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

  1. TdfsStickyForm v1.00 Beta 2
  2.  
  3. Description:
  4.    A TForm descendent that makes the window behave like it wants to "stick" to
  5.    any edge of the screen, that is, when it comes within a certain number of
  6.    pixels of a screen edge, the window will jump to that edge.
  7.  
  8. Contact Information:
  9.   The lateset version will always be available on the web at:
  10.     http://www.delphifreestuff.com
  11.   If you have any questions, comments or suggestions, please use the Delphi
  12.   Free Stuff Support Forum at:
  13.     http://www.delphifreestuff.com/discus/
  14.   If, for some reason, you can not use the web-based support forum, you can
  15.   email me at bstowers@delphifreestuff.com.  However, the support forum will
  16.   always take precedence over direct email since it provides a resource that
  17.   others can use when they have a problem.  Every message posted to the forum
  18.   is emailed directly to this account, so emailing me directly will not get
  19.   your message to me any faster.  It will only make the message less important
  20.   for me to respond to since only one person (you) is benefiting from it
  21.   instead of everyone interested.  Having said all that, please do email me
  22.   directly if it is regarding something that isn't really support related,
  23.   i.e. just to say thanks (as novel as that idea is).
  24.  
  25.  
  26. Installation:
  27.   Delphi 1:
  28.     * Delphi 1 is not supported.
  29.  
  30.   Delphi 2, C++Builder 1:
  31.     * TdfsStickForm has not been tested on, and does not officially support
  32.       Delphi 2 or C++Builder 1.  However, you should be able to simply place
  33.       the files in the directory of your choosing.  There is no component
  34.       involved.
  35.  
  36.   Delphi 3, 4, 5, C++Builder 3 & 4:
  37.     * Do one of the following:
  38.       + Create a new package by selecting File | New and choosing Package from
  39.         the New tab in the dialog.
  40.       + Open an existing package file.  I suggest you do this if you already
  41.         have a package that you like to use for small, third party components.
  42.         I specifically have a package named "3rdParty.dpk" that I use for
  43.         small components that come from other people.  Or, if you are using
  44.         several of my components, you might create a "DFS.dpk" package and
  45.         use it for all of my DFS components.
  46.     * In the resulting package window, click the Add button.
  47.     * In the Add dialog, on the Add Unit tab, enter the full path name of the
  48.       component's registration unit (the unit that ends with 'Reg.pas', i.e.
  49.       'BrowseDrReg.pas') and click OK.
  50.     * You may want to add the other source files (*.pas) to the package as
  51.       well in the same manner as you did the registration unit.  While this is
  52.       not required, not doing it will cause compiler warnings when the package
  53.       is compiled.  The component will function fine either way, but I
  54.       personally find the warnings very irritating and am not happy until
  55.       every compiler warning and hint is gone.
  56.     * If this package is new, or it has never been installed, click the
  57.       Install button in the package window.  If this package is already
  58.       installed in Delphi, click the Compile button.
  59.       Note that this will NOT add any items to your component palette.
  60.       TdfsDSAForm is not a component, but a TForm descendant class.  So,
  61.       instead of a component palette icon, you will instead have a new "DFS"
  62.       tab added to the Object Repository (File | New).  If you prefer a tab
  63.       name other than "DFS", you can edit the sStickyFormObjRepositoryPage
  64.       constant in DFSStickyFormReg.pas and recompile the package.  Note that
  65.       you can use the name of an existing tab ("Forms" for example) to have the
  66.       items added there.
  67.  
  68.   C++Builder 5 and up:
  69.     * Perform the "Delphi 3 and up, C++Builder 3 and up" steps above, except
  70.       for the last step (Compile or Install).
  71.     * Select the package the component has been added to, and choose
  72.       Project | Edit Option Source to open the package options in the editor.
  73.     * In the entry for PFLAGS, add the "-LUvcl50" option.  For example:
  74.         <PFLAGS value="-$YD -$W -$O -v -JPHNE -M -LUvcl50"/>
  75.     * Perform the final step from above, Compile or Install.
  76.     * For Borland's official word on this situation, open the C++Builder help
  77.       file and search the index for "dsgnintf.dcu" and see the "Compiling
  78.       packages with DsgnIntf" section.
  79.  
  80.   Delphi 6 and up:
  81.     * Perform the "Delphi 3, 4, 5, C++Builder 3 & 4" steps above, except
  82.       for the last step (Compile or Install).
  83.     * Add the DesignIDE package to the Requires list of the package into which
  84.       the component is being installed.
  85.     * Perform the final step from above, Compile or Install.
  86.     * This is necessary because of changes to the design-time support units
  87.       introduced in Delphi 6.  For complete information, see the Del6New.hlp
  88.       file in your Delphi 6 Help directory.  In the index, search for
  89.       "upgrade issues" and in the resulting list of topics, select the
  90.       "DsgnIntf renamed and related changes" topic.
  91.  
  92.  
  93. Design-Time Access to TdfsStickyForm Properties:
  94.   NOTE:  This information applies only to Delphi 3 and above, and C++Builder 3
  95.          and above.  Previous versions of Delphi and C++Builder do NOT support
  96.          design-time access of TForm descendants.  Sorry.  You can should still
  97.          be able to use this class with those prior versions, you just won't
  98.          have access to the new properties at design-time, only in your code at
  99.          run-time.
  100.   * Create a new application project.
  101.   * Select File | New and choose the "DFS" tab in the Object Repository window.
  102.   * Select the "Sticky Form" item and click the OK button.
  103.   * You should now have a new TdfsStickyForm type form added to the project, and
  104.     when you select it all new properties should be visible in the Object
  105.     Inspector.
  106.  
  107.  
  108. Delphi 2, and C++Builder 1 Notes:
  109.   * Although not officially supported, you may be able to use this class with
  110.     Delphi 2 and/or C++Builder 1 by following these directions.
  111.     The best way to use this form is to add it to your Object Repository.
  112.     Simply open this unit in Delphi, right click on the form and select Add
  113.     To Repository.  Then, when you want a TdfsStickyForm, you just select it
  114.     from the repository (File | New) and use the "Inherit" option so you
  115.     don't have to see all this code in your form.
  116.  
  117.     Delphi 1 & 2: If you have existing forms that you want converted to sticky
  118.     forms, simply add "DFSStickyForm" to your "Uses" clause, and change your
  119.     form's ancestor to TdfsStickyForm.  An example:
  120.        Change:
  121.           TMyForm = class(TForm)
  122.        To:
  123.           TMyForm = class(TdfsStickyForm)
  124.  
  125.     C++Builder 1: To convert existing forms, add the DFSStickyForm.pas file to
  126.       the project (using Project Manager), then open the form's header file and
  127.       add:
  128.  
  129.        #include "dfsstickyform.hpp"
  130.  
  131.     above the form class declaration.  Next, change the form's class declaraion:
  132.       Change:
  133.         class TForm1 : public TForm
  134.       To:
  135.         class TForm1 : public TdfsStickyForm
  136.  
  137.     And finally, change the form's constructor in the source (.cpp) file:
  138.       Change:
  139.         __fastcall TForm1::TForm1(TComponent* Owner)
  140.           : TForm(Owner)
  141.         {
  142.       To:
  143.         __fastcall TForm1::TForm1(TComponent* Owner)
  144.           : TdfsStickyForm(Owner)
  145.         {
  146.  
  147. Documentation:
  148.   * StickTo: TdfsStickyObject
  149.     Defines what "object" the form sticks to.  Possible values are:
  150.       soScreen:  Stick to the screen edges
  151.       soParent:  Stick to the parent of the sticky form
  152.       soOwner:   Stick to the owner of the sticky form
  153.       soNothing: Stick to nothing, also known as a teflon form
  154.   * Threshold: integer
  155.     When the form comes within this number of pixels of the StickTo object, it
  156.     will stick to the object.
  157.  
  158.  
  159. Known Issues:
  160.   * You currently can not move a stick form past the object that it sticks to.
  161.     For example, if sticking to the screen edge, you will not be able to move
  162.     the form past the screen edge.  In a future version, the form will "unstick"
  163.     when it has moved past the outside threshold.
  164.  
  165.  
  166. Revision History:
  167.   Beta 2:  + Updated for Delphi 6 compatibility.  See updated install directions
  168.              above.
  169.   1.00:    + Initial release
  170.  
  171.