home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / mfc / include / afxdlgs.inl < prev    next >
Text File  |  1998-06-16  |  5KB  |  117 lines

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