Skip to main content
Visual Components are implemented in FRE for Windows.
Component Synchronizer is a special component that implements an automatic reaction to different events in the Visual Components. You can connect several Visual Components to the Synchronizer, and they will work as a single application. You do not need to use Component Synchronizer with the whole set of the components connected, but connect only those which you use. For example, you can connect to it only Image Viewer via the ImageViewer property and Text Editor via the TextEditor property. Component Synchronizer does not have a user interface. It does not use any internal features of the Visual Components, it uses only the COM API of the components. Component Synchronizer works as described below.

When a component is connected to the Synchronizer through the API

If a component or an object is connected to Component Synchronizer through:
In this case, the IComponentSynchronizer::ImageViewer property is set to the specified ImageViewer object, and then the following operations are performed:
The propertyIs set to
IImageViewer::ZoomRectEnabledTrue
IImageViewer::DocumentProcessingParamsIComponentSynchronizer::DocumentProcessingParams
IImageViewer::FRPageThe page in the IComponentSynchronizer::Document with the IComponentSynchronizer::PageIndex index
In this case, the IComponentSynchronizer::ZoomViewer property is set to the specified ZoomViewer object, and then the following operations are performed:
The propertyIs set to
IZoomViewer::SymbolRectEnabledTrue
IZoomViewer::DocumentProcessingParamsIComponentSynchronizer::DocumentProcessingParams
IZoomViewer::FRPageThe page in the IComponentSynchronizer::Document with the IComponentSynchronizer::PageIndex index
In this case, the IComponentSynchronizer::TextEditor property is set to the specified TextEditor object, and then the following operations are performed:
The propertyIs set to
ITextEditor::SynthesisParamsForDocumentThe value of the SynthesisParamsForDocument property of the IComponentSynchronizer::DocumentProcessingParams object
ITextEditor::FRPageThe page in the IComponentSynchronizer::Document with the IComponentSynchronizer::PageIndex index
In this case, the IComponentSynchronizer::TextValidator property is set to the specified TextValidator object, and then the following operations are performed:
The propertyIs set to
ITextValidator::SynthesisParamsForDocumentThe value of the SynthesisParamsForDocument property of the IComponentSynchronizer::DocumentProcessingParams object
ITextValidator::FRDocumentIComponentSynchronizer::Document
In this case, the IComponentSynchronizer::DocumentViewer property is set to the specified DocumentViewer object, and then the following operations are performed:
The propertyIs set to
IDocumentViewer::FRDocumentIComponentSynchronizer::Document
IDocumentViewer::DocumentProcessingParamsIComponentSynchronizer::DocumentProcessingParams
IDocumentViewer::ActivePageThe page in the IComponentSynchronizer::Document with the IComponentSynchronizer::PageIndex index
In this case, the IComponentSynchronizer::Document property is set to the specified FRDocument object, and then the following operations are performed:
The propertyIs set to
IImageViewer::FRPage IZoomViewer::FRPage ITextEditor::FRPage IDocumentViewer::ActivePageThe first page in the IComponentSynchronizer::Document
IComponentSynchronizer::PageIndex0
IDocumentViewer::FRDocument ITextValidator::FRDocumentIComponentSynchronizer::Document
In this case, the IComponentSynchronizer::DocumentProcessingParams property is set to the specified DocumentProcessingParams object, and then the following operations are performed:
The propertyIs set to
IImageViewer::DocumentProcessingParams IZoomViewer::DocumentProcessingParams IDocumentViewer::DocumentProcessingParamsIComponentSynchronizer::DocumentProcessingParams
ITextEditor::SynthesisParamsForDocument ITextValidator::SynthesisParamsForDocumentThe value of the SynthesisParamsForDocument property of the IComponentSynchronizer::DocumentProcessingParams object
In this case, the IComponentSynchronizer::PageIndex property is set to the specified value, and then the following operations are performed:
The propertyIs set to
IImageViewer::FRPage IZoomViewer::FRPage ITextEditor::FRPage IDocumentViewer::ActivePageThe page in the IComponentSynchronizer::Document with the IComponentSynchronizer::PageIndex index

When a connected component generates an event

Events of the connected Image Viewer:
If Image Viewer generates the OnMouseButtonUp event, Component Synchronizer performs the following operations:
if( mouseButton == MBU_LeftButton && ZoomViewer != 0 ) {
 int documentX = 0;
 int documentY = 0;
 ImageViewer->ScreenToDocument( x, y, &documentX, &documentY );
 ZoomViewer->CenterOnDocumentPoint( documentX, documentY );
}
If Image Viewer generates the OnBlockSelectionChanged event, Component Synchronizer performs the following operations:
if( selected == VARIANT_TRUE ) {
 if( textEditor != 0 ) {
  textEditor->ShowBlock( blockIndex, NotFound );
 }
}
If Image Viewer generates the OnTableCellsSelected event, Component Synchronizer calls the ShowBlock method of the TextEditor object with the selected block index and the lower right cell index.
If Image Viewer generates the OnAfterDblClick event, Component Synchronizer performs the following operations:
if( textEditor != 0 ) {
 textEditor->ActivateOn( blockIndex, x, y );
}
If Image Viewer generates the OnActivePageChanged event and the ZoomViewer, TextEditor, DocumentViewer properties of the ComponentSynchronizer object have already been set, the FRPage or ActivePage property of the corresponding component is set to the specified page of the document.
If Image Viewer generates the OnSelectTool event, Component Synchronizer performs the following operations:
if( ZoomViewer == 0 ) {
 return;
}
IFRPagePtr curPage;
ZoomViewer->get_FRPage( &curPage );
if( curPage != 0 ) {
 ZoomViewer->put_ActiveTool( selectedTool );
}
If Image Viewer generates the OnOptionsChanged event and the ZoomViewer, DocumentViewer, TextEditor, TextValidator properties of the ComponentSynchronizer object have already been set, the UpdateOptions method of the ZoomViewer, DocumentViewer, TextEditor, TextValidator objects is called.
Events of the connected Zoom Viewer:
If Zoom Viewer generates the OnVisibleDocumentAreaChange event, Component Synchronizer performs the following operations:
if( ImageViewer != 0 ) {
 ImageViewer->put_ZoomRect( visibleRect );
 if( isInFocus ) {
  ImageViewer->ShowDocumentArea( visibleRect );
 }
}
If Zoom Viewer generates the OnBlockSelectionChanged event, Component Synchronizer performs the following operations:
if( selected == VARIANT_TRUE ) {
 if( textEditor != 0 ) {
  textEditor->ShowBlock( blockIndex, NotFound );
 }
}
If Zoom Viewer generates the OnTableCellsSelected event, Component Synchronizer calls the ShowBlock method of the TextEditor object with the selected block index and the lower right cell index.
If Zoom Viewer generates the OnAfterDblClick event, Component Synchronizer performs the following operations:
if( textEditor != 0 ) {
 textEditor->ActivateOn( blockIndex, x, y );
}
If Zoom Viewer generates the OnActivePageChanged event and the ImageViewer, TextEditor, DocumentViewer properties of the ComponentSynchronizer object have already been set, the FRPage or ActivePage property of the corresponding component is set to the specified page of the document.
If Zoom Viewer generates the OnSelectTool event, Component Synchronizer performs the following operations:
if( ImageViewer == 0 ) {
 return;
}
IFRPagePtr curPage;
ImageViewer->get_FRPage( &curPage );
if( curPage != 0 ) {
 ImageViewer->put_ActiveTool( selectedTool );
}
If Zoom Viewer generates the OnOptionsChanged event and the ImageViewer, DocumentViewer, TextEditor, TextValidator properties of the ComponentSynchronizer object have already been set, the UpdateOptions method of the ImageViewer, DocumentViewer, TextEditor, TextValidator objects is called.
Events of the connected Document Viewer:
If Document Viewer generates the OnActivePageChanged event and the ImageViewer, ZoomViewer, TextEditor properties of the ComponentSynchronizer object have already been set, the FRPage property of the corresponding component is set to the specified page of the document.
If Document Viewer generates the OnDocumentChanged event and the ImageViewer, ZoomViewer, TextEditor, TextValidator properties of the ComponentSynchronizer object have already been set:
  • the FRDocument property of the TextValidator object is set to the new document
  • the FRPage property of the ImageViewer, ZoomViewer, and TextEditor objects and the ActivePage property of the DocumentViewer object are set to the first page of the new document
If Document Viewer generates the OnOptionsChanged event and the ImageViewer, ZoomViewer, TextEditor, TextValidator properties of the ComponentSynchronizer object have already been set, the UpdateOptions method of the ImageViewer, ZoomViewer, TextEditor, TextValidator objects is called.
Events of the connected Text Editor:
If Text Editor generates the OnEditorBlockChanged event, the ComponentSynchronizer performs the following operations:
  1. If the ImageViewer, ZoomViewer properties of the ComponentSynchronizer object have already been set, the SetSelectedBlocksIndices method of the ImageViewer and ZoomViewer object is called for the specified block.
  2. If it is a table block, the SetSelectedCells method of the ImageViewer and ZoomViewer object is called for the selected cell.
  3. Then the ShowDocumentArea method of the ImageViewer and ZoomViewer object is called.
If Text Editor generates the OnSymbolSelected event, Component Synchronizer performs the following operations:
if( ZoomViewer != 0 ) {
 ZoomViewer->put_SymbolRect( symbolRect );
}
if( ImageViewer != 0 ) {
 ImageViewer->ShowDocumentArea( symbolRect );
}
if( ZoomViewer != 0 ) {
 ZoomViewer->ShowDocumentArea( symbolRect );
}
If Text Editor generates the OnActivePageChanged event and the ImageViewer, ZoomViewer, DocumentViewer properties of the ComponentSynchronizer object have already been set, the FRPage or ActivePage property of the corresponding component is set to the specified page of the document.
If Text Editor generates the OnOptionsChanged event and the ImageViewer, ZoomViewer, DocumentViewer, TextValidator properties of the ComponentSynchronizer object have already been set, the UpdateOptions method of the ImageViewer, ZoomViewer, DocumentViewer, TextValidator objects is called.
Events of the connected Text Validator:
If Text Validator generates the OnSymbolSelected event, Component Synchronizer performs the following operations:
if( ZoomViewer != 0 ) {
 ZoomViewer->put_SymbolRect( symbolRectangle );
}
If Text Validator generates the OnSelectionChanged event, Component Synchronizer performs the following operations:
int symbolPos;
IEditorPosition* nextPosition;
position->get_Symbol( &symbolPos );
nextPosition->put_Symbol( symbolPos + length );
if( textEditor != 0 ) {
 textEditor->SetSelection( position, nextPosition );
}
If Text Validator generates the OnActivePageChanged event and the ImageViewer, ZoomViewer, TextEditor, DocumentViewer properties of the ComponentSynchronizer object have already been set, the FRPage or ActivePage property of the corresponding component is set to the specified page of the document.
If Text Validator generates the OnDocumentChanged event and the ImageViewer, ZoomViewer, TextEditor, DocumentViewer properties of the ComponentSynchronizer object have already been set:
  • the FRDocument property of the DocumentViewer object is set to the new document
  • the FRPage property of the ImageViewer, ZoomViewer, and TextEditor objects and the ActivePage property of the DocumentViewer object are set to the first page of the new document
If Text Validator generates the OnOptionsChanged event and the ImageViewer, ZoomViewer, TextEditor, DocumentViewer properties of the ComponentSynchronizer object have already been set, the UpdateOptions method of the ImageViewer, ZoomViewer, TextEditor, DocumentViewer objects is called.

See also

ComponentSynchronizer