afxext.inl 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. _AFXEXT_INLINE void CControlBar::SetBorders(LPCRECT lpRect)
  63. { SetBorders(lpRect->left, lpRect->top, lpRect->right, lpRect->bottom); }
  64. _AFXEXT_INLINE CRect CControlBar::GetBorders() const
  65. { return CRect(m_cxLeftBorder, m_cyTopBorder, m_cxRightBorder, m_cyBottomBorder); }
  66. // CToolBar
  67. _AFXEXT_INLINE BOOL CToolBar::LoadToolBar(UINT nIDResource)
  68. { return LoadToolBar(MAKEINTRESOURCE(nIDResource)); }
  69. _AFXEXT_INLINE BOOL CToolBar::LoadBitmap(UINT nIDResource)
  70. { return LoadBitmap(MAKEINTRESOURCE(nIDResource)); }
  71. _AFXEXT_INLINE CToolBarCtrl& CToolBar::GetToolBarCtrl() const
  72. { return *(CToolBarCtrl*)this; }
  73. // CDialogBar
  74. _AFXEXT_INLINE BOOL CDialogBar::Create(CWnd* pParentWnd, UINT nIDTemplate,
  75. UINT nStyle, UINT nID)
  76. { return Create(pParentWnd, MAKEINTRESOURCE(nIDTemplate), nStyle, nID); }
  77. // CStatusBar
  78. _AFXEXT_INLINE CStatusBarCtrl& CStatusBar::GetStatusBarCtrl() const
  79. { return *(CStatusBarCtrl*)this; }
  80. _AFXEXT_INLINE void CStatusBar::SetBorders(LPCRECT lpRect)
  81. { SetBorders(lpRect->left, lpRect->top, lpRect->right, lpRect->bottom); }
  82. _AFXEXT_INLINE void CStatusBar::SetBorders(int cxLeft, int cyTop, int cxRight, int cyBottom)
  83. { ASSERT(cyTop >= 2); CControlBar::SetBorders(cxLeft, cyTop, cxRight, cyBottom); }
  84. #ifdef _DEBUG
  85. // status bars do not support docking
  86. _AFXEXT_INLINE void CStatusBar::EnableDocking(DWORD)
  87. { ASSERT(FALSE); }
  88. #endif
  89. // CReBar
  90. _AFXEXT_INLINE CReBarCtrl& CReBar::GetReBarCtrl() const
  91. { return *(CReBarCtrl*)this; }
  92. #ifdef _DEBUG
  93. // rebars do not support docking
  94. _AFXEXT_INLINE void CReBar::EnableDocking(DWORD)
  95. { ASSERT(FALSE); }
  96. #endif
  97. // CRectTracker
  98. _AFXEXT_INLINE CRectTracker::CRectTracker()
  99. { Construct(); }
  100. // CBitmapButton
  101. _AFXEXT_INLINE CBitmapButton::CBitmapButton()
  102. { }
  103. _AFXEXT_INLINE BOOL CBitmapButton::LoadBitmaps(UINT nIDBitmapResource,
  104. UINT nIDBitmapResourceSel, UINT nIDBitmapResourceFocus,
  105. UINT nIDBitmapResourceDisabled)
  106. { return LoadBitmaps(MAKEINTRESOURCE(nIDBitmapResource),
  107. MAKEINTRESOURCE(nIDBitmapResourceSel),
  108. MAKEINTRESOURCE(nIDBitmapResourceFocus),
  109. MAKEINTRESOURCE(nIDBitmapResourceDisabled)); }
  110. // CPrintInfo
  111. _AFXEXT_INLINE void CPrintInfo::SetMinPage(UINT nMinPage)
  112. { m_pPD->m_pd.nMinPage = (WORD)nMinPage; }
  113. _AFXEXT_INLINE void CPrintInfo::SetMaxPage(UINT nMaxPage)
  114. { m_pPD->m_pd.nMaxPage = (WORD)nMaxPage; }
  115. _AFXEXT_INLINE UINT CPrintInfo::GetMinPage() const
  116. { return m_pPD->m_pd.nMinPage; }
  117. _AFXEXT_INLINE UINT CPrintInfo::GetMaxPage() const
  118. { return m_pPD->m_pd.nMaxPage; }
  119. _AFXEXT_INLINE UINT CPrintInfo::GetFromPage() const
  120. { return m_pPD->m_pd.nFromPage; }
  121. _AFXEXT_INLINE UINT CPrintInfo::GetToPage() const
  122. { return m_pPD->m_pd.nToPage; }
  123. // CEditView
  124. _AFXEXT_INLINE CEdit& CEditView::GetEditCtrl() const
  125. { return *(CEdit*)this; }
  126. #endif //_AFXEXT_INLINE
  127. /////////////////////////////////////////////////////////////////////////////