//=------------------------------------------------------------------------=
// IPFrame.Cpp
//=------------------------------------------------------------------------=
// Copyright 1992-1997 Microsoft Corporation. All Rights Reserved.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//=--------------------------------------------------------------------------=
//
// implementation of the CInPlaceFrame class
//
#include "stdafx.h"
#include "superpad.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
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 'toolbar.bmp'
ID_EDIT_CUT,
ID_EDIT_COPY,
ID_EDIT_PASTE,
ID_SEPARATOR,
ID_APP_ABOUT,
};
/////////////////////////////////////////////////////////////////////////////
// CInPlaceFrame construction/destruction
CInPlaceFrame::CInPlaceFrame()
{
}
CInPlaceFrame::~CInPlaceFrame()
{
}
int CInPlaceFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (COleIPFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndResizeBar.Create(this))
{
TRACE0("Failed to create resize bar\n");
return -1; // fail to create
}
return 0;
}
// OnCreateControlBars is called by the framework to create control
// bars on the client applications windows.
BOOL CInPlaceFrame::OnCreateControlBars(CWnd* pWndFrame, CWnd* /*pWndDoc*/)
{
// create toolbar on client's frame window
if (!m_wndToolBar.Create(pWndFrame) ||
!m_wndToolBar.LoadBitmap(IDR_TEXTTYPE_INPLACE) ||
!m_wndToolBar.SetButtons(buttons,
sizeof(buttons)/sizeof(UINT)))
{
TRACE0("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