Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

144 lines
3.7 KiB

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1995 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10. #ifndef __AFXDLGS2_H__
  11. #define __AFXDLGS2_H__
  12. #ifndef __AFXWIN_H__
  13. #include <afxwin.h>
  14. #endif
  15. #ifndef _INC_COMMDLG
  16. #include <commdlg.h> // common dialog APIs
  17. #endif
  18. #ifndef _RICHEDIT_
  19. #include "richedit.h"
  20. #endif
  21. #ifdef _AFX_MINREBUILD
  22. #pragma component(minrebuild, off)
  23. #endif
  24. #ifndef _AFX_FULLTYPEINFO
  25. #pragma component(mintypeinfo, on)
  26. #endif
  27. #ifndef _AFX_NOFORCE_LIBS
  28. #ifndef _MAC
  29. /////////////////////////////////////////////////////////////////////////////
  30. // Win32 libraries
  31. #else //!_MAC
  32. /////////////////////////////////////////////////////////////////////////////
  33. // Mac libraries
  34. #endif //_MAC
  35. #endif //!_AFX_NOFORCE_LIBS
  36. /////////////////////////////////////////////////////////////////////////////
  37. #ifdef _AFX_PACKING
  38. #pragma pack(push, _AFX_PACKING)
  39. #endif
  40. /////////////////////////////////////////////////////////////////////////////
  41. // AFXDLGS - MFC Standard dialogs
  42. // Classes declared in this file
  43. // CDialog
  44. //class CCommonDialog; // implementation base class
  45. class CFontDialog2; // Font chooser dialog
  46. /////////////////////////////////////////////////////////////////////////////
  47. #undef AFX_DATA
  48. #define AFX_DATA
  49. /////////////////////////////////////////////////////////////////////////////
  50. // CFontDialog2 - used to select a font
  51. class CFontDialog2 : public CCommonDialog
  52. {
  53. DECLARE_DYNAMIC(CFontDialog2)
  54. public:
  55. // Attributes
  56. // font choosing parameter block
  57. CHOOSEFONT m_cf;
  58. // Constructors
  59. CFontDialog2(LPLOGFONT lplfInitial = NULL,
  60. DWORD dwFlags = CF_EFFECTS | CF_SCREENFONTS,
  61. CDC* pdcPrinter = NULL,
  62. CWnd* pParentWnd = NULL);
  63. CFontDialog2(const CHARFORMAT& charformat,
  64. DWORD dwFlags = CF_SCREENFONTS,
  65. CDC* pdcPrinter = NULL,
  66. CWnd* pParentWnd = NULL);
  67. // Operations
  68. virtual INT_PTR DoModal();
  69. // Get the selected font (works during DoModal displayed or after)
  70. void GetCurrentFont(LPLOGFONT lplf);
  71. // Helpers for parsing information after successful return
  72. CString GetFaceName() const; // return the face name of the font
  73. CString GetStyleName() const; // return the style name of the font
  74. int GetSize() const; // return the pt size of the font
  75. COLORREF GetColor() const; // return the color of the font
  76. int GetWeight() const; // return the chosen font weight
  77. BOOL IsStrikeOut() const; // return TRUE if strikeout
  78. BOOL IsUnderline() const; // return TRUE if underline
  79. BOOL IsBold() const; // return TRUE if bold font
  80. BOOL IsItalic() const; // return TRUE if italic font
  81. void GetCharFormat(CHARFORMAT& cf) const;
  82. // Implementation
  83. LOGFONT m_lf; // default LOGFONT to store the info
  84. DWORD FillInLogFont(const CHARFORMAT& cf);
  85. #ifdef _DEBUG
  86. public:
  87. virtual void Dump(CDumpContext& dc) const;
  88. #endif
  89. protected:
  90. TCHAR m_szStyleName[64]; // contains style name after return
  91. };
  92. #ifdef _AFX_PACKING
  93. #pragma pack(pop)
  94. #endif
  95. #ifdef _AFX_ENABLE_INLINES
  96. #ifndef _AFXDLGS_INLINE
  97. #define _AFXDLGS_INLINE inline
  98. #endif
  99. #include <afxdlgs2.inl>
  100. #endif
  101. #undef AFX_DATA
  102. #define AFX_DATA
  103. #ifdef _AFX_MINREBUILD
  104. #pragma component(minrebuild, on)
  105. #endif
  106. #ifndef _AFX_FULLTYPEINFO
  107. #pragma component(mintypeinfo, off)
  108. #endif
  109. #endif //__AFXDLGS2_H__
  110. /////////////////////////////////////////////////////////////////////////////