| Methods Index |
CSubviewSubclasses:
CScroller
CVirtualFrame is an abstract class that represents an area on the screen with a virtual size that is larger than its display area. Every virtual frame thus has two regions associated with it: a virtual region and a real visible region (display area) located inside a window or some other view. A CVirtualFrame object is a subview, so it can contain other nested views.
CVirtualFrame and registered as subviews. These objects are displayed inside the viewing rectangle relative to a virtual origin. As the origin changes, different areas of the virtual frame are displayed, revealing the subviews contained in the virtual frame.You can set the virtual size of the frame manually using
SetVirtualFrame. If this is not done, the virtual frame automatically sizes itself to enclose all of its subviews. This is an abstract class that must be extended by derived classes that manipulate the scrolling by updating the origin (through the use of
NScrollBars, for example).
|
| ||
CPoint*
|
itsViewOrigin;
| The origin of the virtual frame relative to the viewable rectangle |
CRect*
|
itsVirtualFrame;
| The virtual region |
|
| ||
static double
|
itsXProportion;
| Internal sizing variable |
static double
|
itsYProportion;
| Internal sizing variable |
|
| ||
friend class
|
CScroller
| |
BOOLEAN IVirtualFrame(BOOLEAN isVisible = TRUE,
GLUETYPE theGlue = NULLSTICKY);
virtual ~CVirtualFrame(void);
virtual void SetScrollingOrigin(
const CPoint& theNewOrigin);
virtual CPoint& GetScrollingOrigin(void);
CPoint) indicating the actual position of the scrolling area of the virtual frame, relative to the entire frame.
virtual void SetVirtualFrame(UNITS theNewWidth, UNITS theNewHeight);
theNewWidth or theNewHeight is 32767.
virtual CRect GetVirtualFrame(void) const;
CRect) describing the dimensions of the virtual frame's virtual region. The rectangle is top-left justified; that is, its top-left point is 0,0, and the bottom right point represents the height and the width.
virtual void EnlargeToFit(const CRect& theRegionToInclude);
virtual void ShrinkToFit(void);
virtual void Draw(const CRect& theClippingRegion);
theClippingRegion is the portion of the visible region that must be drawn, and it is represented in global, window-relative coordinates.
virtual void Size(const CRect& theNewSize);
theNewSize specifies the size of the virtual region of the frame. 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, theNewSize, are relative to the enclosure-like the coordinates of the region passed in when a view is instantiated.
virtual CPoint GetGlobalOrigin(void) const;
CWindow.
CVirtualFrame(CSubview* theEnclosure,
const CRect& theRegion,
UNITS theVirtualWidth =0,
UNITS theVirtualHeight =0);
theEnclosure is a pointer to the subview that will contain the virtual frame. theRegion is the actual visible region of the virtual frame. It is a coordinate location, local to theEnclosure, that is used to place the visible region of the virtual frame. The parameters theVirtualWidth and theVirtualHeight together define the size of the virtual area.
CVirtualFrame(const CVirtualFrame& theVirtualFrame);
CVirtualFrame& operator= (
const CVirtualFrame& theVirtualFrame);
virtual void ScrollViews(const CPoint& theNewOrigin);
virtual void AdjustScrollBars(void) = 0;
virtual void AddSubview(const CView* theSubview);
CSubview-derived 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.