• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

ap_Win32Dialog_PageSetup.h

Go to the documentation of this file.
00001 /* AbiWord
00002  * Copyright (C) 2001 AbiSource, Inc.
00003  * Copyright (C) 2004 Mikey Cooper (mikey@bluey.com)
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00018  * 02110-1301 USA.
00019  */
00020 
00021 #ifndef AP_WIN32DIALOG_PAGESETUP_H
00022 #define AP_WIN32DIALOG_PAGESETUP_H
00023 
00024 #include "ap_Dialog_PageSetup.h"
00025 #include "xap_Win32PropertySheet.h"
00026 #include "xap_Frame.h"
00027 #include "xap_Win32DialogBase.h"
00028 
00029 class AP_Win32Dialog_PageSetup;
00030 /*
00031     Sheet
00032 */
00033 class ABI_EXPORT AP_Win32Dialog_PageSetup_Sheet: public XAP_Win32PropertySheet, XAP_Win32DialogBase
00034 {
00035 public:
00036         AP_Win32Dialog_PageSetup_Sheet();
00037         void _onInitDialog(HWND hwnd);
00038 
00039         void setParent(AP_Win32Dialog_PageSetup*    pData){m_pParent=pData;};
00040         AP_Win32Dialog_PageSetup* getParent(){return m_pParent;};
00041         int _onCommand(HWND hWnd, WPARAM wParam, LPARAM lParam);
00042         static INT_PTR CALLBACK s_sheetInit(HWND hwnd,  UINT uMsg,  LPARAM lParam);
00043 
00044 private:
00045 
00046         AP_Win32Dialog_PageSetup*   m_pParent;
00047 };
00048 
00049 /*
00050     Page page
00051 */
00052 class ABI_EXPORT AP_Win32Dialog_PageSetup_Page: public XAP_Win32PropertyPage
00053 {
00054 public:
00055                                 AP_Win32Dialog_PageSetup_Page();
00056                                 ~AP_Win32Dialog_PageSetup_Page();
00057 
00058     void                        setContainer(AP_Win32Dialog_PageSetup*  pParent){m_pParent=pParent;};
00059     AP_Win32Dialog_PageSetup*   getContainer(){return m_pParent;};
00060     static INT_PTR CALLBACK     s_pageWndProc(HWND hWnd, UINT msg, WPARAM wParam,   LPARAM lParam);
00061 
00062 protected:
00063     void                        doSpinControl(UT_uint32 id, UT_sint32 delta);
00064 
00065 private:
00066 
00067     void                        _onInitDialog();
00068     void                        _onKillActive(){};
00069     BOOL                        _onCommand(HWND hWnd, WPARAM wParam, LPARAM lParam);
00070 
00071     AP_Win32Dialog_PageSetup*   m_pParent;
00072     int                         m_nCentered;
00073 };
00074 
00075 /*
00076     Margin page
00077 */
00078 class ABI_EXPORT AP_Win32Dialog_PageSetup_Margin: public XAP_Win32PropertyPage
00079 {
00080 public:
00081                                 AP_Win32Dialog_PageSetup_Margin();
00082                                 ~AP_Win32Dialog_PageSetup_Margin();
00083 
00084     void                        setContainer(AP_Win32Dialog_PageSetup*  pParent){m_pParent=pParent;};
00085     AP_Win32Dialog_PageSetup*   getContainer(){return m_pParent;};
00086     static INT_PTR CALLBACK     s_pageWndProc(HWND hWnd, UINT msg, WPARAM wParam,   LPARAM lParam);
00087 
00088 protected:
00089     void                        doSpinControl(UT_uint32 id, UT_sint32 delta);
00090 
00091 private:
00092 
00093     void                        _onInitDialog();
00094     void                        _onKillActive(){};
00095     BOOL                        _onCommand(HWND hWnd, WPARAM wParam, LPARAM lParam);
00096 
00097     AP_Win32Dialog_PageSetup*   m_pParent;
00098 
00099 };
00100 
00101 
00102 
00103 
00104 /*****************************************************************/
00105 class ABI_EXPORT AP_Win32Dialog_PageSetup: public AP_Dialog_PageSetup
00106 {
00107 friend class AP_Win32Dialog_PageSetup_Sheet;
00108 friend class AP_Win32Dialog_PageSetup_Page;
00109 friend class AP_Win32Dialog_PageSetup_Margin;
00110 
00111 public:
00112     AP_Win32Dialog_PageSetup(XAP_DialogFactory *pDlgFactory, XAP_Dialog_Id id);
00113     virtual ~AP_Win32Dialog_PageSetup (void);
00114 
00115     virtual void            runModal(XAP_Frame * pFrame);
00116 
00117     static XAP_Dialog *     static_constructor(XAP_DialogFactory *, XAP_Dialog_Id id);
00118 
00119     XAP_DialogFactory *     getDialogFactory() {return  m_pDialogFactory;};
00120     XAP_Frame *             getFrame() {return  m_pFrame;};
00121 
00122 protected:
00123 
00124     AP_Win32Dialog_PageSetup_Page       m_page;
00125     AP_Win32Dialog_PageSetup_Margin     m_margin;
00126     //UT_sint32                 m_curSelection;
00127 
00128     void                        updatePageSize();
00129     void                        updateWidth();
00130     void                        updateHeight();
00131     void                        updateMargins();
00132     void                        updateTopMargin();
00133     void                        updateBottomMargin();
00134     void                        updateLeftMargin();
00135     void                        updateRightMargin();
00136     void                        updateHeaderMargin();
00137     void                        updateFooterMargin();
00138     void                        updatePreview();
00139 
00140     //HWND                      m_hwndDlg;      // parent dialog
00141     //HWND                      m_hwndTab;      // tab control in parent dialog
00142 
00143     //int                           m_nrSubDlgs;        // number of tabs on tab control
00144     //UT_Vector                 m_vecSubDlgHWnd;    // hwnd to each sub-dialog
00145 
00146     HBITMAP                 m_bmpLandscape;
00147     HBITMAP                 m_bmpPortrait;
00148     HBITMAP                 m_bmpPreview;
00149 
00150     fp_PageSize                 m_PageSize;
00151 
00152 private:
00153     XAP_DialogFactory *         m_pDialogFactory;
00154 };
00155 
00156 #endif

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1