资源简介
组态软件设计与开发PDF+源代码,VC6.0开发,王亚民、陈青、刘畅生、王水平编著
代码片段和文件信息
// CntrItem.cpp : implementation of the CDrawItem class
//
#include “stdafx.h“
#include “DrawCli.h“
#include “DrawCliDoc.h“
#include “DrawCliView.h“
#include “CntrItem.h“
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDrawItem implementation
IMPLEMENT_SERIAL(CDrawItem COleClientItem 0)
CDrawItem::CDrawItem(CDrawCliDoc* pContainer)
: COleClientItem(pContainer)
{
// TODO: add one-time construction code here
}
CDrawItem::~CDrawItem()
{
// TODO: add cleanup code here
}
void CDrawItem::onchange(OLE_NOTIFICATION nCode DWORD dwParam)
{
ASSERT_VALID(this);
COleClientItem::onchange(nCode dwParam);
// When an item is being edited (either in-place or fully open)
// it sends onchange notifications for changes in the state of the
// item or visual appearance of its content.
// TODO: invalidate the item by calling UpdateAllViews
// (with hints appropriate to your application)
GetDocument()->UpdateAllViews(NULL);
// for now just update ALL views/no hints
}
BOOL CDrawItem::onchangeItemPosition(const CRect& rectPos)
{
ASSERT_VALID(this);
// During in-place activation CDrawItem::onchangeItemPosition
// is called by the server to change the position of the in-place
// window. Usually this is a result of the data in the server
// document changing such that the extent has changed or as a result
// of in-place resizing.
//
// The default here is to call the base class which will call
// COleClientItem::SetItemRects to move the item
// to the new position.
if (!COleClientItem::onchangeItemPosition(rectPos))
return FALSE;
// TODO: update any cache you may have of the item‘s rectangle/extent
return TRUE;
}
void CDrawItem::OnGetItemPosition(CRect& rPosition)
{
ASSERT_VALID(this);
// During in-place activation CDrawItem::OnGetItemPosition
// will be called to determine the location of this item. The default
// implementation created from AppWizard simply returns a hard-coded
// rectangle. Usually this rectangle would reflect the current
// position of the item relative to the view used for activation.
// You can obtain the view by calling CDrawItem::GetActiveView.
// TODO: return correct rectangle (in pixels) in rPosition
rPosition.SetRect(10 10 210 210);
}
void CDrawItem::onactivate()
{
// Allow only one inplace activate item per frame
CDrawCliView* pView = GetActiveView();
ASSERT_VALID(pView);
COleClientItem* pItem = GetDocument()->GetInPlaceActiveItem(pView);
if (pItem != NULL && pItem != this)
pItem->Close();
COleClientItem::onactivate();
}
void CDrawItem::ondeactivateUI(BOOL bUndoable)
{
COleClientItem::ondeactivateUI(bUndoable);
// Hide the object if it is not an outside-in object
DWORD dwMisc = 0
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3997 2002-03-26 08:41 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\CntrItem.cpp
文件 1792 2002-03-26 08:41 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\CntrItem.h
文件 3756 2002-03-26 09:13 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\DrawCli.clw
文件 5191 2002-03-26 09:08 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\DrawCli.cpp
文件 5218 2002-03-26 09:13 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\DrawCli.dsp
文件 537 2002-03-26 08:41 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\DrawCli.dsw
文件 1414 2002-03-26 09:08 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\DrawCli.h
文件 66560 2002-04-01 17:52 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\DrawCli.ncb
文件 48640 2002-04-01 17:52 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\DrawCli.opt
文件 2066 2002-04-01 17:47 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\DrawCli.plg
文件 16257 2002-03-26 09:08 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\DrawCli.rc
文件 687 2002-03-26 08:41 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\DrawCli.reg
文件 2595 2002-03-26 08:41 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\DrawCliDoc.cpp
文件 1489 2002-03-26 08:41 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\DrawCliDoc.h
文件 7040 2002-03-26 08:41 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\DrawCliView.cpp
文件 2699 2002-03-26 08:41 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\DrawCliView.h
文件 2652 2002-03-26 09:08 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\MainFrm.cpp
文件 1542 2002-03-26 08:41 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\MainFrm.h
文件 5411 2002-03-26 08:41 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\ReadMe.txt
文件 1078 2002-03-26 08:41 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\res\DrawCli.ico
文件 399 2002-03-26 08:41 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\res\DrawCli.rc2
文件 1078 2002-03-26 08:41 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\res\DrawCliDoc.ico
文件 1078 2002-03-26 08:41 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\res\Toolbar.bmp
文件 819 2002-03-26 09:08 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\Resource.h
文件 3202 2002-03-26 09:13 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\Splash.cpp
文件 1159 2002-03-26 09:08 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\Splash.h
文件 1534 2002-03-26 08:41 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\SplitFrm.cpp
文件 1397 2002-03-26 08:41 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\SplitFrm.h
文件 82538 2002-03-26 09:08 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\Splsh16.bmp
文件 209 2002-03-26 08:41 组态软件设计与开发(源代码)\源代码\Cha02\DrawCli\StdAfx.cpp
............此处省略401个文件信息
- 上一篇:welsh颜色迁移
- 下一篇:完整串口通信程序Vc++源代码
评论
共有 条评论