本文整理汇总了C++中SimSet::find方法的典型用法代码示例。如果您正苦于以下问题:C++ SimSet::find方法的具体用法?C++ SimSet::find怎么用?C++ SimSet::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimSet
的用法示例。
在下文中一共展示了SimSet::find方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleItemDroppedOnItem
bool SimTreeView::handleItemDroppedOnItem( HTREEITEM hTarget, HTREEITEM hDropItem )
{
bool removeFromSource=false;
lockManager();
HTREEITEM hParent = getParent( hTarget );
SimSet *pTarget = (SimSet*)getObject( hParent );
SimObject *obj = getObject(hDragItem);
SimObject *pParent = getObject( getParent(hDropItem) );
if ( pTarget != obj )
{
state.set(STV_MODIFIED);
if ( pTarget->find(pTarget->begin(), pTarget->end(), obj) != pTarget->end() )
{
if ( pTarget->reOrder( obj, getObject(hTarget) ) )
refresh( hParent );
}
else
{
if ( !dynamic_cast<SimGroup*>(pTarget) )
{
if ( dynamic_cast<SimGroup*>(pParent) )
removeFromSource = false; // Group->Set, copy
else if ( (GetKeyState( VK_SHIFT ) & 0x80000000) == 0 )
removeFromSource = true; // Set->Set, but pressing shift key, copy
else
removeFromSource = true; // Set->Set, copying set by menu
}
else if ( !dynamic_cast<SimGroup*>(pParent) )
{
unlockManager();
return false; // set->Group is not allowed
}
else
{
state.clear(GWTV_COPYING); // Group->Group, moving
removeFromSource = true;
}
pTarget->addObject(obj);
pTarget->reOrder( obj, getObject(hTarget) );
WinParent::handleItemDroppedOnItem( hTarget, hDropItem );
}
}
unlockManager();
return removeFromSource; // don't modify list after return
}