Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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
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
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
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
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
00141
00142
00143
00144
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