本文整理汇总了C++中Tool::AreToolBlobsRenderedOnSelection方法的典型用法代码示例。如果您正苦于以下问题:C++ Tool::AreToolBlobsRenderedOnSelection方法的具体用法?C++ Tool::AreToolBlobsRenderedOnSelection怎么用?C++ Tool::AreToolBlobsRenderedOnSelection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tool
的用法示例。
在下文中一共展示了Tool::AreToolBlobsRenderedOnSelection方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DeselectAll
void SelectionState::DeselectAll(BOOL RenderBlobs)
{
// Find the selected objects in the tree;
SelRange* Selected = GetApplication()->FindSelection();
ERROR3IF( Selected==NULL, "Selection object is null in DeselectAll()");
// Get the selected spread
Spread* pSpread = Document::GetSelectedSpread();
ERROR3IF(pSpread == NULL,"NULL selected spread");
// Make sure that we have a spread and a selection
if (pSpread == NULL || Selected == NULL)
return;
// Find first selected node
#if !defined(EXCLUDE_FROM_RALPH)
Node* pFirstSelectedNode = Selected->FindFirst();
// If there is a selection, EOR blobs off, deselect nodes, and inform everybody
if (pFirstSelectedNode != NULL && RenderBlobs)
{
// Go though and render all the EOR blobs off the screen
// Find the Blob Manager
BlobManager* BlobMgr = GetApplication()->GetBlobManager();
ENSURE( BlobMgr!=NULL, "Blob Manager unexpectedly not there.");
// Render all the blobs
BlobMgr->RenderOff(NULL, pFirstSelectedNode->FindParentSpread());
Tool* pTool = Tool::GetCurrent();
// Get the tool to remove all its blobs before we deselect the nodes.
// Only do this if the current tool dosent update itself on sel changed messages
if (pSpread!=NULL && pTool!=NULL && !pTool->AreToolBlobsRenderedOnSelection())
pTool->RenderToolBlobs(pSpread,NULL);
}
#endif
DeselectAll(pSpread->FindFirstChild());
// Selection cache is no longer valid, so update and tell everyone that it has changed
// *Note*, This used to be 'Selected->Update(TRUE)', but I (Will) removed the TRUE, so
// that a message is NOT broadcast. This should only be called from an operation,
// and the op will send a message when it ends.
Selected->Update();
}
示例2: Do
/********************************************************************************************
> virtual void OpRemoveClipView::Do(OpDescriptor* pOpDesc, OpParam* pOpParam)
Author: Karim_MacDonald (Xara Group Ltd) <[email protected]>
Created: 01 February 2000
Inputs:
Outputs:
Returns:
Purpose:
Errors:
See also:
********************************************************************************************/
void OpRemoveClipView::Do(OpDescriptor* pOpDesc)
{
// try to record the selection state.
if (DoStartSelOp(FALSE, FALSE))
{
// obtain the current selection.
Range Sel(*(GetApplication()->FindSelection()));
RangeControl rc = Sel.GetRangeControlFlags();
rc.PromoteToParent = TRUE;
Sel.Range::SetRangeControl(rc);
// check that the selection is one lone NodeClipViewController.
BOOL ok = FALSE;
Node* pFirstNode = Sel.FindFirst();
if (pFirstNode != NULL && pFirstNode->IsANodeClipViewController())
if (Sel.FindNext(pFirstNode) == NULL)
ok = TRUE;
// remove tool blobs and localise any common attributes.
Tool* pTool = NULL;
Spread* pSpread = NULL;
if (ok)
{
// render blobs off for tools which don't automatically redraw their blobs.
pTool = Tool::GetCurrent();
pSpread = Document::GetSelectedSpread();
if (pSpread != NULL && pTool != NULL && !pTool->AreToolBlobsRenderedOnSelection())
pTool->RenderToolBlobs(pSpread, NULL);
// invalidate the region of screen covering the selection.
DoInvalidateNodesRegions(*(GetApplication()->FindSelection()), TRUE, FALSE, FALSE);
// localise any common attributes.
ok = DoLocaliseCommonAttributes((NodeGroup*)pFirstNode);
}
// deselect and hide the NCVC.
NodeHidden* pHiddenNode = NULL;
if (ok)
{
// deselect the NCVC, but don't ask for its blobs to be redrawn.
((NodeRenderable*)pFirstNode)->DeSelect(FALSE);
ERROR3IF(pFirstNode->IsSelected(), "Deselect failed to deselect current node");
// hide the NodeClipViewController.
ok = DoHideNode(pFirstNode, FALSE, &pHiddenNode, FALSE);
ERROR3IF(!ok, "Unable to hide NodeClipViewController!");
}
// hide the NCVC's NodeClipView node.
if (ok)
{
NodeHidden* pDummy;
NodeClipView* pClipView = ((NodeClipViewController*)pFirstNode)->GetClipView();
ok = DoHideNode(pClipView, FALSE, &pDummy, FALSE);
ERROR3IF(!ok, "Unable to hide NodeClipView!");
}
// show and select the NCVC's children.
// a straight loop-over should do, as it should skip the now-hidden NodeClipView.
if (ok)
{
// get the first child node (the NCVC's keyhole node).
Node* pChildNode = pFirstNode->FindFirstChild();
if (pChildNode == NULL)
TRACEUSER( "Karim", _T("OpRemoveClipView::Do(); Found an empty NodeClipViewController!\n"));
// move and select the child nodes in turn.
Node* pAnchorNode = pHiddenNode;
Node* pNextChildNode = NULL;
while (pChildNode != NULL)
{
// get the next child-node.
pNextChildNode = pChildNode->FindNext();
// if the node is not a NodeHidden then move the node to its new location in
// the tree - there is no need to render the node.
if (!pChildNode->IsAnAttribute() && !pChildNode->IsNodeHidden())
{
// move pChildNode to be the next-sibling of the anchor node.
ok = DoMoveNode(pChildNode, pAnchorNode, NEXT);
if (!ok)
break;
pAnchorNode = pChildNode;
}
//.........这里部分代码省略.........
示例3: Restore
//.........这里部分代码省略.........
for (i=0; i < NumNdRng; i++)
{
// A SelNdRng shold represent at least two contiguous selected nodes
ENSURE(SelNdRngList[i].NumSelected >= 2, "Number of nodes in SelNdRng < 2");
UINT32 NumNodesSelected = 0;
Current = SelNdRngList[i].FirstNode; // First node in range
// Select the next SelNdRng->NumSelected nodes
do
{
ENSURE((Current != NULL), "Node in a SelNdRng is NULL, Has tree changed ?" );
// Only NodeRenderableInk nodes should be selected
ENSURE(Current->IsKindOf(CC_RUNTIME_CLASS(NodeRenderableInk)),
"Selected node is not a NodeRenderableInk");
// [Phil, 11/10/2005] The Current node may be a Caret node
// because Carets are included in the selection, even when
// a sub-selection of characters is present, so that attributes
// optimise correctly within the text story
// However, the Record function treats them as single selected
// nodes, not part of a contiguous run of selected nodes to
// allow for them moving around...
// So we should ignore carets here
if (!IS_A(Current, CaretNode))
{
// Ensure SelNode not already selected
ENSURE(!(Current->IsSelected()), "Invalid selected node");
Current->SetSelected(TRUE); // Set the nodes selected flag
NumNodesSelected++;
#ifdef _DEBUG
NumRestored++;
#endif
}
Current = Current->FindNextNonHidden();
}
while (NumNodesSelected != SelNdRngList[i].NumSelected);
}
#if !defined(EXCLUDE_FROM_RALPH)
// Only restore the blobs if any selections have been restored
if (((NumNdRng != 0) || (NumNd !=0)) && RestoreSelBlobs) // We need to restore the selection blobs
{
// Find the current selections
SelRange* pSel;
pSel = GetApplication()->FindSelection();
Current = pSel->FindFirst(); // The first selected node
Spread *pSpread = NULL;
if (Current != NULL)
pSpread = Current->FindParentSpread();
// ENSURE(pSpread != NULL, "First selected node does not have a parent spread");
// It's a legal state to not find a selected node - the layers may all be locked.
if (pSpread == NULL)
{
AttrFillGeometry::LastRenderedMesh = NULL;
return;
}
// Go get the blob manager
BlobManager* BlobMgr = GetApplication()->GetBlobManager();
ENSURE( BlobMgr!=NULL, "Blob Manger was not there when we needed him!");
if (BlobMgr==NULL)
return;
Current = pSel->FindFirst(); // The first selected node
while (Current != NULL)
{
ENSURE(Current->IsSelected(), "Node not selected");
ENSURE(Current->IsKindOf(CC_RUNTIME_CLASS(NodeRenderable)),
"Selected Node not a NodeRenderable");
// Tell the node to add selection blobs
BlobMgr->RenderMyBlobsOn(NULL, pSpread, (NodeRenderable*)Current);
Current = pSel->FindNext(Current); // Get next selected node
}
Tool* pTool = Tool::GetCurrent();
// Get the tool to remove all its blobs before we deselect the nodes.
// Only do this if the current tool dosent update itself on sel changed messages
if (pSpread!=NULL && pTool!=NULL && !pTool->AreToolBlobsRenderedOnSelection())
pTool->RenderToolBlobs(pSpread,NULL);
AttrFillGeometry::LastRenderedMesh = NULL;
}
#endif
#ifdef _DEBUG
//if (IsUserName("Simon"))
// TRACE( _T(" Num Restored = %lu\n"), NumRestored);
#endif
}