COleIPFrameWndEx Class
The COleIPFrameWndEx class implements an OLE container that supports the MFC Feature Pack. You must derive the in-place frame window class for your application from the COleIPFrameWndEx class, instead of deriving it from the COleIPFrameWndclass.
class COleIPFrameWndEx : public COleIPFrameWnd
Members
Public Methods
Name |
Description |
---|---|
|
|
|
|
|
|
|
|
Docks one pane to the left of another pane. |
|
|
|
|
|
|
|
Returns a pointer to the currently displayed popup menu. |
|
|
|
Returns the resource ID of the frame window that you specified when the window was loaded. |
|
|
|
|
|
|
|
Returns a pointer to the menu bar object attached to the frame window. |
|
|
|
Returns a list of pane objects that are in a tear-off state. |
|
Called by the framework before the tooltip for a button is displayed. |
|
|
|
Determines whether the pointer to the menu bar object is not NULL. |
|
|
|
(Overrides COleIPFrameWnd::LoadFrame.) |
|
|
|
|
|
Called by the framework when an active pop-up menu processes a WM_DESTROY message. |
|
(Overrides CFrameWnd::OnCmdMsg.) |
|
Called by the framework when the image associated with a menu item is drawn. |
|
Called by the framework when a CMFCPopupMenuobject processes a WM_PAINT message. |
|
Called by the framework when a CMFCToolBarButtonobject processes WM_NCHITTEST message. |
|
|
|
Call this member function to set the application's main frame window into and out of print-preview mode. (Overrides CFrameWnd::OnSetPreviewMode.) |
|
|
|
|
|
Called by the framework when a pop-up menu is activated. |
|
Called by the framework when a menu that has a tear-off bar is activated. |
|
|
|
(Overrides COleIPFrameWnd::PreTranslateMessage.) |
|
(Overrides COleIPFrameWnd::RecalcLayout.) |
|
|
|
Applies the specified docking state to the panes that belong to the frame window. |
|
Modifies a toolbar object by searching for dummy items and replacing them with the specified user-defined items. |
|
|
Protected Methods
Name |
Description |
---|---|
Tells the framework to initialize a range of control IDs that are assigned to user-defined toolbars. |
Example
The following example demonstrates how to subclass an instance of the COleIPFrameWndEx class and over ride its methods. The example shows how to over ride the OnDestory method, the RepositionFrame method, the RecalcLayout method, and the CalcWindowRect method. This code snippet is part of the WordPad Sample: MFC WordPad Application.
void CInPlaceFrame::OnDestroy()
{
m_wndToolBar.DestroyWindow();
m_wndFormatBar.DestroyWindow();
COleIPFrameWndEx::OnDestroy();
}
void CInPlaceFrame::RepositionFrame(LPCRECT lpPosRect, LPCRECT lpClipRect)
{
CRect rectNew = lpPosRect;
rectNew.left -= HORZ_TEXTOFFSET;
rectNew.top -= VERT_TEXTOFFSET;
m_wndResizeBar.BringWindowToTop();
COleIPFrameWndEx::RepositionFrame(&rectNew, lpClipRect);
CWnd* pWnd = GetActiveView();
if (pWnd != NULL)
pWnd->BringWindowToTop();
m_wndRulerBar.BringWindowToTop();
}
void CInPlaceFrame::RecalcLayout(BOOL bNotify)
{
if (m_wndResizeBar.m_hWnd != NULL)
m_wndResizeBar.BringWindowToTop();
COleIPFrameWndEx::RecalcLayout(bNotify);
CWnd* pWnd = GetActiveView();
if (pWnd != NULL)
pWnd->BringWindowToTop();
if (m_wndRulerBar.m_hWnd != NULL)
m_wndRulerBar.BringWindowToTop();
// at least 12 pt region plus ruler if it exists
CDisplayIC dc;
CSize size;
size.cy = MulDiv(12, dc.GetDeviceCaps(LOGPIXELSY), 72)+1;
size.cx = dc.GetDeviceCaps(LOGPIXELSX)/4; // 1/4"
size.cx += HORZ_TEXTOFFSET; //adjust for offset
size.cy += VERT_TEXTOFFSET;
if (m_wndRulerBar.m_hWnd != NULL && m_wndRulerBar.IsVisible())
{
CRect rect;
m_wndRulerBar.GetWindowRect(&rect);
size.cy += rect.Height();
}
m_wndResizeBar.SetMinSize(size);
}
void CInPlaceFrame::CalcWindowRect(LPRECT lpClientRect, UINT nAdjustType)
{
COleIPFrameWndEx::CalcWindowRect(lpClientRect, nAdjustType);
}
Inheritance Hierarchy
Requirements
Header: afxoleipframewndex.h