메인 콘텐츠로 건너뛰기
Visual Components는 Windows용 FRE에 구현되어 있습니다.
Component Synchronizer는 Visual Components에서 발생하는 다양한 이벤트에 자동으로 반응하도록 구현된 특수 구성 요소입니다. 여러 Visual Components를 Synchronizer에 연결할 수 있으며, 이렇게 연결된 구성 요소들은 하나의 애플리케이션처럼 작동합니다. 모든 구성 요소를 연결한 상태로만 Component Synchronizer를 사용할 필요는 없으며, 실제로 사용하는 것만 연결하면 됩니다. 예를 들어, Image Viewer는 ImageViewer 속성을 통해, Text Editor는 TextEditor 속성을 통해 연결할 수 있습니다. Component Synchronizer에는 사용자 인터페이스가 없습니다. 또한 Visual Components의 내부 기능은 사용하지 않고, 구성 요소의 COM API만 사용합니다. Component Synchronizer는 아래에 설명된 방식으로 작동합니다.

구성 요소가 API를 통해 Synchronizer에 연결된 경우

구성 요소 또는 객체가 다음을 통해 Component Synchronizer에 연결되면:
이 경우 IComponentSynchronizer::ImageViewer 속성이 지정된 ImageViewer 객체로 설정되고, 이어서 다음 작업이 수행됩니다:
속성설정되는 값
IImageViewer::ZoomRectEnabledTrue
IImageViewer::DocumentProcessingParamsIComponentSynchronizer::DocumentProcessingParams
IImageViewer::FRPageIComponentSynchronizer::Document에서 IComponentSynchronizer::PageIndex 인덱스에 해당하는 페이지
이 경우 IComponentSynchronizer::ZoomViewer 속성이 지정된 ZoomViewer 객체로 설정되고, 이어서 다음 작업이 수행됩니다:
속성설정되는 값
IZoomViewer::SymbolRectEnabledTrue
IZoomViewer::DocumentProcessingParamsIComponentSynchronizer::DocumentProcessingParams
IZoomViewer::FRPageIComponentSynchronizer::Document에서 IComponentSynchronizer::PageIndex 인덱스에 해당하는 페이지
이 경우 IComponentSynchronizer::TextEditor 속성이 지정된 TextEditor 객체로 설정되고, 이어서 다음 작업이 수행됩니다:
속성설정되는 값
ITextEditor::SynthesisParamsForDocumentIComponentSynchronizer::DocumentProcessingParams 객체의 SynthesisParamsForDocument 속성 값
ITextEditor::FRPageIComponentSynchronizer::Document에서 IComponentSynchronizer::PageIndex 인덱스에 해당하는 페이지
이 경우 IComponentSynchronizer::TextValidator 속성이 지정된 TextValidator 객체로 설정되고, 이어서 다음 작업이 수행됩니다:
속성설정되는 값
ITextValidator::SynthesisParamsForDocumentIComponentSynchronizer::DocumentProcessingParams 객체의 SynthesisParamsForDocument 속성 값
ITextValidator::FRDocumentIComponentSynchronizer::Document
이 경우 IComponentSynchronizer::DocumentViewer 속성이 지정된 DocumentViewer 객체로 설정되고, 이어서 다음 작업이 수행됩니다:
속성설정되는 값
IDocumentViewer::FRDocumentIComponentSynchronizer::Document
IDocumentViewer::DocumentProcessingParamsIComponentSynchronizer::DocumentProcessingParams
IDocumentViewer::ActivePageIComponentSynchronizer::Document에서 IComponentSynchronizer::PageIndex 인덱스에 해당하는 페이지
이 경우 IComponentSynchronizer::Document 속성이 지정된 FRDocument 객체로 설정되고, 이어서 다음 작업이 수행됩니다:
속성설정되는 값
IImageViewer::FRPage IZoomViewer::FRPage ITextEditor::FRPage IDocumentViewer::ActivePageIComponentSynchronizer::Document의 첫 번째 페이지
IComponentSynchronizer::PageIndex0
IDocumentViewer::FRDocument ITextValidator::FRDocumentIComponentSynchronizer::Document
이 경우 IComponentSynchronizer::DocumentProcessingParams 속성이 지정된 DocumentProcessingParams 객체로 설정되고, 이어서 다음 작업이 수행됩니다:
속성설정되는 값
IImageViewer::DocumentProcessingParams IZoomViewer::DocumentProcessingParams IDocumentViewer::DocumentProcessingParamsIComponentSynchronizer::DocumentProcessingParams
ITextEditor::SynthesisParamsForDocument ITextValidator::SynthesisParamsForDocumentIComponentSynchronizer::DocumentProcessingParams 객체의 SynthesisParamsForDocument 속성 값
이 경우 IComponentSynchronizer::PageIndex 속성이 지정된 값으로 설정되고, 이어서 다음 작업이 수행됩니다:
속성설정되는 값
IImageViewer::FRPage IZoomViewer::FRPage ITextEditor::FRPage IDocumentViewer::ActivePageIComponentSynchronizer::Document에서 IComponentSynchronizer::PageIndex 인덱스에 해당하는 페이지

연결된 구성 요소가 이벤트를 생성하는 경우

연결된 Image Viewer의 이벤트:
Image Viewer가 OnMouseButtonUp 이벤트를 생성하면 Component Synchronizer는 다음 작업을 수행합니다.
if( mouseButton == MBU_LeftButton && ZoomViewer != 0 ) {
 int documentX = 0;
 int documentY = 0;
 ImageViewer->ScreenToDocument( x, y, &documentX, &documentY );
 ZoomViewer->CenterOnDocumentPoint( documentX, documentY );
}
Image Viewer가 OnBlockSelectionChanged 이벤트를 생성하면 Component Synchronizer는 다음 작업을 수행합니다.
if( selected == VARIANT_TRUE ) {
 if( textEditor != 0 ) {
  textEditor->ShowBlock( blockIndex, NotFound );
 }
}
Image Viewer가 OnTableCellsSelected 이벤트를 생성하면 Component Synchronizer는 선택한 블록 인덱스와 오른쪽 아래 셀 인덱스를 사용해 TextEditor 객체의 ShowBlock 메서드를 호출합니다.
Image Viewer가 OnAfterDblClick 이벤트를 생성하면 Component Synchronizer는 다음 작업을 수행합니다.
if( textEditor != 0 ) {
 textEditor->ActivateOn( blockIndex, x, y );
}
Image Viewer가 OnActivePageChanged 이벤트를 생성하고 ComponentSynchronizer 객체의 ZoomViewer, TextEditor, DocumentViewer 속성이 이미 설정되어 있으면, 해당 구성 요소의 FRPage 또는 ActivePage 속성이 문서의 지정된 페이지로 설정됩니다.
Image Viewer가 OnSelectTool 이벤트를 생성하면 Component Synchronizer는 다음 작업을 수행합니다.
if( ZoomViewer == 0 ) {
 return;
}
IFRPagePtr curPage;
ZoomViewer->get_FRPage( &curPage );
if( curPage != 0 ) {
 ZoomViewer->put_ActiveTool( selectedTool );
}
Image Viewer가 OnOptionsChanged 이벤트를 생성하고 ComponentSynchronizer 객체의 ZoomViewer, DocumentViewer, TextEditor, TextValidator 속성이 이미 설정되어 있으면, ZoomViewer, DocumentViewer, TextEditor, TextValidator 객체의 UpdateOptions 메서드가 호출됩니다.
연결된 Zoom Viewer의 이벤트:
Zoom Viewer가 OnVisibleDocumentAreaChange 이벤트를 생성하면 Component Synchronizer는 다음 작업을 수행합니다.
if( ImageViewer != 0 ) {
 ImageViewer->put_ZoomRect( visibleRect );
 if( isInFocus ) {
  ImageViewer->ShowDocumentArea( visibleRect );
 }
}
Zoom Viewer가 OnBlockSelectionChanged 이벤트를 생성하면 Component Synchronizer는 다음 작업을 수행합니다.
if( selected == VARIANT_TRUE ) {
 if( textEditor != 0 ) {
  textEditor->ShowBlock( blockIndex, NotFound );
 }
}
Zoom Viewer가 OnTableCellsSelected 이벤트를 생성하면 Component Synchronizer는 선택한 블록 인덱스와 오른쪽 아래 셀 인덱스를 사용해 TextEditor 객체의 ShowBlock 메서드를 호출합니다.
Zoom Viewer에서 OnAfterDblClick 이벤트가 발생하면 Component Synchronizer는 다음 작업을 수행합니다.
if( textEditor != 0 ) {
 textEditor->ActivateOn( blockIndex, x, y );
}
Zoom Viewer에서 OnActivePageChanged 이벤트가 발생하고 ComponentSynchronizer 객체의 ImageViewer, TextEditor, DocumentViewer 속성이 이미 설정되어 있으면, 해당 구성 요소의 FRPage 또는 ActivePage 속성이 문서의 지정된 페이지로 설정됩니다.
Zoom Viewer에서 OnSelectTool 이벤트가 발생하면 Component Synchronizer는 다음 작업을 수행합니다.
if( ImageViewer == 0 ) {
 return;
}
IFRPagePtr curPage;
ImageViewer->get_FRPage( &curPage );
if( curPage != 0 ) {
 ImageViewer->put_ActiveTool( selectedTool );
}
Zoom Viewer에서 OnOptionsChanged 이벤트가 발생하고 ComponentSynchronizer 객체의 ImageViewer, DocumentViewer, TextEditor, TextValidator 속성이 이미 설정되어 있으면, ImageViewer, DocumentViewer, TextEditor, TextValidator 객체의 UpdateOptions 메서드가 호출됩니다.
연결된 Document Viewer의 이벤트:
Document Viewer에서 OnActivePageChanged 이벤트가 발생하고 ComponentSynchronizer 객체의 ImageViewer, ZoomViewer, TextEditor 속성이 이미 설정되어 있으면, 해당 구성 요소의 FRPage 속성이 문서의 지정된 페이지로 설정됩니다.
Document Viewer에서 OnDocumentChanged 이벤트가 발생하고 ComponentSynchronizer 객체의 ImageViewer, ZoomViewer, TextEditor, TextValidator 속성이 이미 설정되어 있으면 다음과 같이 처리됩니다.
  • TextValidator 객체의 FRDocument 속성이 새 문서로 설정됩니다.
  • ImageViewer, ZoomViewer, TextEditor 객체의 FRPage 속성과 DocumentViewer 객체의 ActivePage 속성이 새 문서의 첫 번째 페이지로 설정됩니다.
Document Viewer에서 OnOptionsChanged 이벤트가 발생하고 ComponentSynchronizer 객체의 ImageViewer, ZoomViewer, TextEditor, TextValidator 속성이 이미 설정되어 있으면, ImageViewer, ZoomViewer, TextEditor, TextValidator 객체의 UpdateOptions 메서드가 호출됩니다.
연결된 Text Editor의 이벤트:
Text Editor에서 OnEditorBlockChanged 이벤트가 발생하면 ComponentSynchronizer는 다음 작업을 수행합니다.
  1. ComponentSynchronizer 객체의 ImageViewer, ZoomViewer 속성이 이미 설정되어 있으면, 지정된 블록에 대해 ImageViewer 및 ZoomViewer 객체의 SetSelectedBlocksIndices 메서드가 호출됩니다.
  2. 테이블 블록인 경우 선택된 셀에 대해 ImageViewer 및 ZoomViewer 객체의 SetSelectedCells 메서드가 호출됩니다.
  3. 그런 다음 ImageViewer 및 ZoomViewer 객체의 ShowDocumentArea 메서드가 호출됩니다.
Text Editor에서 OnSymbolSelected 이벤트가 발생하면 Component Synchronizer는 다음 작업을 수행합니다.
if( ZoomViewer != 0 ) {
 ZoomViewer->put_SymbolRect( symbolRect );
}
if( ImageViewer != 0 ) {
 ImageViewer->ShowDocumentArea( symbolRect );
}
if( ZoomViewer != 0 ) {
 ZoomViewer->ShowDocumentArea( symbolRect );
}
Text Editor가 OnActivePageChanged 이벤트를 발생시키고 ComponentSynchronizer 객체의 ImageViewer, ZoomViewer, DocumentViewer 속성이 이미 설정되어 있으면, 해당 구성 요소의 FRPage 또는 ActivePage 속성이 문서의 지정된 페이지로 설정됩니다.
Text Editor가 OnOptionsChanged 이벤트를 발생시키고 ComponentSynchronizer 객체의 ImageViewer, ZoomViewer, DocumentViewer, TextValidator 속성이 이미 설정되어 있으면, ImageViewer, ZoomViewer, DocumentViewer, TextValidator 객체의 UpdateOptions 메서드가 호출됩니다.
연결된 Text Validator의 이벤트:
Text Validator가 OnSymbolSelected 이벤트를 발생시키면, Component Synchronizer는 다음 작업을 수행합니다.
if( ZoomViewer != 0 ) {
 ZoomViewer->put_SymbolRect( symbolRectangle );
}
Text Validator가 OnSelectionChanged 이벤트를 발생시키면, Component Synchronizer는 다음 작업을 수행합니다.
int symbolPos;
IEditorPosition* nextPosition;
position->get_Symbol( &symbolPos );
nextPosition->put_Symbol( symbolPos + length );
if( textEditor != 0 ) {
 textEditor->SetSelection( position, nextPosition );
}
Text Validator가 OnActivePageChanged 이벤트를 발생시키고 ComponentSynchronizer 객체의 ImageViewer, ZoomViewer, TextEditor, DocumentViewer 속성이 이미 설정되어 있으면, 해당 구성 요소의 FRPage 또는 ActivePage 속성이 문서의 지정된 페이지로 설정됩니다.
Text Validator가 OnDocumentChanged 이벤트를 발생시키고 ComponentSynchronizer 객체의 ImageViewer, ZoomViewer, TextEditor, DocumentViewer 속성이 이미 설정되어 있으면:
  • DocumentViewer 객체의 FRDocument 속성이 새 문서로 설정됩니다
  • ImageViewer, ZoomViewer, TextEditor 객체의 FRPage 속성과 DocumentViewer 객체의 ActivePage 속성이 새 문서의 첫 페이지로 설정됩니다
Text Validator가 OnOptionsChanged 이벤트를 발생시키고 ComponentSynchronizer 객체의 ImageViewer, ZoomViewer, TextEditor, DocumentViewer 속성이 이미 설정되어 있으면, ImageViewer, ZoomViewer, TextEditor, DocumentViewer 객체의 UpdateOptions 메서드가 호출됩니다.

함께 보기

ComponentSynchronizer