本文整理汇总了C++中CObj::GetObjectRect方法的典型用法代码示例。如果您正苦于以下问题:C++ CObj::GetObjectRect方法的具体用法?C++ CObj::GetObjectRect怎么用?C++ CObj::GetObjectRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CObj
的用法示例。
在下文中一共展示了CObj::GetObjectRect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnBeginDrag
void ObjectBarDialog::OnBeginDrag(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
*pResult = 0;
POSITION Pos = objects.GetFirstSelectedItemPosition();
int Item = objects.GetNextSelectedItem(Pos);
if (Item == -1) return; // Safety first
// Select in layout editor, if it's open
if (parent.m_tabs.SelectionGet() == 0 && parent.m_tabs.ItemGetCount() == 2)
{
// Find a CObj for the CObjType
CObjType* pType;
long ID = objects.GetItemData(Item);
if (ID == -1)
return; //folder
application->object_types.Lookup(ID, pType);
// Find out if this is a nonframe object
CPlugin plugin = GetPlugin(pType->DLLIndex);
if (plugin.m_Flags & OF_NODRAW)
return;
CLayout* pLayout = parent.layout_editor[0][0]->layout;
// We're creating a duplicate
g_bDuplicate = TRUE;
parent.layout_editor[0][0]->m_sel.RemoveAll();
// Iterate each instance
POSITION InstancePos = pLayout->objects.GetStartPosition();
long unused = 0;
CObj* pObj;
while (InstancePos)
{
pLayout->objects.GetNextAssoc(InstancePos, unused, pObj);
// Add
if (pObj->editObject->ObjectIdentifier == pType->ObjectIdentifier)
break;
}
long OID = pObj->GetInstanceID();
parent.layout_editor[0][0]->m_sel.AddTail(OID);
CPoint pt = pObj->GetObjectRect(parent.layout_editor[0][0]).GetBoundingRect().CenterPoint();
parent.layout_editor[0][0]->m_oldPt = pt;
pt.Offset(3,3);
parent.layout_editor[0][0]->InitializeMove(pt);
}
}