本文整理汇总了C++中CContainer::Release方法的典型用法代码示例。如果您正苦于以下问题:C++ CContainer::Release方法的具体用法?C++ CContainer::Release怎么用?C++ CContainer::Release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CContainer
的用法示例。
在下文中一共展示了CContainer::Release方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleDrop
void CCellView::HandleDrop(BMessage *inMessage)
{
long l;
void * p;
BPoint dp = inMessage->DropPoint();
fDragIsAcceptable = false;
if (inMessage->FindPointer("container", &p) == B_NO_ERROR)
{
key_info ki;
get_key_info(&ki);
CContainer *srcContainer;
range srcRange, dstRange;
CCellView *srcView;
int action;
srcContainer = (CContainer *)p;
FailOSErr(inMessage->FindData("range", 'rang', (const void**)&p, &l), errMessageMissing);
srcRange = *(range *)p;
FailOSErr(inMessage->FindPointer("cellview", &p), errMessageMissing);
srcView = (CCellView *)p;
if (srcView != this)
action = dragCopy;
else
action = dragMove;
inMessage->FindBool("dragacopy", &fDragACopy);
if (srcView == this &&
(ki.modifiers & B_CONTROL_KEY ||
fDragACopy))
{
BPopUpMenu popup("dragpopup", false);
popup.SetFont(be_plain_font);
popup.AddItem(new BMenuItem(GetMessage(msgLinkHere), NULL));
popup.AddItem(new BMenuItem(GetMessage(msgMoveHere), NULL));
popup.AddItem(new BMenuItem(GetMessage(msgCopyHere), NULL));
popup.AddSeparatorItem();
popup.AddItem(new BMenuItem(GetMessage(msgCancel), NULL));
BMenuItem *item = popup.Go(dp, false, true);
int result = item ? popup.IndexOf(item) : -1;
switch (result)
{
case 0: action = dragLink; break;
case 1: action = dragMove; break;
case 2: action = dragCopy; break;
default:
ClearAnts();
fCurCell = fSelection.TopLeft();
return;
}
}
dstRange = srcRange;
dstRange.OffsetBy(fCurCell.h - dstRange.left,
fCurCell.v - dstRange.top);
((CCellWindow *)Window())->
RegisterCommand(new CDragCommand(this, srcContainer,
fContainer, &srcRange, &dstRange, action));
}
else if (inMessage->FindData("text/plain", B_MIME_DATA, (const void **)&p, &l) == B_NO_ERROR)
{
cell dc;
ConvertFromScreen(&dp);
GetCellHitBy(dp, dc);
BMemoryIO buf(p, l);
CContainer *srcContainer = new CContainer;
range srcRange, dstRange;
CTextConverter conv(buf, srcContainer);
conv.ConvertFromText(srcRange);
dstRange = srcRange;
dstRange.OffsetBy(dc.h - srcRange.left, dc.v - srcRange.top);
((CCellWindow *)Window())->
RegisterCommand(new CDragCommand(this, srcContainer,
fContainer, &srcRange, &dstRange, dragMove));
srcContainer->Release();
}
else
{
beep();
ClearAnts();
fCurCell = fSelection.TopLeft();
}
} /* CCellView::HandleDrop */