MvcScrollView_T Class

class MvcScrollView_T: public CScrollView

This is a wrapper class that derives from your viewport and CScrollView. The resulting class can be used like a CScrollView, except all of the drawing will automaticallt be delegated to the viewport class.

See the MvcForm sample for a demonstration of this class.

Defined in: MvcScrollView.h

Class Template Arguments

base_t

The class of the viewport to derive from

Class Members

base_t* GetViewport()

Casts this object to the base viewport class

virtual void OnInitialUpdate()

Sets up default viewport initialization

virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)

Forwards commands to the embedded viewport

virtual BOOL OnWndMsg( UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult )

Forwards messages to the embedded viewport

virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo = NULL)

Prepares the device context for drawing

virtual BOOL OnScrollBy(CSize sizeScroll, BOOL bDoScroll = TRUE)

Called by MFC framework to scroll the view.

virtual void OnDraw(CDC* pDC)

Draws the viewport

virtual void DoScrollViewport(CPoint ptScrollPos)

Scrolls the embedded viewport in response to WM_xSCROLL or WM_SIZE messages