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.

148 lines
6.0 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 AFXEXT.H
  11. #ifdef _AFXEXT_INLINE
  12. // CCreateContext
  13. _AFXEXT_INLINE CCreateContext::CCreateContext()
  14. { memset(this, 0, sizeof(*this)); }
  15. // CMetaFileDC
  16. _AFXEXT_INLINE BOOL CMetaFileDC::Create(LPCTSTR lpszFilename)
  17. { return Attach(::CreateMetaFile(lpszFilename)); }
  18. _AFXEXT_INLINE HMETAFILE CMetaFileDC::Close()
  19. { return ::CloseMetaFile(Detach()); }
  20. _AFXEXT_INLINE BOOL CMetaFileDC::CreateEnhanced(CDC* pDCRef,
  21. LPCTSTR lpszFileName, LPCRECT lpBounds, LPCTSTR lpszDescription)
  22. { return Attach(::CreateEnhMetaFile(pDCRef->GetSafeHdc(),
  23. lpszFileName, lpBounds, lpszDescription)); }
  24. _AFXEXT_INLINE HENHMETAFILE CMetaFileDC::CloseEnhanced()
  25. { return ::CloseEnhMetaFile(Detach()); }
  26. _AFXEXT_INLINE CPoint CMetaFileDC::SetViewportOrg(POINT point)
  27. { ASSERT(m_hDC != NULL); return SetViewportOrg(point.x, point.y); }
  28. _AFXEXT_INLINE CSize CMetaFileDC::SetViewportExt(SIZE size)
  29. { ASSERT(m_hDC != NULL); return SetViewportExt(size.cx, size.cy); }
  30. _AFXEXT_INLINE BOOL CMetaFileDC::TextOut(int x, int y, const CString& str)
  31. { ASSERT(m_hDC != NULL); return TextOut(x, y, (LPCTSTR)str, str.GetLength()); }
  32. _AFXEXT_INLINE BOOL CMetaFileDC::ExtTextOut(int x, int y, UINT nOptions, LPCRECT lpRect,
  33. const CString& str, LPINT lpDxWidths)
  34. { ASSERT(m_hDC != NULL); return ::ExtTextOut(m_hDC, x, y, nOptions, lpRect,
  35. str, str.GetLength(), lpDxWidths); }
  36. _AFXEXT_INLINE CSize CMetaFileDC::TabbedTextOut(int x, int y, const CString& str,
  37. int nTabPositions, LPINT lpnTabStopPositions, int nTabOrigin)
  38. { ASSERT(m_hDC != NULL); return ::TabbedTextOut(m_hDC, x, y, str, str.GetLength(),
  39. nTabPositions, lpnTabStopPositions, nTabOrigin); }
  40. _AFXEXT_INLINE int CMetaFileDC::DrawText(const CString& str, LPRECT lpRect, UINT nFormat)
  41. { ASSERT(m_hDC != NULL);
  42. return DrawText((LPCTSTR)str, str.GetLength(), lpRect, nFormat); }
  43. _AFXEXT_INLINE BOOL CMetaFileDC::PtVisible(POINT point) const
  44. { ASSERT(m_hDC != NULL); return PtVisible(point.x, point.y); }
  45. // CSplitterWnd
  46. _AFXEXT_INLINE int CSplitterWnd::GetRowCount() const
  47. { return m_nRows; }
  48. _AFXEXT_INLINE int CSplitterWnd::GetColumnCount() const
  49. { return m_nCols; }
  50. // obsolete functions
  51. _AFXEXT_INLINE BOOL CSplitterWnd::IsChildPane(CWnd* pWnd, int& row, int& col)
  52. { return IsChildPane(pWnd, &row, &col); }
  53. _AFXEXT_INLINE CWnd* CSplitterWnd::GetActivePane(int& row, int& col)
  54. { return GetActivePane(&row, &col); }
  55. _AFXEXT_INLINE BOOL CSplitterWnd::IsTracking()
  56. { return m_bTracking; }
  57. // CControlBar
  58. _AFXEXT_INLINE int CControlBar::GetCount() const
  59. { return m_nCount; }
  60. _AFXEXT_INLINE DWORD CControlBar::GetBarStyle()
  61. { return m_dwStyle; }
  62. #if _MFC_VER >= 0x0600
  63. _AFXEXT_INLINE void CControlBar::SetBorders(LPCRECT lpRect)
  64. { SetBorders(lpRect->left, lpRect->top, lpRect->right, lpRect->bottom); }
  65. _AFXEXT_INLINE CRect CControlBar::GetBorders() const
  66. { return CRect(m_cxLeftBorder, m_cyTopBorder, m_cxRightBorder, m_cyBottomBorder); }
  67. #endif
  68. // CToolBar
  69. _AFXEXT_INLINE BOOL CToolBar::LoadToolBar(UINT nIDResource)
  70. { return LoadToolBar(MAKEINTRESOURCE(nIDResource)); }
  71. _AFXEXT_INLINE BOOL CToolBar::LoadBitmap(UINT nIDResource)
  72. { return LoadBitmap(MAKEINTRESOURCE(nIDResource)); }
  73. _AFXEXT_INLINE CToolBarCtrl& CToolBar::GetToolBarCtrl() const
  74. { return *(CToolBarCtrl*)this; }
  75. // CDialogBar
  76. _AFXEXT_INLINE BOOL CDialogBar::Create(CWnd* pParentWnd, UINT nIDTemplate,
  77. UINT nStyle, UINT nID)
  78. { return Create(pParentWnd, MAKEINTRESOURCE(nIDTemplate), nStyle, nID); }
  79. // CStatusBar
  80. _AFXEXT_INLINE CStatusBarCtrl& CStatusBar::GetStatusBarCtrl() const
  81. { return *(CStatusBarCtrl*)this; }
  82. #if _MFC_VER >= 0x0600
  83. _AFXEXT_INLINE void CStatusBar::SetBorders(LPCRECT lpRect)
  84. { SetBorders(lpRect->left, lpRect->top, lpRect->right, lpRect->bottom); }
  85. _AFXEXT_INLINE void CStatusBar::SetBorders(int cxLeft, int cyTop, int cxRight, int cyBottom)
  86. { ASSERT(cyTop >= 2); CControlBar::SetBorders(cxLeft, cyTop, cxRight, cyBottom); }
  87. #endif
  88. #ifdef _DEBUG
  89. // status bars do not support docking
  90. _AFXEXT_INLINE void CStatusBar::EnableDocking(DWORD)
  91. { ASSERT(FALSE); }
  92. #endif
  93. #if _MFC_VER >= 0x0600
  94. // CReBar
  95. _AFXEXT_INLINE CReBarCtrl& CReBar::GetReBarCtrl() const
  96. { return *(CReBarCtrl*)this; }
  97. #ifdef _DEBUG
  98. // rebars do not support docking
  99. _AFXEXT_INLINE void CReBar::EnableDocking(DWORD)
  100. { ASSERT(FALSE); }
  101. #endif
  102. #endif // _MFC_VER
  103. // CRectTracker
  104. _AFXEXT_INLINE CRectTracker::CRectTracker()
  105. { Construct(); }
  106. // CBitmapButton
  107. _AFXEXT_INLINE CBitmapButton::CBitmapButton()
  108. { }
  109. _AFXEXT_INLINE BOOL CBitmapButton::LoadBitmaps(UINT nIDBitmapResource,
  110. UINT nIDBitmapResourceSel, UINT nIDBitmapResourceFocus,
  111. UINT nIDBitmapResourceDisabled)
  112. { return LoadBitmaps(MAKEINTRESOURCE(nIDBitmapResource),
  113. MAKEINTRESOURCE(nIDBitmapResourceSel),
  114. MAKEINTRESOURCE(nIDBitmapResourceFocus),
  115. MAKEINTRESOURCE(nIDBitmapResourceDisabled)); }
  116. // CPrintInfo
  117. _AFXEXT_INLINE void CPrintInfo::SetMinPage(UINT nMinPage)
  118. { m_pPD->m_pd.nMinPage = (WORD)nMinPage; }
  119. _AFXEXT_INLINE void CPrintInfo::SetMaxPage(UINT nMaxPage)
  120. { m_pPD->m_pd.nMaxPage = (WORD)nMaxPage; }
  121. _AFXEXT_INLINE UINT CPrintInfo::GetMinPage() const
  122. { return m_pPD->m_pd.nMinPage; }
  123. _AFXEXT_INLINE UINT CPrintInfo::GetMaxPage() const
  124. { return m_pPD->m_pd.nMaxPage; }
  125. _AFXEXT_INLINE UINT CPrintInfo::GetFromPage() const
  126. { return m_pPD->m_pd.nFromPage; }
  127. _AFXEXT_INLINE UINT CPrintInfo::GetToPage() const
  128. { return m_pPD->m_pd.nToPage; }
  129. // CEditView
  130. _AFXEXT_INLINE CEdit& CEditView::GetEditCtrl() const
  131. { return *(CEdit*)this; }
  132. #endif //_AFXEXT_INLINE
  133. /////////////////////////////////////////////////////////////////////////////