home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / printpag.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.9 KB  |  107 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #ifndef __PRINTPAG_H
  20. #define __PRINTPAG_H
  21.  
  22. // printpag.h : header file
  23. //
  24.  
  25. class CMarginEdit   : public CGenericEdit
  26. {
  27. public:
  28.     CMarginEdit ( ) : CGenericEdit ( ) { };
  29.     DECLARE_MESSAGE_MAP ( );
  30.     afx_msg void OnChar( UINT nChar, UINT nRepCnt, UINT nFlags );
  31. };
  32.  
  33. class CPagePreview  : public CStatic
  34. {
  35. public:
  36.     CPagePreview ( ) : CStatic ( ) { };
  37.     DECLARE_MESSAGE_MAP ( );
  38.     afx_msg void OnPaint ( );
  39. };
  40.  
  41. /////////////////////////////////////////////////////////////////////////////
  42. // CPrintPageSetup dialog
  43.  
  44. class CPrintPageSetup : public CDialog
  45. {
  46. // Construction
  47. public:
  48.     CPrintPageSetup(CWnd* pParent = NULL);   // standard constructor
  49.  
  50. // Dialog Data
  51.     //{{AFX_DATA(CPrintPageSetup)
  52. #ifdef XP_WIN32
  53.     enum { IDD = IDD_PAGESETUP };
  54. #else
  55.     enum { IDD = IDD_PAGESETUP16 };
  56. #endif
  57.     CButton    m_MarginBox;
  58.     CMarginEdit    m_BottomMargin;
  59.     CMarginEdit    m_LeftMargin;
  60.     CMarginEdit    m_RightMargin;
  61.     CMarginEdit    m_TopMargin;
  62.     BOOL    m_bLinesBlack;
  63.     BOOL    m_bTextBlack;
  64.     BOOL    m_bDate;
  65.     BOOL    m_bPageNo;
  66.     BOOL    m_bSolidLines;
  67.     BOOL    m_bTitle;
  68.     BOOL    m_bTotal;
  69.     BOOL    m_bURL;
  70.     BOOL    m_bReverseOrder;
  71.     BOOL    m_bPrintBkImage;
  72.     long    m_InitialTop,m_InitialBottom,m_InitialLeft,m_InitialRight;
  73.     //}}AFX_DATA
  74.     CPagePreview m_PagePreview;
  75.  
  76.     void ShowPagePreview ( CClientDC & pdc );
  77. // Overrides
  78.     // ClassWizard generated virtual function overrides
  79.     //{{AFX_VIRTUAL(CPrintPageSetup)
  80.     protected:
  81.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  82.     virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  83.     //}}AFX_VIRTUAL
  84.  
  85. // Implementation
  86. protected:
  87.     long lWidth, lHeight;
  88.  
  89.     int UpdateMargins ( BOOL check = FALSE );
  90.     char * TwipsToString ( long twips, long conversion );    
  91.     char * TwipsToLocaleUnit ( long twips );
  92.     long StringToTwips ( char * szBuffer, long conversion );
  93.     long LocaleUnitToTwips ( char * szBuffer );
  94.     void SetLocaleUnit ( void );
  95.     void MarginError ( char * );
  96.  
  97.     // Generated message map functions
  98.     //{{AFX_MSG(CPrintPageSetup)
  99.     virtual void OnOK();
  100.     virtual void OnCancel();
  101.     virtual BOOL OnInitDialog();
  102.     //}}AFX_MSG
  103.     DECLARE_MESSAGE_MAP()
  104. };
  105.  
  106. #endif
  107.