本文整理汇总了C++中OpDescriptor::Invoke方法的典型用法代码示例。如果您正苦于以下问题:C++ OpDescriptor::Invoke方法的具体用法?C++ OpDescriptor::Invoke怎么用?C++ OpDescriptor::Invoke使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpDescriptor
的用法示例。
在下文中一共展示了OpDescriptor::Invoke方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CommitSection
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;
}
示例2: DeleteClicked
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;
}
示例3: OnTreeView
void CCamFrame::OnTreeView( wxCommandEvent& WXUNUSED(event) )
{
// OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(CC_RUNTIME_CLASS(DebugTreeDlg));
OpDescriptor* pOpDesc = OpDescriptor::FindOpDescriptor(OPTOKEN_DEBUGTREEDLG);
if ( pOpDesc )
pOpDesc->Invoke();
}
示例4: PropertiesClicked
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;
}
示例5: OnQualityAntialiased
void CCamFrame::OnQualityAntialiased( wxCommandEvent& WXUNUSED(event) )
{
Document::GetSelected()->SetCurrent();
DocView::GetSelected()->SetCurrent();
OpDescriptor* pOpDesc = (OpDescriptor*)OpDescriptor::FindOpDescriptor( OPTOKEN_QUALITYANTIALIASED );
if ( pOpDesc )
pOpDesc->Invoke();
}
示例6: Do
/********************************************************************************************
> void OpMakeStroke::Do(OpDescriptor*)
Author: Richard_Millican (Xara Group Ltd) <[email protected]>
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();
}
示例7: NewToolbar
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();
}
示例8: OnStandardBar
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();
}
示例9: GetExportOptions
/********************************************************************************************
> virtual BOOL PNGFilter::GetExportOptions(BitmapExportOptions* pOptions)
Author: Colin_Barfoot (Xara Group Ltd) <[email protected]>
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;
}
示例10: OnPageDrop
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: NewClicked
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;
}
示例12: OpenAndGetURL
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: CommitLayerChanges
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)
}
示例14: InvokeDialog
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;
}
示例15: InvokeNativeFileOp
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( ¶m );
return pm.fStatus;
}