- Main Page
- Classes
- Files
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# CView Class Reference

`#include <vstgui.h>`

Inheritance diagram for CView:

List of all members.

## Public Member Functions
| CView (const CRect &size)
virtual | ~CView ()
virtual void | draw (CDrawContext *pContext)
| called if the view should draw itself
virtual void | drawRect (CDrawContext *pContext, const CRect &updateRect)
| called if the view should draw itself
virtual bool | checkUpdate (CRect &updateRect) const
virtual void | mouse (CDrawContext *pContext, CPoint &where, long buttons=-1)
| called if a mouse click event occurs
virtual void | setBackground (CBitmap *background)
| set the background image of this view
virtual CBitmap * | getBackground () const
| get the background image of this view
virtual long | onKeyDown (VstKeyCode &keyCode)
| called if a key down event occurs and this view has focus
virtual long | onKeyUp (VstKeyCode &keyCode)
| called if a key up event occurs and this view has focus
virtual bool | onWheel (CDrawContext *pContext, const CPoint &where, float distance)
| called if a mouse wheel event is happening over this view
virtual bool | onWheel (CDrawContext *pContext, const CPoint &where, const CMouseWheelAxis axis, float distance)
| called if a mouse wheel event is happening over this view
virtual bool | onDrop (CDrawContext *context, CDragContainer *drag, const CPoint &where)
| called if a drag is dropped onto this view
virtual void | onDragEnter (CDrawContext *context, CDragContainer *drag, const CPoint &where)
| called if a drag is entering this view
virtual void | onDragLeave (CDrawContext *context, CDragContainer *drag, const CPoint &where)
| called if a drag is leaving this view
virtual void | onDragMove (CDrawContext *context, CDragContainer *drag, const CPoint &where)
| called if a drag is current moved over this view
virtual void | looseFocus (CDrawContext *pContext=0)
| called if view should loose focus
virtual void | takeFocus (CDrawContext *pContext=0)
| called if view should take focus
virtual bool | isDirty () const
| check if view is dirty
virtual void | setDirty (const bool val=true)
| set the view to dirty so that it is redrawn in the next idle. Thread Safe !
virtual void | setMouseEnabled (const bool bEnable=true)
| turn on/off mouse usage for this view
virtual bool | getMouseEnabled () const
| get the state of wheather this view uses the mouse or not
virtual void | setMouseableArea (const CRect &rect)
| set the area in which the view reacts to the mouse
virtual CRect & | getMouseableArea (CRect &rect) const
| get the area in which the view reacts to the mouse
virtual bool | hitTest (const CPoint &where, const long buttons=-1)
| check if where hits this view
virtual void | setTransparency (bool val)
| set views transparent state
virtual bool | getTransparency () const
| is view transparent ?
CCoord | getHeight () const
| get the height of the view
CCoord | getWidth () const
| get the width of the view
virtual void | setViewSize (CRect &rect)
| set views size
virtual CRect & | getViewSize (CRect &rect) const
| returns the current view size
virtual bool | removed (CView *parent)
| view is removed from parent view
virtual bool | attached (CView *view)
| view is attached to a parent view
virtual void | getMouseLocation (CDrawContext *context, CPoint &point)
| get current mouse location in local view coordinates
virtual CPoint & | frameToLocal (CPoint &point) const
| conversion from frame coordinates to local view coordinates
virtual CPoint & | localToFrame (CPoint &point) const
| conversion from local view coordinates to frame coordinates
bool | getAttributeSize (const CViewAttributeID id, long &outSize) const
| get the size of an attribute
bool | getAttribute (const CViewAttributeID id, const long inSize, void *outData, long &outSize) const
| get an attribute
bool | setAttribute (const CViewAttributeID id, const long inSize, void *inData)
| set an attribute
CView * | getParentView () const
CFrame * | getFrame () const
virtual void * | getEditor () const
virtual long | notify (CView *sender, const char *message)
void | redraw ()
virtual void | redrawRect (CDrawContext *context, const CRect &rect)
virtual bool | wantsFocus () const
| check if view supports focus
virtual void | setWantsFocus (bool state)
| set focus support on/off
virtual bool | isTypeOf (const char *s) const
## Protected Member Functions
virtual void | update (CDrawContext *pContext)
## Protected Attributes
CRect | size
CRect | mouseableArea
CFrame * | pParentFrame
CView * | pParentView
bool | bDirty
bool | bMouseEnabled
bool | bTransparencyEnabled
bool | bWantsFocus
CBitmap * | pBackground
CAttributeListEntry * | pAttributeList
## Friends
class | CControl
class | CFrame
class | CViewContainer

## Detailed Description

base class of all view objects

## Constructor & Destructor Documentation

CView::CView | ( | const CRect & | size | ) |

CView::~CView | ( |  | ) | `[virtual]`

## Member Function Documentation

virtual bool CView::attached | ( | CView * | view | ) | `[inline, virtual]`

| view is attached to a parent view Reimplemented in CSlider, CVuMeter, and CViewContainer.

virtual bool CView::checkUpdate | ( | CRect & | updateRect | ) | const`[inline, virtual]`

void CView::draw | ( | CDrawContext * | pContext | ) | `[virtual]`

| called if the view should draw itself Reimplemented in CScrollbar, CTabButton, CSplashScreenView, CControl, COnOffButton, CParamDisplay, CTextLabel, CTextEdit, COptionMenu, CKnob, CAnimKnob, CVerticalSwitch, CHorizontalSwitch, CRockerSwitch, CMovieBitmap, CMovieButton, CAutoAnimation, CSlider, CSpecialDigit, CKickButton, CSplashScreen, CVuMeter, CViewContainer, and CFrame.

virtual void CView::drawRect | ( | CDrawContext * | pContext,
|  | const CRect & | updateRect
| ) | `[inline, virtual]`

| called if the view should draw itself Reimplemented in CViewContainer, and CFrame.

CPoint & CView::frameToLocal | ( | CPoint & | point | ) | const`[virtual]`

| conversion from frame coordinates to local view coordinates Reimplemented in CViewContainer.

bool CView::getAttribute | ( | const CViewAttributeID | id,
|  | const long | inSize,
|  | void * | outData,
|  | long & | outSize
| ) | const

  | get an attribute Parameters:
  | id | the ID of the Attribute
  | inSize | the size of the outData pointer
  | outData | a pointer where to copy the attribute data
  | outSize | the size in bytes which was copied into outData

bool CView::getAttributeSize | ( | const CViewAttributeID | id,
|  | long & | outSize
| ) | const

  | get the size of an attribute Parameters:
  | id | the ID of the Attribute
  | outSize | on return the size of the attribute

virtual CBitmap* CView::getBackground | ( |  | ) | const`[inline, virtual]`

| get the background image of this view

void * CView::getEditor | ( |  | ) | const`[virtual]`

| Reimplemented in CFrame.

CFrame* CView::getFrame | ( |  | ) | const`[inline]`

CCoord CView::getHeight | ( |  | ) | const`[inline]`

| get the height of the view

virtual CRect& CView::getMouseableArea | ( | CRect & | rect | ) | const`[inline, virtual]`

| get the area in which the view reacts to the mouse

virtual bool CView::getMouseEnabled | ( |  | ) | const`[inline, virtual]`

| get the state of wheather this view uses the mouse or not

void CView::getMouseLocation | ( | CDrawContext * | context,
|  | CPoint & | point
| ) | `[virtual]`

| get current mouse location in local view coordinates

CView* CView::getParentView | ( |  | ) | const`[inline]`

virtual bool CView::getTransparency | ( |  | ) | const`[inline, virtual]`

| is view transparent ?

virtual CRect& CView::getViewSize | ( | CRect & | rect | ) | const`[inline, virtual]`

| returns the current view size

CCoord CView::getWidth | ( |  | ) | const`[inline]`

| get the width of the view

virtual bool CView::hitTest | ( | const CPoint & | where,
|  | const long | buttons = `-1`
| ) | `[inline, virtual]`

| check if where hits this view Reimplemented in CSplashScreen, and CViewContainer.

virtual bool CView::isDirty | ( |  | ) | const`[inline, virtual]`

| check if view is dirty Reimplemented in CScrollContainer, CControl, CAnimKnob, and CViewContainer.

virtual bool CView::isTypeOf | ( | const char * | s | ) | const`[inline, virtual]`

CPoint & CView::localToFrame | ( | CPoint & | point | ) | const`[virtual]`

| conversion from local view coordinates to frame coordinates Reimplemented in CViewContainer.

void CView::looseFocus | ( | CDrawContext * | pContext = `0` | ) | `[virtual]`

| called if view should loose focus Reimplemented in CTextEdit, COptionMenu, and CViewContainer.

void CView::mouse | ( | CDrawContext * | pContext,
|  | CPoint & | where,
|  | long | buttons = `-1`
| ) | `[virtual]`

| called if a mouse click event occurs Reimplemented in CScrollbar, CTabButton, CSplashScreenView, COnOffButton, CTextEdit, COptionMenu, CKnob, CVerticalSwitch, CHorizontalSwitch, CRockerSwitch, CMovieButton, CAutoAnimation, CSlider, CKickButton, CSplashScreen, CViewContainer, and CFrame.

long CView::notify | ( | CView * | sender,
|  | const char * | message
| ) | `[virtual]`

| Reimplemented in CViewContainer.

virtual void CView::onDragEnter | ( | CDrawContext * | context,
|  | CDragContainer * | drag,
|  | const CPoint & | where
| ) | `[inline, virtual]`

| called if a drag is entering this view Reimplemented in CTabButton, and CViewContainer.

virtual void CView::onDragLeave | ( | CDrawContext * | context,
|  | CDragContainer * | drag,
|  | const CPoint & | where
| ) | `[inline, virtual]`

| called if a drag is leaving this view Reimplemented in CViewContainer.

virtual void CView::onDragMove | ( | CDrawContext * | context,
|  | CDragContainer * | drag,
|  | const CPoint & | where
| ) | `[inline, virtual]`

| called if a drag is current moved over this view Reimplemented in CViewContainer.

virtual bool CView::onDrop | ( | CDrawContext * | context,
|  | CDragContainer * | drag,
|  | const CPoint & | where
| ) | `[inline, virtual]`

| called if a drag is dropped onto this view Reimplemented in CViewContainer.

long CView::onKeyDown | ( | VstKeyCode & | keyCode | ) | `[virtual]`

| called if a key down event occurs and this view has focus Reimplemented in CKnob, CSlider, CViewContainer, and CFrame.

long CView::onKeyUp | ( | VstKeyCode & | keyCode | ) | `[virtual]`

| called if a key up event occurs and this view has focus Reimplemented in CViewContainer, and CFrame.

bool CView::onWheel | ( | CDrawContext * | pContext,
|  | const CPoint & | where,
|  | const CMouseWheelAxis | axis,
|  | float | distance
| ) | `[virtual]`

| called if a mouse wheel event is happening over this view Reimplemented in CScrollView, CViewContainer, and CFrame.

bool CView::onWheel | ( | CDrawContext * | pContext,
|  | const CPoint & | where,
|  | float | distance
| ) | `[virtual]`

| called if a mouse wheel event is happening over this view Reimplemented in CScrollbar, CKnob, CRockerSwitch, CSlider, CViewContainer, and CFrame.

void CView::redraw | ( |  | ) |

void CView::redrawRect | ( | CDrawContext * | context,
|  | const CRect & | rect
| ) | `[virtual]`

| Reimplemented in CScrollContainer, and CViewContainer.

virtual bool CView::removed | ( | CView * | parent | ) | `[inline, virtual]`

| view is removed from parent view Reimplemented in CSlider, CVuMeter, and CViewContainer.

bool CView::setAttribute | ( | const CViewAttributeID | id,
|  | const long | inSize,
|  | void * | inData
| ) |

  | set an attribute copies data into the attribute. If it does not exist, creates a new attribute. Parameters:
  | id | the ID of the Attribute
  | inSize | the size of the outData pointer
  | inData | a pointer to the data

void CView::setBackground | ( | CBitmap * | background | ) | `[virtual]`

| set the background image of this view

virtual void CView::setDirty | ( | const bool | val = `true` | ) | `[inline, virtual]`

| set the view to dirty so that it is redrawn in the next idle. Thread Safe ! Reimplemented in CControl, and CVuMeter.

virtual void CView::setMouseableArea | ( | const CRect & | rect | ) | `[inline, virtual]`

| set the area in which the view reacts to the mouse

virtual void CView::setMouseEnabled | ( | const bool | bEnable = `true` | ) | `[inline, virtual]`

| turn on/off mouse usage for this view

virtual void CView::setTransparency | ( | bool | val | ) | `[inline, virtual]`

| set views transparent state

void CView::setViewSize | ( | CRect & | rect | ) | `[virtual]`

| set views size Reimplemented in CViewContainer, and CFrame.

virtual void CView::setWantsFocus | ( | bool | state | ) | `[inline, virtual]`

| set focus support on/off

void CView::takeFocus | ( | CDrawContext * | pContext = `0` | ) | `[virtual]`

| called if view should take focus Reimplemented in CTextEdit, COptionMenu, and CViewContainer.

void CView::update | ( | CDrawContext * | pContext | ) | `[protected, virtual]`

| Reimplemented in CViewContainer, and CFrame.

virtual bool CView::wantsFocus | ( |  | ) | const`[inline, virtual]`

| check if view supports focus

## Friends And Related Function Documentation

friend class CControl`[friend]`

friend class CFrame`[friend]`

friend class CViewContainer`[friend]`

## Member Data Documentation

bool CView::bDirty`[protected]`

bool CView::bMouseEnabled`[protected]`

bool CView::bTransparencyEnabled`[protected]`

bool CView::bWantsFocus`[protected]`

CRect CView::mouseableArea`[protected]`

CAttributeListEntry* CView::pAttributeList`[protected]`

CBitmap* CView::pBackground`[protected]`

CFrame* CView::pParentFrame`[protected]`

CView* CView::pParentView`[protected]`

CRect CView::size`[protected]`

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

- vstgui.h
- vstgui.cpp

Empty

Copyright ©2006 Steinberg Media Technologies. All Rights Reserved.