BUTTONDI.H
上传用户:aakk678
上传日期:2022-07-09
资源大小:406k
文件大小:2k
源码类别:

界面编程

开发平台:

Visual C++

  1. // buttondi.h : header file
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1997 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CButtonDialog dialog
  14. class CButtonDialog : public CCSDialog
  15. {
  16. // Construction
  17. public:
  18. CButtonDialog(LPCTSTR lpszText, LPCTSTR lpszCaption, LPCTSTR lpszButtons, 
  19. WORD wStyle, DWORD* pHelpIDs = NULL, CWnd* pParentWnd = NULL);
  20. ~CButtonDialog();
  21. // Attributes
  22. CFont m_font;
  23. // Operations
  24. static int DisplayMessageBox(LPCTSTR lpszText, LPCTSTR lpszCaption, 
  25. LPCTSTR lpszButtons, WORD wStyle, int nDef = 0, int nCancel = -1, 
  26. DWORD* pHelpIDs = NULL, CWnd* pParentWnd = NULL);
  27. void AddButton(CString& strButton) { m_strArray.Add(strButton);}
  28. void AddButtons(LPCTSTR lpszButton);
  29. void SetCancel(int nCancel)
  30. { ASSERT(nCancel < m_strArray.GetSize()); m_nCancel = nCancel;}
  31. void SetDefault(int nDef)
  32. { ASSERT(nDef < m_strArray.GetSize()); m_nDefButton = nDef;}
  33. void FillInHeader(LPDLGTEMPLATE lpDlgTmp);
  34. // Overridables
  35. virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  36. virtual int DoModal();
  37. // Implementation
  38. protected:
  39. virtual const DWORD* GetHelpIDs() {return m_pHelpIDs;}
  40. DWORD* m_pHelpIDs;
  41. int m_nDefButton;
  42. int m_nCancel;
  43. HGLOBAL m_hDlgTmp;
  44. UINT m_nBaseID;
  45. WORD m_wStyle;
  46. CButton* m_pButtons;
  47. CStatic m_staticIcon;
  48. CStatic m_staticText;
  49. CString m_strCaption;
  50. CString m_strText;
  51. CStringArray m_strArray;
  52. CSize GetBaseUnits();
  53. LPCTSTR GetIconID(WORD wFlags);
  54. void PositionControls();
  55. // Generated message map functions
  56. //{{AFX_MSG(CButtonDialog)
  57. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  58. virtual BOOL OnInitDialog();
  59. //}}AFX_MSG
  60. DECLARE_MESSAGE_MAP()
  61. };