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

xap_Win32PropertySheet.h

Go to the documentation of this file.
00001 /* AbiWord
00002  * Copyright (C) 2002 Jordi Mas i Hernāndez <jmas@softcatala.org>
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017  * 02110-1301 USA.
00018  */
00019 
00020 #ifndef XAP_Win32PropertySheet_H
00021 #define XAP_Win32PropertySheet_H
00022 
00023 #include <commctrl.h>
00024 #include "ut_vector.h"
00025 #include "xap_Frame.h"
00026 #include "xap_Win32DialogBase.h"
00027 #define ID_APPLY    0x3021
00028 
00029 /*****************************************************************/
00030 
00031 class XAP_Win32PropertySheet;
00032 
00033 // HACK: forward declarations for subclassed controls
00034 #ifdef STRICT
00035 #define WHICHPROC   WNDPROC
00036 #else
00037 #define WHICHPROC   FARPROC
00038 #endif
00039 
00040 #define ID_APPLY_NOW                    0x3021
00041 
00042 
00043 class ABI_EXPORT XAP_Win32PropertyPage : public XAP_Win32DialogBase
00044 {
00045 public:
00046 
00047     XAP_Win32PropertyPage();
00048     virtual ~XAP_Win32PropertyPage();
00049 
00050     void                         createPage(XAP_Win32App* pWin32App, WORD wRscID, XAP_String_Id nID = 0);
00051     PROPSHEETPAGEW*  getStruct(){return &m_page;}
00052     XAP_Win32App*        getApp(){return m_pWin32App;}
00053     HWND                         getHandle(){return m_hDlg;}
00054     void                             setDialogProc(DLGPROC pfnDlgProc){m_pfnDlgProc=pfnDlgProc;};
00055     virtual void             _onInitDialog(){};
00056     virtual void             _onKillActive(){};
00057     virtual void             _onOK(){};
00058     virtual void             _onApply(){};
00059     virtual void             _onNotify(LPNMHDR /*hdr*/, int /*iCtrlID*/){};
00060     static INT_PTR CALLBACK     s_pageWndProc(HWND hWnd, UINT msg, WPARAM wParam,LPARAM lParam);
00061     void                             setChanged (bool bChanged); // Unables or disables apply button
00062 
00063 
00064 private:
00065 
00066     PROPSHEETPAGEW          m_page;
00067     HPROPSHEETPAGE          m_hdle;
00068     XAP_Win32App*               m_pWin32App;
00069     XAP_Win32PropertySheet*     m_pParent;
00070     DLGPROC                     m_pfnDlgProc;
00071     UT_Win32LocaleString        m_title;
00072 
00073 };
00074 
00075 
00076 class ABI_EXPORT XAP_Win32PropertySheet
00077 {
00078 public:
00079     XAP_Win32PropertySheet();
00080 
00081 public:
00082 
00083     int                         runModal(XAP_Win32App* pWin32App,XAP_Frame* pFrame, XAP_String_Id   nID = 0);
00084     int                             runModeless (XAP_Win32App* pWin32App, XAP_Frame * pFrame, XAP_String_Id nID = 0);
00085     void                        addPage(XAP_Win32PropertyPage* pPage);
00086     PROPSHEETPAGEW*                 _buildPageArray(void);
00087     static INT_PTR CALLBACK     s_sheetWndProc(HWND hWnd, UINT msg, WPARAM wParam,LPARAM lParam);
00088     virtual  void               _onInitDialog(HWND /*hwnd*/){};
00089     virtual void                destroy(void);
00090     virtual void                cleanup(void);
00091     HWND                        getHandle(){return m_hWnd;}
00092 
00093     void                        setCallBack(PFNPROPSHEETCALLBACK pCallback) {m_pCallback=pCallback;};
00094     void                        setDialogProc(DLGPROC pfnDlgProc){m_pfnDlgProc=pfnDlgProc;};
00095     void                        setApplyButton(bool b){m_bApplyButton=b;};
00096     void                        setOkButton(bool b){m_bOkButton=b;};
00097     void                        setCancelButton(bool b){m_bCancelButton=b;};
00098 
00099 
00100     virtual BOOL                _onCommand(HWND /*hWnd*/, WPARAM /*wParam*/, LPARAM /*lParam*/){return 1;};
00101     virtual  void               _onOK(){};
00102     virtual  void               _onApply(){};
00103     virtual  void               _onCancel(){};
00104 
00105     int                         m_nRslt;
00106 private:
00107 
00108     HWND                        m_hWnd;
00109     UT_Vector                   m_vecPages;
00110     PROPSHEETHEADERW                m_psh;
00111     PFNPROPSHEETCALLBACK        m_pCallback;
00112     DLGPROC                     m_pfnDlgProc;
00113     WHICHPROC                   m_lpfnDefSheet;
00114     bool                        m_bApplyButton;
00115     bool                        m_bOkButton;
00116     bool                        m_bCancelButton;
00117     PROPSHEETPAGEW*             m_pages;
00118     bool                        m_modeless;
00119 
00120 };
00121 
00122 #endif /* XAP_Win32PropertySheet_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1