home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 October / Chip_1997-10_cd.bin / tema / sybase / powerj / hpp.z / WPAGEDLG.HPP < prev    next >
C/C++ Source or Header  |  1996-10-18  |  6KB  |  184 lines

  1. /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2.    %     Copyright (C) 1994, by WATCOM International Inc.  All rights    %
  3.    %     reserved.  No part of this software may be reproduced or        %
  4.    %     used in any form or by any means - graphic, electronic or       %
  5.    %     mechanical, including photocopying, recording, taping or        %
  6.    %     information storage and retrieval systems - except with the     %
  7.    %     written permission of WATCOM International Inc.                 %
  8.    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  9. */
  10.  
  11. #ifndef _WPAGEDLG_HPP_INCLUDED
  12. #define _WPAGEDLG_HPP_INCLUDED
  13.  
  14. #ifndef _WNO_PRAGMA_PUSH
  15. #pragma pack(push,8);
  16. #pragma enum int;
  17. #endif
  18.  
  19. #ifndef _WCANVAS_HPP_INCLUDED
  20. #  include "wcanvas.hpp"
  21. #endif
  22. #ifndef _WCOMDLG_HPP_INCLUDED
  23. #  include "wcomdlg.hpp"
  24. #endif
  25. #ifndef _WPRTDATA_HPP_INCLUDED
  26. #  include "wprtdata.hpp"
  27. #endif
  28.  
  29. #undef GetPrinterData
  30. #undef SetPrinterData
  31. #if defined( _UNICODE )
  32. #define GetPrinterData GetPrinterDataW
  33. #define SetPrinterData SetPrinterDataW
  34. #else
  35. #define GetPrinterData GetPrinterDataA
  36. #define SetPrinterData SetPrinterDataA
  37. #endif
  38.  
  39. struct WCMCLASS WPageMargins {
  40.     WUInt leftMargin;
  41.     WUInt topMargin;
  42.     WUInt rightMargin;
  43.     WUInt bottomMargin;
  44.  
  45.     WPageMargins();
  46.     WPageMargins( WUInt l, WUInt t, WUInt r, WUInt b );
  47.  
  48.     ~WPageMargins();
  49. };
  50.  
  51. // Styles
  52.  
  53. typedef WULong WPageSetupDStyle;
  54.  
  55. #define WPageDSDefaultMinMargins          ((WPageSetupDStyle)0x00000000L)
  56. #define WPageDSMinMargins                 ((WPageSetupDStyle)0x00000001L)
  57. #define WPageDSMargins                    ((WPageSetupDStyle)0x00000002L)
  58. #define WPageDSInThousandthsOfInches      ((WPageSetupDStyle)0x00000004L)
  59. #define WPageDSInHundredthsOfMillimeters  ((WPageSetupDStyle)0x00000008L)
  60. #define WPageDSDisableMargins             ((WPageSetupDStyle)0x00000010L)
  61. #define WPageDSDisablePrinter             ((WPageSetupDStyle)0x00000020L)
  62. #define WPageDSNoWarning                  ((WPageSetupDStyle)0x00000080L)
  63. #define WPageDSDisableOrientation         ((WPageSetupDStyle)0x00000100L)
  64. #define WPageDSReturnDefault              ((WPageSetupDStyle)0x00000400L)
  65. #define WPageDSDisablePaper               ((WPageSetupDStyle)0x00000200L)
  66. #define WPageDSShowHelp                   ((WPageSetupDStyle)0x00000800L)
  67. #define WPageDSDisablePagePainting        ((WPageSetupDStyle)0x00080000L)
  68.  
  69. //
  70. // WPageSetupDialog
  71. //
  72.  
  73. class WCMCLASS WPageSetupDialog : public WCommonDialog {
  74.     WDeclareSubclass( WPageSetupDialog, WCommonDialog );
  75.  
  76.     public:
  77.         WPageSetupDialog();
  78.  
  79.         ~WPageSetupDialog();
  80.  
  81.         /*******************************************************
  82.          * Properties
  83.          *******************************************************/
  84.  
  85.         // MetricUnits
  86.         //
  87.         //    If TRUE, metric units (hundredths of millimeters)
  88.         //    are used, otherwise imperial units (thousandths of
  89.         //    inches) are used.  The default is based on the locale
  90.         //    settings for the current user.
  91.  
  92.         WBool GetMetricUnits() const;
  93.         WBool SetMetricUnits( WBool metricUnits );
  94.  
  95.         // PageMargins
  96.         //
  97.         //    Set/get the margins, in the current unit settings.
  98.  
  99.         WPageMargins GetPageMargins() const;
  100.         WBool        SetPageMargins( const WPageMargins & pageMargins );
  101.  
  102.         // MinPageMargins
  103.         //
  104.         //    Set/get the minimal margins, in the current unit settings.
  105.  
  106.         WPageMargins GetPageMinMargins() const;
  107.         WBool        SetPageMinMargins( const WPageMargins & pageMargins );
  108.  
  109.         // PageSize
  110.         //
  111.         //    Returns the size of the page, in the current unit
  112.         //    settings.  Top and left are always 0.
  113.  
  114.         WRect GetPageSize() const;
  115.  
  116.         // PrinterData
  117.         //
  118.         //    The data that defines which printer is chosen and
  119.         //    its current settings (landscape, etc.).
  120.  
  121.         WPrinterData GetPrinterData() const;
  122.         WBool        SetPrinterData( const WPrinterData & printerData );
  123.  
  124.         // Style
  125.         //
  126.         //    Set the styles used by the print dialog.  Note that
  127.         //    the WPageSetupDSEnableHook style will ALWAYS be enabled.
  128.  
  129.         WPageSetupDStyle GetStyle() const;
  130.         WBool            SetStyle( WPageSetupDStyle style );
  131.  
  132.         /*******************************************************
  133.          * Methods
  134.          *******************************************************/
  135.  
  136.         // ChangeStyle
  137.         //
  138.         //    Use to turn a specific style on or off.
  139.  
  140.         WBool ChangeStyle( WPageSetupDStyle style, WBool on );
  141.  
  142.         // Prompt
  143.         //
  144.         //    Display the dialog and wait for it to be dismissed.
  145.         //    The first form uses the current settings.  The second
  146.         //    is a convenience function.
  147.  
  148.         WBool Prompt();
  149.  
  150.         WBool Prompt( WWindow * owner, const WChar * title );
  151.  
  152.         /************************************************************
  153.          * Notifications
  154.          ************************************************************/
  155.  
  156.         void OnDialogInitialize( WWindowHandle hWnd, WWindowHandle focus );
  157.  
  158.         /************************************************************
  159.          * Others
  160.          ************************************************************/
  161.  
  162.     private:
  163.  
  164.         void * PackPD();
  165.         WBool UnpackPD( WBool ok );
  166.  
  167.         /************************************************************
  168.          * Data members
  169.          ************************************************************/
  170.  
  171.     private:
  172.  
  173.         void *          _pd;
  174.         WPrinterData    _printerData;
  175. };
  176.  
  177. #ifndef _WNO_PRAGMA_PUSH
  178. #pragma enum pop;
  179. #pragma pack(pop);
  180. #endif
  181.  
  182.  
  183. #endif // _WPAGEDLG_HPP_INCLUDED
  184.