Пример #1
0
void CCamFrame::OnTreeView( wxCommandEvent& WXUNUSED(event) )
{
//	OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(DebugTreeDlg));
	OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_DEBUGTREEDLG);
	if ( pOpDesc )
		pOpDesc->Invoke();
}
Пример #2
0
BOOL GuidesPropertiesTab::PropertiesClicked()
{
	INT32 Index = pPropertiesDlg->GetFirstSelectedItem(_R(IDC_GUIDETAB_GUIDELINELIST));
	Layer* pLayer = GetGuideLayer();
	if (Index < 0 || pLayer == NULL) return FALSE;

	BOOL Valid;
	/*MILLIPOINT Ordinate =*/ pPropertiesDlg->GetDimensionGadgetValue(_R(IDC_GUIDETAB_GUIDELINELIST),pLayer,&Valid,Index);

	if (Valid)
	{
		GuidelineListItem* pItem = (GuidelineListItem*)GuidelineList.FindItem(Index);
		if (pItem!=NULL && pItem->pGuideline!=NULL)
		{
			GuidelinePropDlg::SetEditGuidelineParams(pItem->pGuideline);
			OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_EDITGUIDELINEPROPDLG);
			if (pOpDesc != NULL)
				pOpDesc->Invoke();
			else
				ERROR3("GuidesPropertiesTab::PropertiesClicked() - OpDescriptor::FindOpDescriptor(OPTOKEN_EDITGUIDELINEPROPDLG) failed");
		}
		else
			ERROR3_PF(("Unable to find guideline item at index (%d)",Index));
	}

	return TRUE;	
}
Пример #3
0
BOOL LayerPropertiesTab::CommitSection()
{
TRACEUSER( "Neville", _T("LayerPropertiesTab::CommitSection\n"));
	ERROR2IF(pPropertiesDlg == NULL,FALSE,"LayerPropertiesTab::CommitSection called with no dialog pointer");

	BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
	if (!ok)
		return TRUE;			// Talk to page failed to return now

	Layer* pLayer = GetActiveLayer();

	// Only do the op if we have a layer with a different set of properties
	if (pLayer != NULL && HavePropertiesChanged(pLayer))
	{
		// Initialise the param structure
		OpLayerGalParam Param(LAYER_CHANGE, pSpread);
		Param.pLayer = pLayer;

		Param.VisibleState  =  pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_LAYERTAB_VISIBLE));
		Param.LockedState   = !pPropertiesDlg->GetBoolGadgetSelected(_R(IDC_LAYERTAB_EDITABLE));
		Param.NewName		=  pPropertiesDlg->GetStringGadgetValue(_R(IDC_LAYERTAB_NAME),NULL);

		// Invoke the operation
		OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_LAYERGALCHANGE); 
		if (pOpDesc != NULL)
			pOpDesc->Invoke((OpParam*)&Param);
		else
		{
			ERROR3("Couldn't find OPTOKEN_LAYERGALCHANGE op descriptor");
		}
	}

	return TRUE;
}
Пример #4
0
BOOL GuidesPropertiesTab::DeleteClicked()
{
	INT32* pIndexList = pPropertiesDlg->GetSelectedItems(_R(IDC_GUIDETAB_GUIDELINELIST));
	INT32 Count = GuidelineList.GetCount();

	INT32 i;

	BOOL ok = (pIndexList != NULL && Count > 0);
	NodeGuideline** pGuidelineList = NULL;

	if (ok)
	{
		pGuidelineList = (NodeGuideline**)CCMalloc(sizeof(NodeGuideline*)*(Count+1));

		ok = (pGuidelineList != NULL);

		if (ok)
		{
			for (i=0; (pIndexList[i] >= 0) && (i < Count);i++)
			{
				GuidelineListItem* pItem = (GuidelineListItem*)GuidelineList.FindItem(pIndexList[i]);
				if (pItem != NULL)
					pGuidelineList[i] = pItem->pGuideline;
				else
				{
					pGuidelineList[i] = NULL;
					ERROR3_PF(("List item at index [%d] is NULL",i));
				}
			}

			pGuidelineList[i] = NULL;
		}
	}
	else
		ok = FALSE;

	if (ok)
	{
		OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_GUIDELINE);
		ERROR3IF(pOpDesc == NULL,"FindOpDescriptor(OPTOKEN_GUIDELINE) failed");

		if (pOpDesc != NULL)
		{
			OpGuidelineParam GuidelineParam;

			GuidelineParam.Method 			= GUIDELINEOPMETHOD_DELETE;
			GuidelineParam.pGuidelineList 	= pGuidelineList;

			pOpDesc->Invoke(&GuidelineParam);
		}
	}

	if (pGuidelineList != NULL)
		CCFree(pGuidelineList);

	if (pIndexList != NULL)
		delete [] pIndexList;

	return ok;
}
Пример #5
0
void CCamFrame::OnQualityAntialiased( wxCommandEvent& WXUNUSED(event) )
{
	Document::GetSelected()->SetCurrent();
	DocView::GetSelected()->SetCurrent();
	OpDescriptor* pOpDesc = (OpDescriptor*)OpDescriptor::FindOpDescriptor( OPTOKEN_QUALITYANTIALIASED );
	if ( pOpDesc )
		pOpDesc->Invoke();
}
Пример #6
0
void ToolbarDlg::NewToolbar()
{
	// Invoke the new toolbar name operation
	// Obtain a pointer to the op descriptor for the new toolbar name operation
	OpDescriptor* pOpDesc =
		OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(ToolnameDlg));
	ENSURE(pOpDesc,"Can't find ToolnameDlg Op.");
	// Invoke the operation.
	pOpDesc->Invoke();
}
Пример #7
0
void CCamFrame::OnStandardBar( wxCommandEvent& event)
{
	// We can't find by Runtime Class as there are multiple OpDescriptors with the same Class
	// So get the resource ID (which also happens to be the dialog ID to use
	ResourceID r = (ResourceID)(event.GetId());
	// Find the Op Descriptor by name
	OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor((TCHAR *)(CamResource::GetObjectName(r))); 
	// Stick the resource ID in he Op Param
//	OpParam Param(CUniversalParam((INT32)r), CUniversalParam(0));
	pOpDesc->Invoke();
}
Пример #8
0
/********************************************************************************************

>	virtual BOOL PNGFilter::GetExportOptions(BitmapExportOptions* pOptions)

	Author:		Colin_Barfoot (Xara Group Ltd) <*****@*****.**>
	Created:	12/11/96
	Purpose:	See BaseBitmapFilter for interface details

********************************************************************************************/
BOOL PNGFilter::GetExportOptions(BitmapExportOptions* pOptions)
{
	ERROR2IF(pOptions == NULL, FALSE, "NULL Args");

	PNGExportOptions* pPNGOptions = (PNGExportOptions*)pOptions;
	ERROR3IF(!pPNGOptions->IS_KIND_OF(PNGExportOptions), "pPNGOptions isn't");

	// the depth we ask GDraw to render is always 32-bit, so we can get transparency
	// we have to convert for other formats	when writing the actual bytes to the file
	SetDepthToRender(32);

	// We haven't written the header yet
	WrittenHeader = FALSE;

	// We are a first pass render and not doing the mask, by default
	SecondPass = FALSE;
	DoingMask = FALSE;

	// Determine the filter type currently in use in Accusoft format
	s_FilterType = PNG;
	pPNGOptions->SetFilterType(PNG);

	BOOL Ok = FALSE;

	OpDescriptor* pOpDes = OpDescriptor::FindOpDescriptor(OPTOKEN_GIFTABDLG);
	if (pOpDes != NULL)
	{
		// set up the data for the export options dialog
		OpParam Param((void *)pOptions, (void *)this);

		// invoke the dialog
		pOpDes->Invoke(&Param);

		// SMFIX
		// we have brought the dlg up so get the options from the dlg as the graphic type may have changed
		pOptions = BmapPrevDlg::m_pExportOptions;

		// check for valid options
		//  This may get messed up, so have to use the second line below.
		Ok = BmapPrevDlg::m_bClickedOnExport;
	}
	else
	{	
		ERROR3("Unable to find OPTOKEN_BMAPPREVDLG");
	} 

	// Return with the ok/cancel state used on the dialog box
	return Ok;
}
Пример #9
0
BOOL GuidesPropertiesTab::NewClicked()
{
	// set guideline to be at user ordinate 0
	Spread*    pSpread  = Document::GetSelectedSpread();
	MILLIPOINT Ordinate = NodeGuideline::ToSpreadOrdinate(pSpread,0,GuideType);
	GuidelinePropDlg::SetNewGuidelineParams(GuideType,Ordinate);

	OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_NEWGUIDELINEPROPDLG);
	if (pOpDesc!=NULL)
		pOpDesc->Invoke();
	else
		ERROR3("GuidesPropertiesTab::NewClicked() - OpDescriptor::FindOpDescriptor(OPTOKEN_NEWGUIDELINEPROPDLG) - failed");

	return TRUE;
}
Пример #10
0
BOOL SGNameDrag::OnPageDrop(ViewDragTarget* pDragTarget)
{
	// Extract the address of the object dropped on and apply the dragged name
	// attribute to it.
	PageDropInfo pdInfo;
	pDragTarget->GetDropInfo(&pdInfo);
	if (pdInfo.pObjectHit != 0)
	{
		OpDescriptor* pDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_APPLY_NAMES_TO_ONE);
		ERROR3IF(pDesc == 0, "SGNameDrag::OnPageDrop: no descriptor");
		pDesc->Invoke(&OpParam((INT32) (Node*) pdInfo.pObjectHit, 0));
	}

	return TRUE;
}
Пример #11
0
void CCamFrame::OnUpdateStandardBar( wxUpdateUIEvent& event)
{
	// We can't find by Runtime Class as there are multiple OpDescriptors with the same Class
	// So get the resource ID (which also happens to be the dialog ID to use
	ResourceID r = (ResourceID)(event.GetId());
	// Find the Op Descriptor by name
	OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor((TCHAR *)(CamResource::GetObjectName(r))); 
	// Stick the resource ID in he Op Param
//	OpParam Param(CUniversalParam((INT32)r), CUniversalParam(0));
	OpParam Param((INT32)r, (INT32)0);
	String_256 disable;
	OpState opst;
	if ( pOpDesc) opst = pOpDesc->GetOpsState(&disable,&Param);
	event.Enable(pOpDesc && !opst.Greyed);
	event.Check(FALSE != opst.Ticked);
}
Пример #12
0
BOOL URLImportDlg::OpenAndGetURL(WebAddress* purlToReturn) 
{
	//Say that the dialog wasn't cancelled
	DialogWasCancelled=FALSE;

	//Find the dialog's op descriptor
	OpDescriptor *OpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(URLImportDlg));

	//And start up the dialog
	if (OpDesc != NULL)
		OpDesc->Invoke();

	//And return the member variable
	*purlToReturn=URLImportDlg::ms_url;

	return !DialogWasCancelled;
}
Пример #13
0
/********************************************************************************************
>	void OpMakeStroke::Do(OpDescriptor*)

	Author:		Richard_Millican (Xara Group Ltd) <*****@*****.**>
	Created:	04/03/97
	Inputs:		OpDescriptor (unused)
	Outputs:	-
	Returns:	-
	Purpose:	Performs the MakeShapes operation. 
********************************************************************************************/
void OpMakeStroke::Do(OpDescriptor*)
{   
	// Obtain the current selections 
	Range Selection = *GetApplication()->FindSelection();
	Node* CurrentNode = Selection.FindFirst(); 
	BOOL Success = TRUE;		
	
	ERROR3IF(CurrentNode == NULL, "Make shapes called with no nodes selected"); 
	
	if (CurrentNode != NULL) // No nodes selected so End
	{                    
		// Try to record the selection state, don't render the blobs though 
		if (Success)
			Success = DoStartSelOp(FALSE,FALSE);								   

		// First, Make Shapes on everything so they're all simple paths
		String_256 Desc("Building new stroke brush...");
		Progress::Start(FALSE, &Desc);
		OpDescriptor *pOp = OpDescriptor::FindOpDescriptor(OPTOKEN_MAKE_SHAPES);
		if (pOp != NULL)
			pOp->Invoke();

		// Second, Group everything
		pOp = OpDescriptor::FindOpDescriptor(OPTOKEN_GROUP);
		if (pOp != NULL)
			pOp->Invoke();

		pOp = OpDescriptor::FindOpDescriptor(OPTOKEN_GROUP);
		if (pOp != NULL)
			pOp->Invoke();

		// Finally, create a new brush
		PathStrokerVector::BodgeRipSelection(/*(CommandIndex == 0) ? FALSE :*/ TRUE);
		Progress::Stop();

	}                   

	if (!Success)
	{
		InformError();
		FailAndExecute();
	}

 	End(); 
}			
Пример #14
0
BOOL LayerManager::CommitLayerChanges()
{
	if (LayerDetailsChanged()) // The layer details have changed so we need to perform 
							   // a LayerChangeOp to commit the changes.  
	{
		// Invoke the layer change operation 
		// Obtain a pointer to the op descriptor for the Layer change operation 
		OpDescriptor* OpDesc = 
			OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(OpLayerChange)); 
		// Invoke the operation. 
		OpDesc->Invoke();
	}
	if (RefreshLayerDetails()) // We need to refresh the layer details even if the layers were 
						   	   // not changed because a new layer could have been deleted  
	{
		return TRUE; 
	}
	else return FALSE; // Failed to refresh layer details (InformError has been called)
} 				
Пример #15
0
BOOL ImagemapDlg::InvokeDialog(ImagemapFilterOptions* pifoDefault, List* plstNames) 
{
	// Make a local copy of the options
	ms_Options=*pifoDefault;
	ms_plstNames=plstNames;

	//Say that the dialog wasn't cancelled
	DialogWasCancelled=FALSE;

	//Find the dialog's op descriptor
	OpDescriptor *OpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(ImagemapDlg));

	//And start up the dialog
	if (OpDesc != NULL)
		OpDesc->Invoke();

	//And return the options we've got back
	*pifoDefault=ms_Options;

	return !DialogWasCancelled;
}
Пример #16
0
BOOL InvokeNativeFileOp(const TCHAR* pOpName, CCLexFile* pFile, UINT32 nPrefFilter)
{
	// Find the requested Operation.
	OpDescriptor* pOp = OpDescriptor::FindOpDescriptor((TCHAR*) pOpName);
	if (pOp == 0)
	{
		ERROR3("Can't find OpDescriptor in InvokeNativeFileOp");
		return FALSE;
	}

	// Build the parameter block.
	NativeFileOpParams pm;
	pm.pFile = pFile;
	pm.fStatus = FALSE;
	pm.nPrefFilter = nPrefFilter;

	// Invoke it with the given parameters, returning its status.
	OpParam				param( &pm, INT32(0) );
	pOp->Invoke( &param );
	return pm.fStatus;
}
Пример #17
0
BOOL CNameBrushDlg::DoCommit(const StringBase& strName)
{
	// Apply and (do or do not) close the dialog.
	OpDescriptor* pDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_CHANGEBRUSHDEF);
	
	// if we haven't got a brush then error
	if (m_BrushHandle == BrushHandle_NoBrush)
	{
		ERROR3("No brush handle in CNameBrushDlg::DoCommit");
		return FALSE;
	}

	// our param needs to know the brush handle and new name
	ChangeBrushDefOpParam Param;
	Param.m_NewBrushName = (String_32)strName;
	Param.m_Handle = m_BrushHandle;
	Param.ChangeType = CHANGEBRUSH_NAME;

	ERROR3IF(pDesc == 0, "CNameBrushDlg::DoCommit: can't find descriptor");
	pDesc->Invoke(&Param);
	return m_bModeless;
}
Пример #18
0
void OpSnapToObjects::Do(OpDescriptor*)
{
	DocView *pDocView = DocView::GetSelected();

	if (pDocView != NULL)
	{
		// Find out the new value for the magnetic snapping
		BOOL NewState = !pDocView->GetSnapToObjectsState();
		pDocView->SetSnapToObjectsState(NewState);

		// update all slider controls that show the view quality
		OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_SNAPTOOBJECTS);
		if (pOpDesc!=NULL)
		{
			// Found the opdescriptor. Now find all the gadgets associated with it
			List Gadgets;
			if (pOpDesc->BuildGadgetList(&Gadgets))
			{
				// Found some. Set the controls position according to the quality
				GadgetListItem* pGadgetItem = (GadgetListItem*) Gadgets.GetHead();

				while (pGadgetItem!=NULL)
				{
					// Set the sliders position
					pGadgetItem->pDialogOp->SetLongGadgetValue(pGadgetItem->gidGadgetID, NewState, FALSE);

					// go find the next gadget
					pGadgetItem = (GadgetListItem*) Gadgets.GetNext(pGadgetItem);
				}
		
				// Clean out the list
				Gadgets.DeleteAll();
			}
		}
	}

	End();
}
Пример #19
0
BOOL GuidesPropertiesTab::ColourChanged(INT32 Index)
{
	if (pColourDropDown == NULL || Index < 0)
		return FALSE;
 
	IndexedColour* pNewColour = pColourDropDown->DecodeSelection(Index);

	Layer* pLayer = GetGuideLayer();
	if (pLayer != NULL)
	{
		OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_CHANGELAYERCOLOUR);
		ERROR3IF(pOpDesc == NULL,"FindOpDescriptor(OPTOKEN_CHANGELAYERCOLOUR) failed");

		if (pOpDesc != NULL)
		{
			OpChangeLayerColourParam ChangeColourParam(pDocument,pLayer,pNewColour);
			pOpDesc->Invoke(&ChangeColourParam);
		}
//		pLayer->SetGuideColour(pNewColour);
//		LayerSGallery::ForceRedrawLayer(pDocument,pLayer);
	}
	return TRUE;
}
Пример #20
0
BOOL PrintPrefsDlg::InvokeDialog()
{
	static BOOL FirstTime = TRUE;

	if (!Open)
	{
		Open = TRUE; 

		// First time through we want to force open the second Print tab as opposed to the Output
		// tab as this is deemed to be the better option.
		OpDescriptor *pOpDesc = NULL;
		if (!FirstTime)
		{
			pOpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(PrintPrefsDlg));
		}
		else
		{
			// Only do this the first time
			FirstTime = FALSE;
			pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_PRINTOPTIONSDLG);
		}
		ERROR3IF(pOpDesc == NULL,"PrintPrefsDlg::InvokeDialog is unable to find the PrintPrefsDlg OpDescriptor");

		if (pOpDesc != NULL)
			pOpDesc->Invoke();

		Open = FALSE;

		return OkUsed;
	}
	else
	{
		ERROR3("PrintPrefsDlg::InvokeDialog() called again, before previous call returned");
		return FALSE;
	}
}
Пример #21
0
/********************************************************************************************

>	virtual BOOL MakeBitmapFilter::GetExportOptions(BitmapExportOptions* pOptions)

	Author:		Colin_Barfoot (Xara Group Ltd) <*****@*****.**>
	Created:	12/11/96
	Purpose:	See BaseBitmapFilter for interface details

********************************************************************************************/
BOOL MakeBitmapFilter::GetExportOptions(BitmapExportOptions* pOptions)
{
	ERROR2IF(pOptions == NULL, FALSE, "pOptions NULL");
	ERROR3IF(!pOptions->IS_KIND_OF(MakeBitmapExportOptions), "pOptions isn't");

	BOOL Ok = FALSE;

	OpDescriptor* pOpDes = OpDescriptor::FindOpDescriptor(OPTOKEN_GIFTABDLG);

	if (pOpDes != NULL)
	{
		// Graeme (18-9-00)
		// We need to ensure that the correct file type is set up. The bitmap copy filter
		// uses the PNG settings, and so it's necessary to convince the dialogue that we
		// are exporting as a PNG to avoid relics from an earlier export to confuse matters.
		BmapPrevDlg::m_pthExport.SetType ( String_256 ( "png" ) );

		// set up the data for the export options dialog
		OpParam Param((INT32)pOptions, (INT32)this);

		// invoke the dialog
		pOpDes->Invoke(&Param);

		// SMFIX
		// we have brought the dlg up so get the options from the dlg as the graphic type may have changed
		pOptions = BmapPrevDlg::m_pExportOptions;
		Ok = BmapPrevDlg::m_bClickedOnExport;
	}
	else
	{	
		ERROR3("Unable to find OPTOKEN_BMAPPREVDLG");
	} 

	// Return whether or not it worked.
	return Ok;
}
Пример #22
0
BOOL ScreenCamView::OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point)
{
	if (!m_DropFormatOK || pDataObject == NULL)
		return FALSE;

//	Document* pSelDoc = Document::GetSelected();

	Document* pClipDoc = InternalClipboard::Instance();
	if (pClipDoc != NULL)
	{
		Document::SetSelectedViewAndSpread(pClipDoc);
		pClipDoc->ResetInsertionPosition();
		pClipDoc->SetCurrent();

		// If there is *still* a format on the external clip board we like, then it's ok to drop
		CLIPFORMAT ClipFormat = ExternalClipboard::GetBestPasteFormat(pDataObject);
		ExternalClipboard* pExtClipBoard = ExternalClipboard::GetExternalClipboard();

		if (ClipFormat != 0 && pExtClipBoard !=NULL && pExtClipBoard->PrepareForOlePaste(pDataObject))
		{
			Document::SetSelectedViewAndSpread(GetDocument()->GetKernelDoc(),GetDocViewPtr());
			DocView *pDocView = DocView::GetCurrent();

			if (pDocView != NULL)
			{
				// Make the drop point a WinCoord so we can turn it into an oil coord
				WinCoord DropPoint(point.x,point.y);

				// Turn it into Oil coordinates...
				OilCoord OilPos = DropPoint.ToOil(pDocView);

				// Find the spread that contains the coord
				Spread* pSpread = pDocView->FindEnclosingSpread(OilPos);
				if (pSpread != NULL)
				{
					// First of all convert the OilCoord into device coords
					DocCoord Centre = OilPos.ToDoc(pSpread, pDocView);
				
					// Translate the coord to spread coords
					pSpread->DocCoordToSpreadCoord(&Centre);

					// 'Centre' now contains the centre point for the paste, in spread coords

					TRY
					{
						// Wrap all this in a TRY/CATCH block so that if OLE throws a wobbly, we can
						// ensure that the clipboard remains intacted on exit.

						// Copy the selection to the drag'n'drop clipboard.
						OpDescriptor* pOp = OpDescriptor::FindOpDescriptor(OPTOKEN_PASTE);
						ERROR3IF(!pOp, "No paste operation in ScreenCamView::OnDrop");

						if (pOp != NULL)
						{
							Document::SetSelectedViewAndSpread(pClipDoc);
							pClipDoc->SetCurrent();
							pClipDoc->ResetInsertionPosition();
							InsertionNode* pInsertNode = pClipDoc->GetInsertionPosition();
							if (pInsertNode != NULL)
							{
								pInsertNode->UnlinkNodeFromTree();
								delete pInsertNode;
								pInsertNode = NULL;
							}

							Document::SetSelectedViewAndSpread(GetDocument()->GetKernelDoc(),GetDocViewPtr());
							
							// create a param object that contains the centre point in the spread at which
							// we would like the objects to be pasted
							OpParamPasteAtPosition Param(pSpread,Centre);

							// Call the paste op via its DoWithParams() funtion
							pOp->Invoke(&Param);
						}
					}
					CATCH_ALL(e)
					{
						if (m_ClipBoardSwapped = FALSE)
						{
//							TRACEUSER( "Markn", _T("Swapping back to clipboard doc (Catch in ScreenCamView::OnDrop())\n"));
							InternalClipboard::Swap();
							ExternalClipboard::UpdateSystemClipboard(TRUE);
						}
						THROW_LAST();
					}
					END_CATCH_ALL
				}
Пример #23
0
BOOL ColourDragInformation::OnPageDrop(ViewDragTarget* pDragTarget)
{
	PageDropInfo ThePageDropInfo;
	((ViewDragTarget*)pDragTarget)->GetDropInfo(&ThePageDropInfo);

	DocCoord DragPos 			= ThePageDropInfo.DropPos;
	ObjectDragTarget TargetType = ThePageDropInfo.TargetHit;
	NodeRenderableInk* ThisNode = ThePageDropInfo.pObjectHit;

	// DMc 4/10/99
	// test for dragging & dropping onto a bevel/shadow/other compound node which
	// is grouped
	if (ThisNode)
	{
		if (ThisNode->FindParent())
		{
			if (!ThisNode->FindParent()->PromoteHitTestOnChildrenToMe())
			{
				// any compounds with their 'promotehittest' stuff set above me ?
				Node * pNode = ThisNode->FindParent();
				
				while (pNode)
				{
					if (pNode->IsAnObject())
					{
						if (pNode->PromoteHitTestOnChildrenToMe())
						{
							ThisNode = (NodeRenderableInk *)pNode;
						}
					}
					
					pNode = pNode->FindParent();
				}
			}
		}
	}

	NodeAttribute *Attrib = NULL;
	
	// Get a colour to apply to the Selected doc
	IndexedColour *IxColToApply = GetColourForDocument(NULL);

	// And make a DocColour to apply
	DocColour ColourToApply(COLOUR_TRANS);
	if (IxColToApply != NULL)
		ColourToApply.MakeRefToIndexedColour(IxColToApply);


 	if (TargetType == LINE_TARGET) // apply a stroke colour
	{
		// Apply a stroke colour to the object(s) we have been dropped onto
		Attrib = new AttrStrokeColourChange;
		if (Attrib == NULL)
			return FALSE;

		((AttrStrokeColourChange *)Attrib)->SetStartColour(&ColourToApply);
		AttributeManager::ApplyAttribToNode(ThisNode, Attrib);
	}
	else		  
	{
		// Apply a fill colour to the object(s) we have been dropped onto
		// This always used to be the case. If there were no objects then we
		// just set the current fill colour to be the new one.
		// Now, if no objects are the target then apply a page background colour
		// otherwise if control is held down set the current fill colour.
		
		BOOL Constrain = FALSE;

		// get object bounds
		DocRect pSimpleBounds;
		if (ThisNode)
			pSimpleBounds = ThisNode->GetBoundingRect();
		else
		{
			pSimpleBounds.MakeEmpty();
			// See if the control key is pressed
			Constrain = KeyPress::IsConstrainPressed();
		}

		// No node(s) are targetted so see if the constrain key is pressed or not
		if (ThisNode == NULL && Constrain)
		{
			// Use the colour to set the background
			// We should use the document given to us by the page info class
			OpBackgroundParam Param;
			Param.pDocColour = &ColourToApply;
			Param.pDoc = ThePageDropInfo.pDoc;			
			Param.pSpread = ThePageDropInfo.pSpread;
			
			// Obtain a pointer to the op descriptor for the create operation 
			OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_BACKGROUND);

			// Invoke the operation, passing in our parameters
			pOpDesc->Invoke(&Param);
		}
		else
		{
			// Apply the colour either to the targetted node(s) or as the current
			// fill colour, if no nodes are targetted.
			Attrib = new AttrColourDrop(DragPos, pSimpleBounds, ColourToApply);
			if (Attrib == NULL)
				return FALSE;

			if (ThisNode)
				((AttrColourDrop*)Attrib)->SetObjectDroppedOn(ThisNode);

			AttributeManager::ApplyAttribToNode(ThisNode, Attrib);
		}
	}

	return TRUE;
}
Пример #24
0
BOOL OpBevel::ImportURL(WebAddress urlToGet)
{
	//First, set up some variables. We must do this now because I'm 
	//going to use a goto in a moment
	GenericDownloadParam* Param;
	OpDescriptor* pOpDesc;
	PathName pthTemp;

	//We want to import urlToGet using the best available filter

	//To get the best available filter, we simply download to the "All" filter
	//So get a pointer to the All filter
	Filter* pAllFilter=GetAllFilter();

	//Check we found it
	if (pAllFilter==NULL)
		goto ReturnError;

	//Now, get ready to download the file. This is rather complex.

	//First create a new set of download parameters
	//This object will be deleted when the download finishes
	Param = new GenericDownloadParam;
	
	//Now find the generic download OpDescriptor
	pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_OPGENERICDOWNLOAD);

	//And check we found it
	if (pOpDesc==NULL)
		goto ReturnError;
  
	//Now, create a temporary file to download to
	pthTemp=FileUtil::GetTemporaryPathName();

	//And now fill in our parameters
	Param->type = TYPE_HTML;
	Param->priority = AsynchDownload::PRIORITY_NORMAL;
	Param->strDescription = String_256(_R(IDS_HTMLIMPORT_FILEDOWNLOAD));
	Param->file = pthTemp.GetPath();

	Param->strURL = urlToGet.GetWebAddress();
				
	Param->Output = NULL;

	Param->m_pFilter = pAllFilter;
	Param->m_Op = this;						
	Param->pDoc = Document::GetCurrent();

	//And, finally, start the download going, if we've got a URL to download
	if (!Param->strURL.IsEmpty())
		pOpDesc->Invoke((OpParam*) Param);
	
	//And return TRUE
	return TRUE;

ReturnError:
	if (Param)
		delete Param;

	return FALSE;
}
Пример #25
0
void CCamFrame::OnBlobbyBar( wxCommandEvent& WXUNUSED(event) )
{
	OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(BlobbyBar)); 
	if ( pOpDesc )
		pOpDesc->Invoke();
}
Пример #26
0
void CCamFrame::OnTimeRedraw( wxCommandEvent& WXUNUSED(event) )
{
	OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(OpTimeDraw)); 
	if ( pOpDesc )
		pOpDesc->Invoke();
}
Пример #27
0
void CCamFrame::OnCaching( wxCommandEvent& WXUNUSED(event) )
{
	OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(OpClearCache)); 
	if ( pOpDesc )
		pOpDesc->Invoke();
}
Пример #28
0
void CCamFrame::OnBackgroundRender( wxCommandEvent& WXUNUSED(event) )
{
	OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(OpToggleFore)); 
	if ( pOpDesc )
		pOpDesc->Invoke();
}
Пример #29
0
void CCamFrame::OnZoomOut( wxCommandEvent& WXUNUSED(event) )
{
	OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(OpZoomOut)); 
	if ( pOpDesc )
		pOpDesc->Invoke();
}