SECPanView Class

class SECPanView: public SECZoomView

SECPanView adds full panning support to class SECZoomView.

Defined in: SECPANVW.H

Comments

This allows the user to 'grab' the view with the mouse and drag it to reveal a new visible portion of the view. Panning is a popular alternative to scrollbars, because it adds the flexibility of not having to move the mouse all the way over to a scrollbar. Also, two degrees of motion are available and views can be panned diagonally, whereas with scrollbars, a series of clicks and mouse moves are necessary to achieve diagonal movement of the view.

SECPanView supports two modes of operation: SEC_PANDELAY and SEC_PANINSTANT. In SEC_PANDELAY mode, the user moves the view and then the view moves to reflect the new visible area once the user is done. In SEC_PANINSTANT mode, the user gets instant feedback with every movement of the mouse.

Three key SECPanView member functions are called to perform panning:

StartPanA user has started a pan.
ContinuePanThe user is continuing to pan after starting, usually tied to a mouse move. Updates the view if in SEC_PANINSTANT mode.
EndPanThe user has stopped panning. Updates the view if in SEC_PANDELAY mode.

Each of these member functions takes a point as an argument so the amount of panning can be calculated.

SECPanView also provides an overview window that shows the user a miniaturization of the entire view. The user can use the overview window to pan the visible portion of the view and also to see where the visible area lies in relation to other portions of the view. The overview window is especially helpful at large zoom levels when it is possible to lose track of the current location in a complex view.

The CLOUD sample in the \SAMPLES\TOOLKIT\STANDARD\VIEWS\CLOUD directory demonstrates SECPanView. Since SECPanView is derived from SECZoomView, you can mix the two view enhancements together as demonstrated in the CLOUD sample. CLOUD has all SECPanView and SECZoomView calls highlighted by comments with the class name in them. (e.g., //SECPanView or //SECZoomView).

See Also

SECPanWnd SECZoomView

Class Members

Constructors

SECPanView()

Creates an SECPanView. This is not called directly.

Public Members Panning Operations

void SetPanMode(SECPanMode panMode)

Sets the pan mode to one of SEC_PANDELAY or SEC_PANINSTANT.

SECPanMode GetPanMode()

Retrieves the current pan mode.

BOOL IsPanning()

Is the view currently panning?

virtual void StartPan(CPoint * ptPan, UINT nCursorID = 0)

Put the SECPanView into panning mode.

virtual void ContinuePan(CPoint *ptPan)

Continues the pan, causes the view to be updated if in SEC_PANINSTANT mode.

virtual void EndPan(CPoint *ptPan)

Stops the pan, causes the view to be updated if in SEC_PANDELAY mode.

Overview Window Operations

BOOL IsOverviewShown()

Is the overview window being displayed?

virtual BOOL ShowOverviewWnd(CRect)

Displays the overview PanWnd window.

virtual BOOL HideOverviewWnd()

Hides the overview PanWnd window.

virtual void UpdateOverviewWnd(CView * pSender, LPARAM lHint = 0L, CObject * pHint = NULL)

Call to update the overview window.

virtual void OnUpdateOverview(CView * pSender, LPARAM lHint,CObject * pHint, CDC * pOverviewDC, CWnd * pWndOverview)

When overview window is updated, invalidates all of the window or, using hints, only some regions for repainting.