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

  1. TdfsPageSetupDialog v2.14
  2.  
  3. Description:
  4.   A component to wrap the PageSetupDlg API function that Borland forgot.
  5.   It is a common dialog available on the Win95 platform, so it can not be
  6.   used with Delphi 1.0.
  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.     * This component is not compatible with Delphi 1.
  29.  
  30.   Delphi 2, C++Builder 1:
  31.     * Select the 'Component | Install' menu item.
  32.     * In the Install Components dialog, click the Add button.
  33.     * In the Add Module dialog, enter the full path name of the component's
  34.       registration unit (the unit that ends with 'Reg.pas', i.e.
  35.       'BrowseDrReg.pas') and click OK.
  36.     * In the Add Module dialog, click OK.
  37.     * The component library will be rebuilt and a new tab named 'DFS' will be
  38.       available on the Component Palette.
  39.  
  40.   Delphi 3, 4, 5, C++Builder 3 & 4:
  41.     * Do one of the following:
  42.       + Create a new package by selecting File | New and choosing Package from
  43.         the New tab in the dialog.
  44.       + Open an existing package file.  I suggest you do this if you already
  45.         have a package that you like to use for small, third party components.
  46.         I specifically have a package named "3rdParty.dpk" that I use for
  47.         small components that come from other people.  Or, if you are using
  48.         several of my components, you might create a "DFS.dpk" package and
  49.         use it for all of my DFS components.
  50.     * In the resulting package window, click the Add button.
  51.     * In the Add dialog, on the Add Unit tab, enter the full path name of the
  52.       component's registration unit (the unit that ends with 'Reg.pas', i.e.
  53.       'BrowseDrReg.pas') and click OK.
  54.     * You may want to add the other source files (*.pas) to the package as
  55.       well in the same manner as you did the registration unit.  While this is
  56.       not required, not doing it will cause compiler warnings when the package
  57.       is compiled.  The component will function fine either way, but I
  58.       personally find the warnings very irritating and am not happy until
  59.       every compiler warning and hint is gone.
  60.     * If this package is new, or it has never been installed, click the
  61.       Install button in the package window.  If this package is already
  62.       installed in Delphi, click the Compile button.
  63.  
  64.   C++Builder 5 and up:
  65.     * Perform the "Delphi 3 and up, C++Builder 3 and up" steps above, except
  66.       for the last step (Compile or Install).
  67.     * Select the package the component has been added to, and choose 
  68.       Project | Edit Option Source to open the package options in the editor.
  69.     * In the entry for PFLAGS, add the "-LUvcl50" option.  For example:
  70.         <PFLAGS value="-$YD -$W -$O -v -JPHNE -M -LUvcl50"/>
  71.     * Perform the final step from above, Compile or Install.
  72.     * For Borland's official word on this situation, open the C++Builder help
  73.       file and search the index for "dsgnintf.dcu" and see the "Compiling
  74.       packages with DsgnIntf" section.
  75.  
  76.   Delphi 6 and up:
  77.     * Perform the "Delphi 3, 4, 5, C++Builder 3 & 4" steps above, except
  78.       for the last step (Compile or Install).
  79.     * Add the DesignIDE package to the Requires list of the package into which
  80.       the component is being installed.
  81.     * Perform the final step from above, Compile or Install.
  82.     * This is necessary because of changes to the design-time support units
  83.       introduced in Delphi 6.  For complete information, see the Del6New.hlp
  84.       file in your Delphi 6 Help directory.  In the index, search for
  85.       "upgrade issues" and in the resulting list of topics, select the
  86.       "DsgnIntf renamed and related changes" topic.
  87.  
  88.  
  89. Known Issues:
  90.   * There appears to be a bug in the PageSetupDlg Win32 API function.  If the
  91.     PSD_INHUNDREDTHSOFMILLIMETERS flag is used, default minimum margins aren't
  92.     enforced by the dialog.  If PSD_INTHOUSANDTHSOFINCHES is used, they are
  93.     enforced. The reason I think it is an API bug is that Notepad exhibits the
  94.     exact same behavior.  Try this:  Run Notepad with the U.S. measurement
  95.     system and the Metric system.  You'll notice under U.S. that when you go
  96.     into the page setup dialog of Notepad, it will default to your printer's
  97.     minimum margins if you enter a value of 0 for any of the margins.  Under
  98.     metric, you'll notice that entering a value of 0 will be accepted.  You
  99.     can change the measurement system you are currently using by going into
  100.     the Regional Settings Control Panel and chaning the Measurement System
  101.     on the Number tab.
  102.     Note that this only affects the dialog when poDefaultMinMargins is set in
  103.     the Options property.  If this flag is not set, the values in the
  104.     MinimumMargins property will be used and enforced by the dialog.  So,
  105.     a possible work-around for this problem might be to simply leave out the
  106.     poDefaultMinMargins flag.  This would result in the default minimum
  107.     margins being read by the component at start up, and then used by the
  108.     dialog as hard-coded values that it will enforce.  I have not tried this,
  109.     but it seems like it should work.
  110.   * Long delays when using the component:  It is possible that using this
  111.     component can cause long delays at certain points in your app (when creating
  112.     a form that has the component on it).  This is caused by "WinPrinters".  For
  113.     those who don't know, many manufacturers are now selling what are known as
  114.     WinPrinters.  These operate on the same principle as WinModems (what used to
  115.     be called RPI modems):  Move some/most/all of the brains out of the printer
  116.     and put it in the software driver.  This has some benefits, upgrades via
  117.     software instead of hardware being the most compelling, but the tradeoff is
  118.     that using the device places a much greater burden on your system since it
  119.     now has to do work that the printer itself used to do.  Usually, on less
  120.     than state-of-the-art machines or with really stupid WinPrinters, this means
  121.     other software's performance suffers when the printer is being used.  I've
  122.     tried to minimize the impact in the component by only talking to the printer
  123.     when I have to, but you still may see delays.  The best suggestion I have at
  124.     the moment is to always make sure that the printer involved has the most
  125.     current drivers available installed for it.  I have seen this issue resolved
  126.     in at least one case by using an updated driver.
  127.  
  128.  
  129. Revision History:
  130. 2.14   + Updated for Delphi 6 compatibility.  See updated install directions
  131.          above.
  132. 2.13   + Updated for C++Builder 5 compatibility.
  133. 2.12   + Make the PaperSizeType property read/write, not just read.  This is
  134.          useful for setting the paper size type before showing the dialog.
  135.          Also, it's the only way to set the paper size as changing the PaperSize
  136.          property seems to have no effect on the dialog.  For a description of
  137.          valid values used with the property, look up "DEVMODE" in the Win32 SDK
  138.          help file.  Things like DMPAPER_LETTER and DMPAPER_LEGAL.
  139. 2.11   + Reworked when the default property values are retrieved from the
  140.          system.  See Known Issues section above.
  141. 2.10   + It's *really* D5 compatible now.  Small change between the D5 eval 
  142.          version and the real, shipping D5 version broke it.
  143. 2.09   + Fixed nasty little problem with HInstance not being set correctly in
  144.          the DoExecute method.  Many thanks to Andreas Hoerstemeier for 
  145.          catching this.
  146. 2.08   + Classname changed.
  147.        + D5 compatibility.
  148. 2.07   + Updated for C++Builder 4 compatibility.
  149. 2.06   + Component will now check to see if there are any printers installed
  150.          before trying to call the PageSetupDlg API function.  Before, if there
  151.          wasn't a printer installed, you'd get error messages to that effect by
  152.          simply running a program with the component installed.  Now, the error
  153.          message won't be displayed until the user actually tries to bring up
  154.          the dialog.
  155. 2.05   + PaperSizeType public property.  This will return the paper type of the
  156.          currently selected printer.  Constants for these values are defined in
  157.          Windows.pas, and are documented in the Win32.hlp file under the
  158.          "DEVMODE" topic, dmPaperSize member.  A common use for this is to
  159.          determine if the user has selected the user-defined paper size value
  160.          (DMPAPER_USER constant), thus indicating that you need to get the
  161.          size desired from the user.
  162.        + Demo app updated a bit for better rich edit stuff.  Thanks to
  163.          Christopher Sansone for doing this.
  164. 2.04   + Added PgSetupReg unit.  All IDE specific code (i.e. registering the
  165.          component, property editors, etc.) are contained in this unit.  This
  166.          was done for two primary reasons:  1) Using the component in a Delphi
  167.          or C++Builder expert would register the component as well.  2) Reduce
  168.          code size in some cases -- usually the smart linker removes this sort
  169.          of stuff since the app never references it, but now it's for certain
  170.          since it isn't even in the unit.  This change means that you need to
  171.          install the component using the new "registration" unit instead of
  172.          the unit containing the component.
  173. 2.03:  + Seriously nasty bugs that wouldn't update properties like PageSize
  174.          after the user made a selection.  Fixed.
  175.        + Updated demo project to work with either inches or millimeters.
  176.        + Updated Known Issues above.
  177. 2.02:  + PageSize, Margins, MinimumMargins didn't seem to get the system
  178.          default values if the Measurements property was pmDefault.  I've
  179.          reworked the whole thing and it seems to work as it should now.
  180.        + Changing Measurements property would not update custom values of the
  181.          PageSize, Margins, and MinimumMargins properties.  They would only
  182.          update if they contained the system defaults.  Fixed.
  183.        + Forgot to include the updated demo in the distribution archive.  Old
  184.          demo wouldn't compile...
  185. 2.01:  + Added Version property.
  186. 2.00:  + MinimumMargins weren't being enforced.  Default minimums were always
  187.          being used.  That should only happen if poDefaultMinMargins is set in
  188.          Options.  Fixed.
  189.        + PageSize, Margins, and MinimumMargins are all now published instead of
  190.          public.  They initially have the default values of the system, and if
  191.          you do not change them, they will continue to get the default values
  192.          of the system the application is run on.  That is, if your printer has
  193.          a default margin setting of 1000, 1000, 1000, 1000, but one of your
  194.          user's has a printer that has 750, 750, 750, 750, the component will
  195.          show your settings at design time, but use the system's defaults that
  196.          it is being run on.  However, if you change the values, they are then
  197.          stored in your DFM file and used on everyone's system.  If you change
  198.          the values and they are thus stored this way and you change your mind,
  199.          you can get it to revert back to the system defaults by editing your
  200.          form file (right click on it and select View As Text) and removing the
  201.          entries for that property entirely.
  202.        + PageSize, Margins, and MinimumMargins now contain the system defaults
  203.          when initially created.  This is done by calling ReadCurrentValues in
  204.          the constructor, therefor you will rarely need to call this method
  205.          yourself.
  206.        + The following enhancements were suggested by Indridi Bjornsson
  207.          <indridi@isholf.is> and based on code sent by him.  Many thanks.
  208.        + New DefaultMeasurements read-only property that indicates how the
  209.          current system likes to measure things (inches or millimeters) and an
  210.          associated CurrentMeasurements property that translates pmDefault into
  211.          the system value so you get only a pmInches or pmMillimeters value.
  212.        + Measurements property has a new default value, pmDefault.  If set to
  213.          this, the value of DefaultMeasurments will be used in order to use the
  214.          preferences set on the current system.
  215.        + Added two new methods, FromMeasurementVal and ToMeasurementVal to
  216.          convert a value such as Margins.Top to a double value and vice versa
  217.          based on current measurement type.  For example, if the paper size is
  218.          8 1/2 inches and pmInches is the current measurement system, PageSize.X
  219.          would have a value of 8500.  FromMeasurementVal would convert that to
  220.          8.5.
  221. 1.10:  + Added ReadCurrentValues method so the properties can be populated from
  222.          the system and can be read without actually displaying the dialog.
  223. 1.04:  + New property: Centered.  I bet you can guess what it's for.
  224.        + Fixed problem with C++Builder 3 run-time packages.
  225. 1.03:  + Updated for new DFS.INC file, component tab name, history/comments
  226.          file.
  227. 1.02:  + Updated to for compatibility with Delphi 3.
  228. 1.01:  + Added "property editor" to allow testing the dialog at design-time.
  229.          Just right click on it and select 'Test Dialog' from the menu.
  230. 1.00:  + Initial release.
  231.