| Methods Index |
CVirtualFrameSubclasses:
CListBox
CScroller attaches scrollbars to the visible area of the virtual frame; it is a virtual frame with scrollbars. Objects nested inside a scroller scroll automatically as the user manipulates the scrollbars. When users drag or size objects inside a scroller, the contents scroll automatically as the object is dragged beyond the visible borders.
CScroller object, initialize it, and place objects inside it (see CVirtualFrame). You must call the initializer prior to using the CScroller object in order to establish the following:
PAT_SOLID, even if you give it another setting. You can define the brush color, however. The color of the scrollbars is system-defined.
CScroller(CSubview* theEnclosure,
const CRect& theRegion,
UNITS theVirtualWidth = 0,
UNITS theVirtualHeight = 0);
theEnclosure is a pointer to the subview that will contain the scroller. theRegion is a coordinate location, local to the enclosure, that is used to place the scroller. The parameters theVirtualWidth and theVirtualHeight together define the size of the virtual area enclosing the scroller.On MS-Windows, the maximum value for
theVirtualHeight or theVirtualWidth is 32767.
CScroller(CWindow* theScrollableWindow,
UNITS theVirtualWidth = 0,
UNITS theVirtualHeight = 0);
theScrollableWindow is a window with scrollbars that will contain the scroller. The scroller will occupy the entire window's client area and will be operated using the window's scrollbars. The parameters theVirtualWidth and theVirtualHeight together define the size of the virtual area enclosing the scroller.On MS-Windows, the maximum value for
theVirtualHeight or theVirtualWidth is 32767.
CScroller(const CScroller& theScroller);
CScroller& operator=(const CScroller& theScroller);
virtual ~CScroller(void);
BOOLEAN IScroller(
BOOLEAN hasHorizontalScrollBar = TRUE,
BOOLEAN hasVerticalScrollBar = TRUE,
BOOLEAN isThumbTracking = FALSE,
UNITS theLineIncrement = 10,
UNITS thePageIncrement = 50,
BOOLEAN isVisible = TRUE,
long theGlue = NULLSTICKY);
theLineIncrement specifies the number of pixels to scroll for a line increment; similarly, thePageIncrement specifies the number of pixels to scroll for a page increment. Like all initializers for classes in the CSubview hierarchy, this initializer takes a visibility state and a glue type.
virtual void SetHIncrements(UNITS theLineIncrement, UNITS thePageIncrement);
virtual void SetVIncrements(UNITS theLineIncrement, UNITS thePageIncrement);
virtual UNITS GetHLineIncrement(void) const;
virtual UNITS GetVLineIncrement(void) const;
virtual UNITS GetHPageIncrement(void) const;
virtual UNITS GetVPageIncrement(void) const;
virtual void SetThumbtracking(BOOLEAN isThumbTracking);
BOOLEAN value of TRUE or FALSE.
virtual BOOLEAN IsThumbtracking(void) const;
BOOLEAN value of TRUE if the scroller supports dynamic thumbtracking and FALSE if it does not.
static BOOLEAN RegisterForUpdate(CView* theView);
CScroller object. theEventType designates the kind of scroll: line up, line down, page up, or page down (the terms "up" and "down" are used for both horizontal and vertical scrolling, though the effects are different for horizontal scrolling). theThumbPosition is the numerical value for placement of the thumb when either thumb repositioning or dynamic thumb tracking is used. This method responds to the scrollbar event by scrolling the views contained inside the scroller.
virtual void VScroll(SCROLL_CONTROL theEventType, UNITS theThumbPosition);
virtual void HScroll(SCROLL_CONTROL theEventType, UNITS theThumbPosition);
virtual void ScrollViews)const CPoint& theNewOrigin);
virtual CPoint AutoScroll(UNITS horizontalChange, UNITS verticalChange);
AutoScroll method on CView. The scroller receives this event when the user drags one of its subviews towards the outside of the scroller. The dragging produces an autoscroll event because the subview is being dragged outside of its bounds. theHorizontalChange takes a number of pixels. If the number is zero (0), no autoscrolling occurs; if the number is positive, the view scrolls to the right; if it is negative, the view scrolls to the left. theVerticalChange also takes a number of pixels. If the number is zero (0), no autoscrolling occurs; if the number is positive, the view scrolls downward; if it is negative, the view scrolls upward.
virtual void Key(const CKey& the key);
virtual void AddSubview(const CView* theSubview);
CSubview object to the contents of the virtual frame. This method ensures that the virtual region of the frame is large enough to include the newly added object, sizing it when necessary.
virtual CPoint GetGlobalOrigin(void) const;
virtual CRect GetClippedFrame(void) const;
CRect) with the coordinates of the visible portion of a clipped view. Usually, you will call GetClippedFrame before you call DoDraw in order to pass the smallest region possible to DoDraw. Because DoDraw and Draw take window-relative coordinates, GetClippedFrame returns a window-relative CRect.
CScroller and its scrollbars:
virtual void Size(const CRect& theRect);
theRect. The reset region could be in a different location and have completely different dimensions-a new width or a new height. The coordinates of the region, theRect, are relative to the enclosure-like the coordinates of the region that is passed in when a view is instantiated.
virtual void Draw(const CRect& theClipping);
CView::Draw to draw the scroller's frame.
virtual void DoDraw(
const CRect& theClippingRegion = MAXRect);
CSubview::DoDraw to send draw messages to all enclosed views.virtual void PrintDraw(
const CRect& theClipping = MAXRect);
For more information on this method, see
CView::PrintDraw.
virtual void SetOrigin(const CPoint& theDeltaPoint);
CScroller and adds theDeltaPoint to it.
virtual void Show();
CScroller and its scrollbars visible.
virtual void Hide();
CScroller and its scrollbars invisible.
virtual void Enable();
CScroller and its scrollbars to receive events.
virtual void Disable();
CScroller and its scrollbars, so that they do not receive events.
virtual void SetEnvironment(
const CEnvironment& theEnvironment,
BOOLEAN isUpdate);
CScroller and its scrollbars, using theNewEnvironment. For more information, see the CView::SetEnvironment method.
virtual void SetEnclosure(CSubview* theEnclosure);
CScroller's scrollbars, along with the CScroller, to a new enclosure. This method is overridden from CSubview.
virtual void AdjustScrollBars(void);
CRect GetInitialFrame(CSubview* theEnclosure,
const CRect& theRegion,
BOOLEAN hasHorizontalScrollBar,
BOOLEAN hasVerticalScrollBar) const;
CRect GetInnerFrame(void) const;
static RWOrdered & GetUpdateViewList(void);
static void ProcessViewUpdate(void);