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.

122 lines
5.4 KiB

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 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. // Inlines for AFXDLGS.H
  11. #ifdef _AFXDLGS_INLINE
  12. // CCommonDialog
  13. _AFXDLGS_INLINE CCommonDialog::CCommonDialog(CWnd* pParentWnd)
  14. : CDialog((UINT)0, pParentWnd) { }
  15. // CFileDialog
  16. _AFXDLGS_INLINE BOOL CFileDialog::GetReadOnlyPref() const
  17. { return m_ofn.Flags & OFN_READONLY ? TRUE : FALSE; }
  18. _AFXDLGS_INLINE void CFileDialog::SetTemplate(UINT nWin3ID, UINT nWin4ID)
  19. { SetTemplate(MAKEINTRESOURCE(nWin3ID), MAKEINTRESOURCE(nWin4ID)); }
  20. _AFXDLGS_INLINE POSITION CFileDialog::GetStartPosition() const
  21. { return (POSITION)m_ofn.lpstrFile; }
  22. // CFontDialog
  23. _AFXDLGS_INLINE CString CFontDialog::GetFaceName() const
  24. { return (LPCTSTR)m_cf.lpLogFont->lfFaceName; }
  25. _AFXDLGS_INLINE CString CFontDialog::GetStyleName() const
  26. { return m_cf.lpszStyle; }
  27. _AFXDLGS_INLINE int CFontDialog::GetSize() const
  28. { return m_cf.iPointSize; }
  29. _AFXDLGS_INLINE int CFontDialog::GetWeight() const
  30. { return (int)m_cf.lpLogFont->lfWeight; }
  31. _AFXDLGS_INLINE BOOL CFontDialog::IsItalic() const
  32. { return m_cf.lpLogFont->lfItalic ? TRUE : FALSE; }
  33. _AFXDLGS_INLINE BOOL CFontDialog::IsStrikeOut() const
  34. { return m_cf.lpLogFont->lfStrikeOut ? TRUE : FALSE; }
  35. _AFXDLGS_INLINE BOOL CFontDialog::IsBold() const
  36. { return m_cf.lpLogFont->lfWeight == FW_BOLD ? TRUE : FALSE; }
  37. _AFXDLGS_INLINE BOOL CFontDialog::IsUnderline() const
  38. { return m_cf.lpLogFont->lfUnderline ? TRUE : FALSE; }
  39. _AFXDLGS_INLINE COLORREF CFontDialog::GetColor() const
  40. { return m_cf.rgbColors; }
  41. // CColorDialog
  42. _AFXDLGS_INLINE COLORREF CColorDialog::GetColor() const
  43. { return m_cc.rgbResult; }
  44. // CPrintDialog
  45. _AFXDLGS_INLINE BOOL CPrintDialog::PrintSelection() const
  46. { return m_pd.Flags & PD_SELECTION ? TRUE : FALSE; }
  47. _AFXDLGS_INLINE BOOL CPrintDialog::PrintRange() const
  48. { return m_pd.Flags & PD_PAGENUMS ? TRUE : FALSE; }
  49. _AFXDLGS_INLINE BOOL CPrintDialog::PrintAll() const
  50. { return !PrintRange() && !PrintSelection() ? TRUE : FALSE; }
  51. _AFXDLGS_INLINE BOOL CPrintDialog::PrintCollate() const
  52. { return m_pd.Flags & PD_COLLATE ? TRUE : FALSE; }
  53. _AFXDLGS_INLINE int CPrintDialog::GetFromPage() const
  54. { return (PrintRange() ? m_pd.nFromPage :-1); }
  55. _AFXDLGS_INLINE int CPrintDialog::GetToPage() const
  56. { return (PrintRange() ? m_pd.nToPage :-1); }
  57. _AFXDLGS_INLINE HDC CPrintDialog::GetPrinterDC() const
  58. { ASSERT_VALID(this);
  59. ASSERT(m_pd.Flags & PD_RETURNDC);
  60. return m_pd.hDC; }
  61. // CFindReplaceDialog
  62. _AFXDLGS_INLINE BOOL CFindReplaceDialog::IsTerminating() const
  63. { return m_fr.Flags & FR_DIALOGTERM ? TRUE : FALSE ; }
  64. _AFXDLGS_INLINE CString CFindReplaceDialog::GetReplaceString() const
  65. { return m_fr.lpstrReplaceWith; }
  66. _AFXDLGS_INLINE CString CFindReplaceDialog::GetFindString() const
  67. { return m_fr.lpstrFindWhat; }
  68. _AFXDLGS_INLINE BOOL CFindReplaceDialog::SearchDown() const
  69. { return m_fr.Flags & FR_DOWN ? TRUE : FALSE; }
  70. _AFXDLGS_INLINE BOOL CFindReplaceDialog::FindNext() const
  71. { return m_fr.Flags & FR_FINDNEXT ? TRUE : FALSE; }
  72. _AFXDLGS_INLINE BOOL CFindReplaceDialog::MatchCase() const
  73. { return m_fr.Flags & FR_MATCHCASE ? TRUE : FALSE; }
  74. _AFXDLGS_INLINE BOOL CFindReplaceDialog::MatchWholeWord() const
  75. { return m_fr.Flags & FR_WHOLEWORD ? TRUE : FALSE; }
  76. _AFXDLGS_INLINE BOOL CFindReplaceDialog::ReplaceCurrent() const
  77. { return m_fr. Flags & FR_REPLACE ? TRUE : FALSE; }
  78. _AFXDLGS_INLINE BOOL CFindReplaceDialog::ReplaceAll() const
  79. { return m_fr.Flags & FR_REPLACEALL ? TRUE : FALSE; }
  80. // CPropertySheet
  81. _AFXDLGS_INLINE CPropertyPage* CPropertySheet::GetPage(int nPage) const
  82. { return STATIC_DOWNCAST(CPropertyPage, (CObject*)m_pages[nPage]); }
  83. _AFXDLGS_INLINE void CPropertySheet::SetWizardMode()
  84. { m_psh.dwFlags |= PSH_WIZARD; }
  85. _AFXDLGS_INLINE void CPropertySheet::SetFinishText(LPCTSTR lpszText)
  86. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, PSM_SETFINISHTEXT, 0, (LPARAM)lpszText); }
  87. _AFXDLGS_INLINE void CPropertySheet::SetWizardButtons(DWORD dwFlags)
  88. #if _MFC_VER >= 0x0600
  89. { ASSERT(::IsWindow(m_hWnd)); ::PostMessage(m_hWnd, PSM_SETWIZBUTTONS, 0, dwFlags); }
  90. #else
  91. { ASSERT(::IsWindow(m_hWnd)); ::SendMessage(m_hWnd, PSM_SETWIZBUTTONS, 0, dwFlags); }
  92. #endif
  93. _AFXDLGS_INLINE CTabCtrl* CPropertySheet::GetTabControl() const
  94. { ASSERT(::IsWindow(m_hWnd)); return (CTabCtrl*)CWnd::FromHandle(
  95. (HWND)::SendMessage(m_hWnd, PSM_GETTABCONTROL, 0, 0)); }
  96. _AFXDLGS_INLINE BOOL CPropertySheet::PressButton(int nButton)
  97. { ASSERT(::IsWindow(m_hWnd)); return (BOOL)::SendMessage(m_hWnd, PSM_PRESSBUTTON, nButton, 0); }
  98. #if _MFC_VER >= 0x0600
  99. _AFXDLGS_INLINE BOOL CPropertySheet::IsWizard() const
  100. { return ((((CPropertySheet*)this)->GetPropSheetHeader()->dwFlags & (PSH_WIZARD | PSH_WIZARD97)) != 0); }
  101. // CPropertySheetEx
  102. _AFXDLGS_INLINE void CPropertySheetEx::SetWizardMode()
  103. { m_psh.dwFlags |= PSH_WIZARD; }
  104. #endif
  105. // CPageSetupDialog
  106. _AFXDLGS_INLINE CSize CPageSetupDialog::GetPaperSize() const
  107. { return CSize(m_psd.ptPaperSize.x, m_psd.ptPaperSize.y); }
  108. /////////////////////////////////////////////////////////////////////////////
  109. #endif //_AFXDLGS_INLINE