VSTGUI  3.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
CView Class Reference

Base Class of all view objects. More...

#include <vstgui.h>

+ Inheritance diagram for CView:

Public Member Functions

virtual ~CView ()
 
virtual void setBackground (CBitmap *background)
 set the background image of this view More...
 
virtual CBitmapgetBackground () const
 get the background image of this view More...
 
virtual void setTransparency (bool val)
 set views transparent state More...
 
virtual bool getTransparency () const
 get views transparent state More...
 
virtual bool removed (CView *parent)
 view is removed from parent view More...
 
virtual bool attached (CView *parent)
 view is attached to a parent view More...
 
bool isAttached () const
 is view attached to a parentView More...
 
virtual bool isTypeOf (const char *s) const
 
virtual CViewnewCopy () const
 
CMessageResult notify (CBaseObject *sender, const char *message)
 
virtual void mouse (CDrawContext *pContext, CPoint &where, long buttons=-1)
 
virtual void getMouseLocation (CDrawContext *context, CPoint &point)
 
virtual void setParentView (CView *pParentView)
 
virtual void setFrame (CFrame *pParent)
 
virtual void getFrameTopLeftPos (CPoint &topLeft) const
 

Protected Attributes

CRect size
 
CRect mouseableArea
 
CFramepParentFrame
 
CViewpParentView
 
bool bDirty
 
bool bMouseEnabled
 
bool bTransparencyEnabled
 
bool bWantsFocus
 
bool bIsAttached
 
bool bVisible
 
long autosizeFlags
 
CBitmappBackground
 
CAttributeListEntry * pAttributeList
 

Reference Counting Methods

virtual void forget ()
 decrease refcount and delete object if refcount == 0 More...
 
virtual void remember ()
 increase refcount More...
 
long getNbReference () const
 get refcount More...
 

Constructor

 CView (const CRect &size)
 
 CView (const CView &view)
 

Draw and Update Methods

virtual void draw (CDrawContext *pContext)
 called if the view should draw itself More...
 
virtual void drawRect (CDrawContext *pContext, const CRect &updateRect)
 called if the view should draw itself More...
 
virtual bool checkUpdate (const CRect &updateRect) const
 
virtual bool isDirty () const
 check if view is dirty More...
 
virtual void setDirty (const bool val=true)
 set the view to dirty so that it is redrawn in the next idle. Thread Safe ! More...
 
virtual void invalidRect (const CRect rect)
 mark rect as invalid More...
 
virtual void invalid ()
 mark whole view as invalid More...
 
virtual void setVisible (bool state)
 set visibility state More...
 
bool isVisible () const
 get visibility state More...
 

Mouse Methods

virtual CMouseEventResult onMouseDown (CPoint &where, const long &buttons)
 called when a mouse down event occurs More...
 
virtual CMouseEventResult onMouseUp (CPoint &where, const long &buttons)
 called when a mouse up event occurs More...
 
virtual CMouseEventResult onMouseMoved (CPoint &where, const long &buttons)
 called when a mouse move event occurs More...
 
virtual CMouseEventResult onMouseEntered (CPoint &where, const long &buttons)
 called when the mouse enters this view More...
 
virtual CMouseEventResult onMouseExited (CPoint &where, const long &buttons)
 called when the mouse leaves this view More...
 
virtual bool hitTest (const CPoint &where, const long buttons=-1)
 check if where hits this view More...
 
virtual bool onWheel (const CPoint &where, const float &distance, const long &buttons)
 called if a mouse wheel event is happening over this view More...
 
virtual bool onWheel (const CPoint &where, const CMouseWheelAxis &axis, const float &distance, const long &buttons)
 called if a mouse wheel event is happening over this view More...
 
virtual void setMouseEnabled (const bool bEnable=true)
 turn on/off mouse usage for this view More...
 
virtual bool getMouseEnabled () const
 get the state of wheather this view uses the mouse or not More...
 
virtual void setMouseableArea (const CRect &rect)
 set the area in which the view reacts to the mouse More...
 
virtual CRectgetMouseableArea (CRect &rect) const
 get the area in which the view reacts to the mouse More...
 
virtual const CRectgetMouseableArea () const
 read only access to the mouseable area More...
 

Drag & Drop Methods

virtual bool onDrop (CDragContainer *drag, const CPoint &where)
 called if a drag is dropped onto this view More...
 
virtual void onDragEnter (CDragContainer *drag, const CPoint &where)
 called if a drag is entering this view More...
 
virtual void onDragLeave (CDragContainer *drag, const CPoint &where)
 called if a drag is leaving this view More...
 
virtual void onDragMove (CDragContainer *drag, const CPoint &where)
 called if a drag is moved inside this view More...
 

Keyboard Methods

virtual long onKeyDown (VstKeyCode &keyCode)
 called if a key down event occurs and this view has focus More...
 
virtual long onKeyUp (VstKeyCode &keyCode)
 called if a key up event occurs and this view has focus More...
 

View Size Methods

CCoord getHeight () const
 get the height of the view More...
 
CCoord getWidth () const
 get the width of the view More...
 
virtual void setViewSize (CRect &rect, bool invalid=true)
 set views size More...
 
virtual CRectgetViewSize (CRect &rect) const
 returns the current view size More...
 
virtual const CRectgetViewSize () const
 read only access to view size More...
 
virtual CRect getVisibleSize () const
 returns the visible size of the view More...
 
virtual void parentSizeChanged ()
 notification that one of the views parent has changed its size More...
 
virtual CPointframeToLocal (CPoint &point) const
 conversion from frame coordinates to local view coordinates More...
 
virtual CPointlocalToFrame (CPoint &point) const
 conversion from local view coordinates to frame coordinates More...
 
virtual void setAutosizeFlags (long flags)
 set autosize flags More...
 
virtual long getAutosizeFlags () const
 get autosize flags More...
 

Focus Methods

virtual void looseFocus ()
 called if view should loose focus More...
 
virtual void takeFocus ()
 called if view should take focus More...
 
virtual bool wantsFocus () const
 check if view supports focus More...
 
virtual void setWantsFocus (bool state)
 set focus support on/off More...
 

Attribute Methods

bool getAttributeSize (const CViewAttributeID id, long &outSize) const
 get the size of an attribute More...
 
bool getAttribute (const CViewAttributeID id, const long inSize, void *outData, long &outSize) const
 get an attribute More...
 
bool setAttribute (const CViewAttributeID id, const long inSize, const void *inData)
 set an attribute More...
 
bool removeAttribute (const CViewAttributeID id)
 remove an attribute More...
 

Parent Methods

CViewgetParentView () const
 get parent view More...
 
CFramegetFrame () const
 get frame More...
 
virtual VSTGUIEditorInterfacegetEditor () const
 get editor More...
 

Detailed Description

Base Class of all view objects.

Constructor & Destructor Documentation

CView ( const CRect size)
CView ( const CView view)
~CView ( )
virtual

Member Function Documentation

bool attached ( CView parent)
virtual

view is attached to a parent view

Parameters
parentparent view
Returns
true if view successfully attached to parent

Reimplemented in CViewContainer, CVuMeter, and CDataBrowser.

virtual bool checkUpdate ( const CRect updateRect) const
inlinevirtual
void draw ( CDrawContext pContext)
virtual
virtual void drawRect ( CDrawContext pContext,
const CRect updateRect 
)
inlinevirtual

called if the view should draw itself

Reimplemented in CFrame, and CViewContainer.

virtual void forget ( )
inlinevirtualinherited

decrease refcount and delete object if refcount == 0

Reimplemented in CDrawContext.

CPoint & frameToLocal ( CPoint point) const
virtual

conversion from frame coordinates to local view coordinates

Parameters
pointlocation
Returns
converted point

Reimplemented in CViewContainer.

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

get an attribute

Parameters
idthe ID of the Attribute
inSizethe size of the outData pointer
outDataa pointer where to copy the attribute data
outSizethe size in bytes which was copied into outData
Returns
true if attribute exists and outData was big enough. outSize and outData is valid then.
bool getAttributeSize ( const CViewAttributeID  id,
long &  outSize 
) const

get the size of an attribute

Parameters
idthe ID of the Attribute
outSizeon return the size of the attribute
Returns
true if attribute exists. outSize is valid then.
virtual long getAutosizeFlags ( ) const
inlinevirtual

get autosize flags

virtual CBitmap* getBackground ( ) const
inlinevirtual

get the background image of this view

VSTGUIEditorInterface * getEditor ( ) const
virtual

get editor

Reimplemented in CFrame.

CFrame* getFrame ( ) const
inline

get frame

void getFrameTopLeftPos ( CPoint topLeft) const
virtual
CCoord getHeight ( ) const
inline

get the height of the view

virtual CRect& getMouseableArea ( CRect rect) const
inlinevirtual

get the area in which the view reacts to the mouse

virtual const CRect& getMouseableArea ( ) const
inlinevirtual

read only access to the mouseable area

virtual bool getMouseEnabled ( ) const
inlinevirtual

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

void getMouseLocation ( CDrawContext context,
CPoint point 
)
virtual
long getNbReference ( ) const
inlineinherited

get refcount

CView* getParentView ( ) const
inline

get parent view

virtual bool getTransparency ( ) const
inlinevirtual

get views transparent state

virtual CRect& getViewSize ( CRect rect) const
inlinevirtual

returns the current view size

virtual const CRect& getViewSize ( ) const
inlinevirtual

read only access to view size

CRect getVisibleSize ( ) const
virtual

returns the visible size of the view

Returns
visible size of view
CCoord getWidth ( ) const
inline

get the width of the view

virtual bool hitTest ( const CPoint where,
const long  buttons = -1 
)
inlinevirtual

check if where hits this view

Reimplemented in CViewContainer, and CSplashScreen.

virtual void invalid ( )
inlinevirtual

mark whole view as invalid

Reimplemented in CFrame, and CViewContainer.

void invalidRect ( const CRect  rect)
virtual

mark rect as invalid

Parameters
rectrect to invalidate

Reimplemented in CFrame, and CViewContainer.

bool isAttached ( ) const
inline

is view attached to a parentView

virtual bool isDirty ( ) const
inlinevirtual

check if view is dirty

Reimplemented in CViewContainer, CAnimKnob, and CControl.

virtual bool isTypeOf ( const char *  s) const
inlinevirtual
bool isVisible ( ) const
inline

get visibility state

CPoint & localToFrame ( CPoint point) const
virtual

conversion from local view coordinates to frame coordinates

Parameters
pointlocation
Returns
converted point

Reimplemented in CViewContainer.

void looseFocus ( )
virtual

called if view should loose focus

Reimplemented in CViewContainer, COptionMenu, and CTextEdit.

void mouse ( CDrawContext pContext,
CPoint where,
long  buttons = -1 
)
virtual
virtual CView* newCopy ( ) const
inlinevirtual
CMessageResult notify ( CBaseObject sender,
const char *  message 
)
virtual
Parameters
sendermessage sender
messagemessage text
Returns
message handled or not. See CMessageResult

Reimplemented from CBaseObject.

Reimplemented in CViewContainer.

virtual void onDragEnter ( CDragContainer drag,
const CPoint where 
)
inlinevirtual

called if a drag is entering this view

Reimplemented in CViewContainer.

virtual void onDragLeave ( CDragContainer drag,
const CPoint where 
)
inlinevirtual

called if a drag is leaving this view

Reimplemented in CViewContainer.

virtual void onDragMove ( CDragContainer drag,
const CPoint where 
)
inlinevirtual

called if a drag is moved inside this view

Reimplemented in CViewContainer.

virtual bool onDrop ( CDragContainer drag,
const CPoint where 
)
inlinevirtual

called if a drag is dropped onto this view

Reimplemented in CViewContainer.

long onKeyDown ( VstKeyCode keyCode)
virtual

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

Parameters
keyCodekey code of pressed key
Returns
-1 if not handled and 1 if handled

Reimplemented in CFrame, CViewContainer, CSlider, and CKnob.

long onKeyUp ( VstKeyCode keyCode)
virtual

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

Parameters
keyCodekey code of pressed key
Returns
-1 if not handled and 1 if handled

Reimplemented in CFrame, and CViewContainer.

CMouseEventResult onMouseDown ( CPoint where,
const long &  buttons 
)
virtual

called when a mouse down event occurs

Parameters
wheremouse location of mouse down
buttonsbutton and modifier state
Returns
event result. see CMouseEventResult

Reimplemented in CFrame, CViewContainer, CSplashScreen, CKickButton, CSlider, CAutoAnimation, CMovieButton, CRockerSwitch, CHorizontalSwitch, CVerticalSwitch, CKnob, COptionMenu, CTextEdit, COnOffButton, and CScrollbar.

virtual CMouseEventResult onMouseEntered ( CPoint where,
const long &  buttons 
)
inlinevirtual

called when the mouse enters this view

virtual CMouseEventResult onMouseExited ( CPoint where,
const long &  buttons 
)
inlinevirtual

called when the mouse leaves this view

Reimplemented in CFrame.

CMouseEventResult onMouseMoved ( CPoint where,
const long &  buttons 
)
virtual

called when a mouse move event occurs

Parameters
wheremouse location of mouse move
buttonsbutton and modifier state
Returns
event result. see CMouseEventResult

Reimplemented in CFrame, CViewContainer, CKickButton, CSlider, CMovieButton, CRockerSwitch, CHorizontalSwitch, CVerticalSwitch, CKnob, and CScrollbar.

CMouseEventResult onMouseUp ( CPoint where,
const long &  buttons 
)
virtual

called when a mouse up event occurs

Parameters
wheremouse location of mouse up
buttonsbutton and modifier state
Returns
event result. see CMouseEventResult

Reimplemented in CFrame, CViewContainer, CKickButton, CSlider, CMovieButton, CRockerSwitch, CHorizontalSwitch, CVerticalSwitch, CKnob, and CScrollbar.

bool onWheel ( const CPoint where,
const float &  distance,
const long &  buttons 
)
virtual

called if a mouse wheel event is happening over this view

Parameters
wherelocation
distancewheel distance
buttonsbutton and modifier state
Returns
true if handled

Reimplemented in CFrame, CViewContainer, CSlider, CRockerSwitch, and CKnob.

bool onWheel ( const CPoint where,
const CMouseWheelAxis axis,
const float &  distance,
const long &  buttons 
)
virtual

called if a mouse wheel event is happening over this view

Parameters
wherelocation
axismouse wheel axis
distancewheel distance
buttonsbutton and modifier state
Returns
true if handled

Reimplemented in CFrame, CViewContainer, CScrollbar, and CScrollView.

virtual void parentSizeChanged ( )
inlinevirtual

notification that one of the views parent has changed its size

Reimplemented in CViewContainer, and CTextEdit.

virtual void remember ( )
inlinevirtualinherited

increase refcount

bool removeAttribute ( const CViewAttributeID  id)

remove an attribute

bool removed ( CView parent)
virtual

view is removed from parent view

Parameters
parentparent view
Returns
true if view successfully removed from parent

Reimplemented in CViewContainer, and CVuMeter.

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

set an attribute

copies data into the attribute. If it does not exist, creates a new attribute.

Parameters
idthe ID of the Attribute
inSizethe size of the outData pointer
inDataa pointer to the data
Returns
true if attribute was set
virtual void setAutosizeFlags ( long  flags)
inlinevirtual

set autosize flags

void setBackground ( CBitmap background)
virtual

set the background image of this view

Parameters
backgroundnew background bitmap
virtual void setDirty ( const bool  val = true)
inlinevirtual

set the view to dirty so that it is redrawn in the next idle. Thread Safe !

Reimplemented in CVuMeter, and CControl.

virtual void setFrame ( CFrame pParent)
inlinevirtual
virtual void setMouseableArea ( const CRect rect)
inlinevirtual

set the area in which the view reacts to the mouse

virtual void setMouseEnabled ( const bool  bEnable = true)
inlinevirtual

turn on/off mouse usage for this view

virtual void setParentView ( CView pParentView)
inlinevirtual
virtual void setTransparency ( bool  val)
inlinevirtual

set views transparent state

Reimplemented in CScrollView.

void setViewSize ( CRect newSize,
bool  invalid = true 
)
virtual

set views size

Parameters
newSizerect of new size of view
invalidif true set view dirty

Reimplemented in CFrame, CViewContainer, CSlider, CTextEdit, CScrollbar, CScrollView, and CTabView.

void setVisible ( bool  state)
virtual

set visibility state

virtual void setWantsFocus ( bool  state)
inlinevirtual

set focus support on/off

void takeFocus ( )
virtual

called if view should take focus

Reimplemented in CViewContainer, COptionMenu, and CTextEdit.

virtual bool wantsFocus ( ) const
inlinevirtual

check if view supports focus

Member Data Documentation

long autosizeFlags
protected
bool bDirty
protected
bool bIsAttached
protected
bool bMouseEnabled
protected
bool bTransparencyEnabled
protected
bool bVisible
protected
bool bWantsFocus
protected
CRect mouseableArea
protected
CAttributeListEntry* pAttributeList
protected
CBitmap* pBackground
protected
CFrame* pParentFrame
protected
CView* pParentView
protected
CRect size
protected

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