OnScroll Method of the IInputEvents Interface
This method is implemented on the client-side. It is called by ABBYY FineReader Engine when the scroll box has been moved by either a mouse or keyboard action in Image Viewer, Zoom Viewer, Text Editor, Text Validator, or Document Viewer.
It delivers to the client the scroll-bar code, scroll-box position, and the number of scrolled lines. With the help of this method it is possible to cancel the operation.
Syntax
C++
HRESULT OnScroll( int HorzScrollBarCode, int VertScrollBarCode, int Position, int Count, VARIANT_BOOL* Cancel );
C#
void OnScroll( int HorzScrollBarCode, int VertScrollBarCode, int Position, int Count, out bool Cancel );
Visual Basic .NET
Sub OnScroll( _ HorzScrollBarCode As Integer, _ VertScrollBarCode As Integer, _ Position As Integer, _ Count As Integer, _ ByRef Cancel As Boolean _ )
Parameters
- HorzScrollBarCode
- [in] Specifies a scroll-bar code that indicates the user's scrolling request. This parameter can be one of the following:
- SB_LEFT (6) — Scroll to far left.
- SB_ENDSCROLL (8) — End scroll.
- SB_LINELEFT (0) — Scroll left.
- SB_LINERIGHT (1) — Scroll right.
- SB_PAGELEFT (2) — Scroll one page left.
- SB_PAGERIGHT (3) — Scroll one page right.
- SB_RIGHT (7) — Scroll to far right.
- SB_THUMBPOSITION (4) — Scroll to absolute position. The current position is specified by the Position parameter.
- SB_THUMBTRACK (5) — Drag scroll box to specified position. The current position is specified by the Position parameter.
The constants are defined in Winuser.h. The parameter is -1, if there was no horizontal scroll.
- VertScrollBarCode
- [in] Specifies a scroll-bar code that indicates the user's scrolling request. This parameter can be one of the following:
- SB_BOTTOM (7) — Scroll to bottom.
- SB_ENDSCROLL (8) — End scroll.
- SB_LINEDOWN (1) — Scroll one line down.
- SB_LINEUP (0) — Scroll one line up.
- SB_PAGEDOWN (3) — Scroll one page down.
- SB_PAGEUP (2) — Scroll one page up.
- SB_THUMBPOSITION (4) — Scroll to the absolute position. The current position is provided in Position parameter.
- SB_THUMBTRACK (5) — Drag scroll box to specified position. The current position is provided in Position parameter.
- SB_TOP (6) — Scroll to top.
The constants are defined in Winuser.h. The parameter is -1, if there was no vertical scroll.
- Position
- [in] Specifies the scroll-box position if the scroll-bar code is SB_THUMBPOSITION or SB_THUMBTRACK; otherwise, not used.
- Count
- [in] Contains the number of scrolled lines if the scrolling was made by mouse wheel.
- Cancel
- [out] You may set this variable to TRUE to indicate that the process should be terminated.
Return values
[C++ only] If this method returns a value other than S_OK, it indicates that an error occurred on the client-side, and in this case, the value of the Cancel parameter is not taken into account.
Remarks
The client implementation of this method must assure that all exceptions thrown inside the method are caught and handled and no exceptions are propagated outside the method. Propagation of an exception outside the method may lead to unpredictable results (such as program termination).
See also
17.09.2024 15:14:40