CDrawContext Class Reference

A drawing context encapsulates the drawing context of the underlying OS. It implements the drawing functions. More...

#include <vstgui.h>

Inheritance diagram for CDrawContext:

CReferenceCounter COffscreenContext List of all members.

Public Member Functions

 CDrawContext (CFrame *pFrame, void *pSystemContext, void *pWindow=0)
virtual ~CDrawContext ()
void moveTo (const CPoint &point)
 move line position to point
void lineTo (const CPoint &point)
 draw a line from current position to point
void drawLines (const CPoint *points, const long &numberOfLines)
 draw multiple lines at once
void drawPolygon (const CPoint *pPoints, long numberOfPoints, const CDrawStyle drawStyle=kDrawStroked)
 draw a polygon
void polyLine (const CPoint *pPoint, long numberOfPoints)
 draw a stroked polygon
void fillPolygon (const CPoint *pPoint, long numberOfPoints)
 draw a filled polygon
void drawRect (const CRect &rect, const CDrawStyle drawStyle=kDrawStroked)
 draw a stroked rect
void fillRect (const CRect &rect)
 draw a filled rect
void drawArc (const CRect &rect, const float startAngle1, const float endAngle2, const CDrawStyle drawStyle=kDrawStroked)
 draw a stroked arc, where the angles are in degree
void drawArc (const CRect &rect, const CPoint &point1, const CPoint &point2)
 draw a stroked arc between point1 and point2
void fillArc (const CRect &rect, const CPoint &point1, const CPoint &point2)
 draw a filled arc between point1 and point2
void drawEllipse (const CRect &rect, const CDrawStyle drawStyle=kDrawStroked)
 draw an ellipse
void fillEllipse (const CRect &rect)
 draw a filled ellipse
void drawPoint (const CPoint &point, CColor color)
 draw a point
CColor getPoint (const CPoint &point)
void floodFill (const CPoint &start)
void setLineStyle (CLineStyle style)
 set the current line style
CLineStyle getLineStyle () const
 get the current line style
void setLineWidth (CCoord width)
 set the current line width
CCoord getLineWidth () const
 get the current line width
void setDrawMode (CDrawMode mode)
 set the current draw mode, see CDrawMode
CDrawMode getDrawMode () const
 get the current draw mode, see CDrawMode
void setClipRect (const CRect &clip)
 set the current clip
CRectgetClipRect (CRect &clip) const
 get the current clip
void resetClipRect ()
 reset the clip to the default state
void setFillColor (const CColor color)
 set current fill color
CColor getFillColor () const
 get current fill color
void setFrameColor (const CColor color)
 set current stroke color
CColor getFrameColor () const
 get current stroke color
void setFontColor (const CColor color)
 set current font color
CColor getFontColor () const
 get current font color
void setFont (CFont fontID, const long size=0, long style=0)
 set current font
CFont getFont () const
 get current font
long getFontSize () const
 get current font size
CCoord getStringWidth (const char *pStr)
 get the width of a string
void drawString (const char *pString, const CRect &rect, const short opaque=false, const CHoriTxtAlign hAlign=kCenterText)
 draw a string
long getMouseButtons ()
 get current mouse buttons
void getMouseLocation (CPoint &point)
 get current mouse location. should not be used, see CView::getMouseLocation
bool waitDoubleClick ()
 check if another mouse click occurs in the near future
bool waitDrag ()
 check if the mouse will be dragged
void * getWindow ()
void setWindow (void *ptr)
void getLoc (CPoint &where) const
CFramegetFrame () const
void * getSystemContext () const
virtual void forget ()

Public Attributes

CPoint offsetScreen
CPoint offset

Protected Attributes

void * pSystemContext
void * pWindow
CFramepFrame
long fontSize
long fontStyle
CFont fontId
CColor fontColor
CPoint penLoc
CCoord frameWidth
CColor frameColor
CColor fillColor
CLineStyle lineStyle
CDrawMode drawMode
CRect clipRect

Friends

class CBitmap
class COffscreenContext

Detailed Description

A drawing context encapsulates the drawing context of the underlying OS. It implements the drawing functions.


Constructor & Destructor Documentation

CDrawContext::CDrawContext CFrame inFrame,
void *  inSystemContext,
void *  inWindow = 0
 

CDrawContext constructor.

Parameters:
inFrame the parent CFrame
inSystemContext the platform system context, can be NULL
inWindow the platform window object

CDrawContext::~CDrawContext  )  [virtual]
 


Member Function Documentation

void CDrawContext::drawArc const CRect rect,
const CPoint point1,
const CPoint point2
 

draw a stroked arc between point1 and point2

void CDrawContext::drawArc const CRect rect,
const float  startAngle1,
const float  endAngle2,
const CDrawStyle  drawStyle = kDrawStroked
 

draw a stroked arc, where the angles are in degree

void CDrawContext::drawEllipse const CRect rect,
const CDrawStyle  drawStyle = kDrawStroked
 

draw an ellipse

void CDrawContext::drawLines const CPoint points,
const long &  numberOfLines
 

draw multiple lines at once

void CDrawContext::drawPoint const CPoint point,
CColor  color
 

draw a point

void CDrawContext::drawPolygon const CPoint pPoints,
long  numberOfPoints,
const CDrawStyle  drawStyle = kDrawStroked
 

draw a polygon

void CDrawContext::drawRect const CRect rect,
const CDrawStyle  drawStyle = kDrawStroked
 

draw a stroked rect

void CDrawContext::drawString const char *  pString,
const CRect rect,
const short  opaque = false,
const CHoriTxtAlign  hAlign = kCenterText
 

draw a string

void CDrawContext::fillArc const CRect rect,
const CPoint point1,
const CPoint point2
 

draw a filled arc between point1 and point2

void CDrawContext::fillEllipse const CRect rect  ) 
 

draw a filled ellipse

void CDrawContext::fillPolygon const CPoint pPoint,
long  numberOfPoints
 

draw a filled polygon

void CDrawContext::fillRect const CRect rect  ) 
 

draw a filled rect

void CDrawContext::floodFill const CPoint start  ) 
 

Deprecated:

void CDrawContext::forget  )  [virtual]
 

Reimplemented from CReferenceCounter.

CRect& CDrawContext::getClipRect CRect clip  )  const [inline]
 

get the current clip

CDrawMode CDrawContext::getDrawMode  )  const [inline]
 

get the current draw mode, see CDrawMode

CColor CDrawContext::getFillColor  )  const [inline]
 

get current fill color

CFont CDrawContext::getFont  )  const [inline]
 

get current font

CColor CDrawContext::getFontColor  )  const [inline]
 

get current font color

long CDrawContext::getFontSize  )  const [inline]
 

get current font size

CFrame* CDrawContext::getFrame  )  const [inline]
 

CColor CDrawContext::getFrameColor  )  const [inline]
 

get current stroke color

CLineStyle CDrawContext::getLineStyle  )  const [inline]
 

get the current line style

CCoord CDrawContext::getLineWidth  )  const [inline]
 

get the current line width

void CDrawContext::getLoc CPoint where  )  const [inline]
 

long CDrawContext::getMouseButtons  ) 
 

get current mouse buttons

void CDrawContext::getMouseLocation CPoint point  ) 
 

get current mouse location. should not be used, see CView::getMouseLocation

CColor CDrawContext::getPoint const CPoint point  ) 
 

Deprecated:

CCoord CDrawContext::getStringWidth const char *  pStr  ) 
 

get the width of a string

void* CDrawContext::getSystemContext  )  const [inline]
 

void* CDrawContext::getWindow  )  [inline]
 

void CDrawContext::lineTo const CPoint point  ) 
 

draw a line from current position to point

void CDrawContext::moveTo const CPoint point  ) 
 

move line position to point

void CDrawContext::polyLine const CPoint pPoint,
long  numberOfPoints
 

draw a stroked polygon

void CDrawContext::resetClipRect  ) 
 

reset the clip to the default state

void CDrawContext::setClipRect const CRect clip  ) 
 

set the current clip

void CDrawContext::setDrawMode CDrawMode  mode  ) 
 

set the current draw mode, see CDrawMode

void CDrawContext::setFillColor const CColor  color  ) 
 

set current fill color

void CDrawContext::setFont CFont  fontID,
const long  size = 0,
long  style = 0
 

set current font

void CDrawContext::setFontColor const CColor  color  ) 
 

set current font color

void CDrawContext::setFrameColor const CColor  color  ) 
 

set current stroke color

void CDrawContext::setLineStyle CLineStyle  style  ) 
 

set the current line style

void CDrawContext::setLineWidth CCoord  width  ) 
 

set the current line width

void CDrawContext::setWindow void *  ptr  )  [inline]
 

bool CDrawContext::waitDoubleClick  ) 
 

check if another mouse click occurs in the near future

bool CDrawContext::waitDrag  ) 
 

check if the mouse will be dragged


Friends And Related Function Documentation

friend class CBitmap [friend]
 

friend class COffscreenContext [friend]
 


Member Data Documentation

CRect CDrawContext::clipRect [protected]
 

CDrawMode CDrawContext::drawMode [protected]
 

CColor CDrawContext::fillColor [protected]
 

CColor CDrawContext::fontColor [protected]
 

CFont CDrawContext::fontId [protected]
 

long CDrawContext::fontSize [protected]
 

long CDrawContext::fontStyle [protected]
 

CColor CDrawContext::frameColor [protected]
 

CCoord CDrawContext::frameWidth [protected]
 

CLineStyle CDrawContext::lineStyle [protected]
 

CPoint CDrawContext::offset
 

CPoint CDrawContext::offsetScreen
 

CPoint CDrawContext::penLoc [protected]
 

CFrame* CDrawContext::pFrame [protected]
 

void* CDrawContext::pSystemContext [protected]
 

void* CDrawContext::pWindow [protected]
 


The documentation for this class was generated from the following files: Empty

Copyright ©2006 Steinberg Media Technologies. All Rights Reserved.