CViewContainer Class Reference

Container Class of CView objects. More...

#include <vstgui.h>

Inheritance diagram for CViewContainer:

CView CReferenceCounter CFrame CScrollContainer CScrollView CTabView List of all members.

Public Types

enum  { kNormalUpdate = 0, kOnlyDirtyUpdate }

Public Member Functions

 CViewContainer (const CRect &size, CFrame *pParent, CBitmap *pBackground=0)
virtual ~CViewContainer ()
virtual void addView (CView *pView)
 add a child view
virtual void addView (CView *pView, CRect &mouseableArea, bool mouseEnabled=true)
 add a child view
virtual void removeView (CView *pView, const bool &withForget=true)
 remove a child view
virtual void removeAll (const bool &withForget=true)
 remove all child views
virtual bool isChild (CView *pView) const
 check if pView is a child view of this container
virtual long getNbViews () const
 get the number of child views
virtual CView * getView (long index) const
 get the child view at index
virtual void setBackgroundColor (const CColor color)
 set the background color (will only be drawn if this container is not set to transparent and does not have a background bitmap)
virtual CColor getBackgroundColor () const
 get the background color
virtual void setBackgroundOffset (const CPoint &p)
 set the offset of the background bitmap
virtual const CPoint & getBackgroundOffset () const
 get the offset of the background bitmap
virtual void drawBackgroundRect (CDrawContext *pContext, CRect &_updateRect)
 draw the background
virtual void setMode (long val)
 set the update mode
virtual long getMode () const
 get the update mode
virtual void useOffscreen (bool b)
 turn on/off using an offscreen
virtual CView * getCurrentView () const
 get the current view under the mouse
virtual CView * getViewAt (const CPoint &where, bool deep=false) const
 get the view at point where
void modifyDrawContext (CCoord save[4], CDrawContext *pContext)
void restoreDrawContext (CDrawContext *pContext, CCoord save[4])
virtual void draw (CDrawContext *pContext)
virtual void drawRect (CDrawContext *pContext, const CRect &updateRect)
virtual void mouse (CDrawContext *pContext, CPoint &where, long buttons=-1)
 called if a mouse click event occurs
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 void update (CDrawContext *pContext)
virtual bool hitTest (const CPoint &where, const long buttons=-1)
 check if where hits 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 long notify (CView *sender, const char *message)
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 advanceNextFocusView (CView *oldFocus, bool reverse=false)
virtual bool isDirty () const
 check if view is dirty
virtual void setViewSize (CRect &rect)
virtual bool removed (CView *parent)
 view is removed from parent view
virtual bool attached (CView *view)
 view is attached to a parent view
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
virtual void redrawRect (CDrawContext *context, const CRect &rect)

Protected Member Functions

bool hitTestSubViews (const CPoint &where, const long buttons=-1)

Protected Attributes

CCView * pFirstView
CCView * pLastView
long mode
COffscreenContext * pOffscreenContext
CColor backgroundColor
CPoint backgroundOffset
bool bDrawInOffscreen
CView * currentDragView

Detailed Description

Container Class of CView objects.


Member Enumeration Documentation

anonymous enum
 

Enumerator:
kNormalUpdate  this mode redraws the whole container if something is dirty
kOnlyDirtyUpdate  this mode only redraws the views which are dirty


Constructor & Destructor Documentation

CViewContainer::CViewContainer (  const CRect &  rect,
CFrame *  pParent,
CBitmap *  pBackground = 0
) 
 

CViewContainer constructor.

Parameters:
rect the size of the container
pParent the parent CFrame
pBackground the background bitmap, can be NULL

CViewContainer::~CViewContainer (   )  [virtual]
 


Member Function Documentation

void CViewContainer::addView (  CView *  pView,
CRect &  mouseableArea,
bool  mouseEnabled = true
)  [virtual]
 

add a child view

Parameters:
pView the view object to add to this container
mouseableArea the view area in where the view will get mouse events
mouseEnabled bool to set if view will get mouse events

void CViewContainer::addView (  CView *  pView  )  [virtual]
 

add a child view

Parameters:
pView the view object to add to this container

Reimplemented in CScrollView.

bool CViewContainer::advanceNextFocusView (  CView *  oldFocus,
bool  reverse = false
)  [virtual]
 

Reimplemented in CFrame.

bool CViewContainer::attached (  CView *  view  )  [virtual]
 

view is attached to a parent view

Reimplemented from CView.

void CViewContainer::draw (  CDrawContext *  pContext  )  [virtual]
 

Parameters:
pContext the context which to use to draw this container and its subviews

Reimplemented from CView.

Reimplemented in CFrame.

void CViewContainer::drawBackgroundRect (  CDrawContext *  pContext,
CRect &  _updateRect
)  [virtual]
 

draw the background

Parameters:
pContext the context which to use to draw the background
_updateRect the area which to draw

Reimplemented in CScrollView.

void CViewContainer::drawRect (  CDrawContext *  pContext,
const CRect &  _updateRect
)  [virtual]
 

Parameters:
pContext the context which to use to draw
_updateRect the area which to draw

Reimplemented from CView.

Reimplemented in CFrame.

CPoint & CViewContainer::frameToLocal (  CPoint &  point  )  const [virtual]
 

conversion from frame coordinates to local view coordinates

Reimplemented from CView.

virtual CColor CViewContainer::getBackgroundColor (   )  const [inline, virtual]
 

get the background color

virtual const CPoint& CViewContainer::getBackgroundOffset (   )  const [inline, virtual]
 

get the offset of the background bitmap

CView * CViewContainer::getCurrentView (   )  const [virtual]
 

get the current view under the mouse

Reimplemented in CFrame.

virtual long CViewContainer::getMode (   )  const [inline, virtual]
 

get the update mode

long CViewContainer::getNbViews (   )  const [virtual]
 

get the number of child views

CView * CViewContainer::getView (  long  index  )  const [virtual]
 

get the child view at index

Parameters:
index the index of the view to return

CView * CViewContainer::getViewAt (  const CPoint &  where,
bool  deep = false
)  const [virtual]
 

get the view at point where

bool CViewContainer::hitTest (  const CPoint &  where,
const long  buttons = -1
)  [virtual]
 

check if where hits this view

Reimplemented from CView.

bool CViewContainer::hitTestSubViews (  const CPoint &  where,
const long  buttons = -1
)  [protected]
 

bool CViewContainer::isChild (  CView *  pView  )  const [virtual]
 

check if pView is a child view of this container

Parameters:
pView the view which should be checked if it is a child of this container

bool CViewContainer::isDirty (   )  const [virtual]
 

check if view is dirty

Reimplemented from CView.

Reimplemented in CScrollContainer.

CPoint & CViewContainer::localToFrame (  CPoint &  point  )  const [virtual]
 

conversion from local view coordinates to frame coordinates

Reimplemented from CView.

void CViewContainer::looseFocus (  CDrawContext *  pContext = 0  )  [virtual]
 

called if view should loose focus

Reimplemented from CView.

void CViewContainer::modifyDrawContext (  CCoord  save[4],
CDrawContext *  pContext
) 
 

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

called if a mouse click event occurs

Reimplemented from CView.

Reimplemented in CFrame.

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

Reimplemented from CView.

void CViewContainer::onDragEnter (  CDrawContext *  context,
CDragContainer *  drag,
const CPoint &  where
)  [virtual]
 

called if a drag is entering this view

Reimplemented from CView.

void CViewContainer::onDragLeave (  CDrawContext *  context,
CDragContainer *  drag,
const CPoint &  where
)  [virtual]
 

called if a drag is leaving this view

Reimplemented from CView.

void CViewContainer::onDragMove (  CDrawContext *  context,
CDragContainer *  drag,
const CPoint &  where
)  [virtual]
 

called if a drag is current moved over this view

Reimplemented from CView.

bool CViewContainer::onDrop (  CDrawContext *  context,
CDragContainer *  drag,
const CPoint &  where
)  [virtual]
 

called if a drag is dropped onto this view

Reimplemented from CView.

long CViewContainer::onKeyDown (  VstKeyCode &  keyCode  )  [virtual]
 

called if a key down event occurs and this view has focus

Reimplemented from CView.

Reimplemented in CFrame.

long CViewContainer::onKeyUp (  VstKeyCode &  keyCode  )  [virtual]
 

called if a key up event occurs and this view has focus

Reimplemented from CView.

Reimplemented in CFrame.

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

called if a mouse wheel event is happening over this view

Reimplemented from CView.

Reimplemented in CScrollView, and CFrame.

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

called if a mouse wheel event is happening over this view

Reimplemented from CView.

Reimplemented in CFrame.

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

Parameters:
context the context which to use to redraw this container
rect the area which to redraw

Reimplemented from CView.

Reimplemented in CScrollContainer.

void CViewContainer::removeAll (  const bool &  withForget = true  )  [virtual]
 

remove all child views

Parameters:
withForget bool to indicate if the view's reference counter should be decreased after removed from the container

bool CViewContainer::removed (  CView *  parent  )  [virtual]
 

view is removed from parent view

Reimplemented from CView.

void CViewContainer::removeView (  CView *  pView,
const bool &  withForget = true
)  [virtual]
 

remove a child view

Parameters:
pView the view which should be removed from the container
withForget bool to indicate if the view's reference counter should be decreased after removed from the container

void CViewContainer::restoreDrawContext (  CDrawContext *  pContext,
CCoord  save[4]
) 
 

void CViewContainer::setBackgroundColor (  const CColor  color  )  [virtual]
 

set the background color (will only be drawn if this container is not set to transparent and does not have a background bitmap)

Parameters:
color the new background color of the container

virtual void CViewContainer::setBackgroundOffset (  const CPoint &  p  )  [inline, virtual]
 

set the offset of the background bitmap

virtual void CViewContainer::setMode (  long  val  )  [inline, virtual]
 

set the update mode

void CViewContainer::setViewSize (  CRect &  rect  )  [virtual]
 

Parameters:
rect the new size of the container

Reimplemented from CView.

Reimplemented in CFrame.

void CViewContainer::takeFocus (  CDrawContext *  pContext = 0  )  [virtual]
 

called if view should take focus

Reimplemented from CView.

void CViewContainer::update (  CDrawContext *  pContext  )  [virtual]
 

Reimplemented from CView.

Reimplemented in CFrame.

void CViewContainer::useOffscreen (  bool  b  )  [virtual]
 

turn on/off using an offscreen


Member Data Documentation

CColor CViewContainer::backgroundColor [protected]
 

CPoint CViewContainer::backgroundOffset [protected]
 

bool CViewContainer::bDrawInOffscreen [protected]
 

CView* CViewContainer::currentDragView [protected]
 

long CViewContainer::mode [protected]
 

CCView* CViewContainer::pFirstView [protected]
 

CCView* CViewContainer::pLastView [protected]
 

COffscreenContext* CViewContainer::pOffscreenContext [protected]
 


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

Copyright ©2006 Steinberg Media Technologies. All Rights Reserved.