CMyProperty.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. // ExampelDlg.h : Header-Datei
  2. //
  3. #if !defined(AFX_CPROPERTYG_H__3F20C546_869F_11D2_B6F4_0000C0E36C6E__INCLUDED_)
  4. #define AFX_CPROPERTY_H__3F20C546_869F_11D2_B6F4_0000C0E36C6E__INCLUDED_
  5. #if _MSC_VER >= 1000
  6. #pragma once
  7. #endif // _MSC_VER >= 1000
  8. #define ID_NEXT_FIELD 1
  9. #define ID_PREV_FIELD 2
  10. class CMyPropDialog;
  11. ////////////////////////////////////////////////////////////////////////////
  12. // Class to handle the pages
  13. class CMyPropertyPage : public CObject {
  14. public:
  15. DLGTEMPLATE m_dlgTemplate; // Templatestructure
  16. DLGTEMPLATE *m_pResource; // I create my dialogs on the fly
  17. // so I need a pointer to the memory
  18. HLOCAL m_hLocal; // Memory-Handle
  19. CString m_strTitle;
  20. CMyPropDialog *m_pDialogPage; // pointer to the dialog structur
  21. CRect m_Rect; // size of the dialog on the screen
  22. };
  23. ////////////////////////////////////////////////////////////////////////////
  24. // Class to handle the TabCtrl
  25. class CMyPropertySheet : public CTabCtrl
  26. {
  27. // Construction
  28. public:
  29. CMyPropertySheet();
  30. CRect m_Rect; // Rectangle coordinates
  31. UINT m_nCtrlID; // CTrlID in the dialog
  32. int m_nPages; // number of pages
  33. int m_nActPage; // Actual page
  34. // Array of dialogs
  35. CObArray m_Dialogs;
  36. // Attributes
  37. public:
  38. // Operations
  39. public:
  40. int SetActivePage (int nPage);
  41. int SetActivePage (CMyPropDialog* pPage);
  42. CMyPropDialog *GetPage (int nPage);
  43. CMyPropDialog *GetActivePage (void);
  44. int GetPageCount (void);
  45. BOOL DispPage (int nCommand); // handling pgup and pgdn
  46. //{{AFX_VIRTUAL(CMyPropertySheet)
  47. public:
  48. virtual BOOL PreTranslateMessage(MSG* pMsg);
  49. protected:
  50. virtual void PostNcDestroy();
  51. //}}AFX_VIRTUAL
  52. // Implementation
  53. public:
  54. virtual ~CMyPropertySheet();
  55. protected:
  56. //{{AFX_MSG(CMyPropertySheet)
  57. afx_msg void OnSelchange(NMHDR* pNMHDR, LRESULT* pResult);
  58. //}}AFX_MSG
  59. DECLARE_MESSAGE_MAP()
  60. };
  61. ////////////////////////////////////////////////////////////////////////////
  62. // CMyPropDialog the dialog
  63. class CMyPropDialog : public CDialog
  64. {
  65. // Konstruction
  66. public:
  67. CMyPropDialog(CWnd* pParent = NULL); // Standardconstruction
  68. // Dialogfields
  69. //{{AFX_DATA(CMyPropDialog)
  70. // enum { IDD = _UNKNOWN_RESOURCE_ID_ }; I create my dialogs on the fly
  71. //}}AFX_DATA
  72. //{{AFX_VIRTUAL(CMyPropDialog)
  73. public:
  74. virtual BOOL PreTranslateMessage(MSG* pMsg);
  75. virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra,
  76. AFX_CMDHANDLERINFO* pHandlerInfo);
  77. protected:
  78. virtual void DoDataExchange(CDataExchange* pDX);
  79. virtual void PostNcDestroy();
  80. //}}AFX_VIRTUAL
  81. // Implementation
  82. protected:
  83. //{{AFX_MSG(CMyPropDialog)
  84. //}}AFX_MSG
  85. DECLARE_MESSAGE_MAP()
  86. };
  87. //{{AFX_INSERT_LOCATION}}
  88. // Microsoft Developer Studio fügt zusätzliche Deklarationen unmittelbar vor der vorhergehenden Zeile ein.
  89. #endif // !defined(AFX_CPROPERTY_H__3F20C546_869F_11D2_B6F4_0000C0E36C6E__INCLUDED_)