home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 13
/
mediashare_13.zip
/
mediashare_13
/
ZIPPED
/
PROGRAM
/
WTJ9403.ZIP
/
OTEXT
/
OTEXT.ARJ
/
IPFRAME.CPP
next >
Wrap
C/C++ Source or Header
|
1994-01-02
|
3KB
|
116 lines
// ipframe.cpp : implementation of the CInPlaceFrame class
//
#include "stdafx.h"
#include "otext.h"
#include "ipframe.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CInPlaceFrame
IMPLEMENT_DYNCREATE(CInPlaceFrame, COleIPFrameWnd)
BEGIN_MESSAGE_MAP(CInPlaceFrame, COleIPFrameWnd)
//{{AFX_MSG_MAP(CInPlaceFrame)
ON_WM_CREATE()
//}}AFX_MSG_MAP
// Global help commands
ON_COMMAND(ID_HELP_INDEX, COleIPFrameWnd::OnHelpIndex)
ON_COMMAND(ID_HELP_USING, COleIPFrameWnd::OnHelpUsing)
ON_COMMAND(ID_HELP, COleIPFrameWnd::OnHelp)
ON_COMMAND(ID_DEFAULT_HELP, COleIPFrameWnd::OnHelpIndex)
ON_COMMAND(ID_CONTEXT_HELP, COleIPFrameWnd::OnContextHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// arrays of IDs used to initialize control bars
// toolbar buttons - IDs are command buttons
static UINT BASED_CODE buttons[] =
{
// same order as in the bitmap 'itoolbar.bmp'
ID_EDIT_CUT,
ID_EDIT_COPY,
ID_EDIT_PASTE,
ID_SEPARATOR,
ID_APP_ABOUT,
ID_CONTEXT_HELP,
};
/////////////////////////////////////////////////////////////////////////////
// CInPlaceFrame construction/destruction
CInPlaceFrame::CInPlaceFrame()
{
}
CInPlaceFrame::~CInPlaceFrame()
{
}
int CInPlaceFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (COleIPFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
// CResizeBar implements in-place resizing.
if (!m_wndResizeBar.Create(this))
{
TRACE("Failed to create resize bar\n");
return -1; // fail to create
}
// By default, it is a good idea to register a drop-target that does
// nothing with your frame window. This prevents drops from
// "falling through" to a container that supports drag-drop.
m_dropTarget.Register(this);
return 0;
}
// OnCreateControlBars is called by the framework to create control bars on the
// container application's windows. pWndFrame is the top level frame window of
// the container and is always non-NULL. pWndDoc is the doc level frame window
// and will be NULL when the container is an SDI application. A server
// application can place MFC control bars on either window.
BOOL CInPlaceFrame::OnCreateControlBars(CWnd* pWndFrame, CWnd* pWndDoc)
{
// Create toolbar on client's frame window
if (!m_wndToolBar.Create(pWndFrame) ||
!m_wndToolBar.LoadBitmap(IDR_SRVR_INPLACE) ||
!m_wndToolBar.SetButtons(buttons, sizeof(buttons)/sizeof(UINT)))
{
TRACE("Failed to create toolbar\n");
return FALSE;
}
// Set owner to this window, so messages are delivered to correct app
m_wndToolBar.SetOwner(this);
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CInPlaceFrame diagnostics
#ifdef _DEBUG
void CInPlaceFrame::AssertValid() const
{
COleIPFrameWnd::AssertValid();
}
void CInPlaceFrame::Dump(CDumpContext& dc) const
{
COleIPFrameWnd::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CInPlaceFrame commands