- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Exponent::GUI::Controls::CControlRoot Class Reference

Inheritance diagram for Exponent::GUI::Controls::CControlRoot:

List of all members.

## Detailed Description

Implementaton to an control root (control container).

Date:
  24/03/2005

Author:
  Paul Chana

Version:
  1.0.0 Initial version

  1.0.1 Added isControlAttatched function

Note:
  All contents of this source code are copyright 2005 Exp Digital Uk.
  This source file is covered by the licence conditions of the Infinity API. You should have recieved a copy
  with the source code. If you didnt, please refer to http://www.expdigital.co.uk All content is the Intellectual property of Exp Digital Uk.
  Certain sections of this code may come from other sources. They are credited where applicable.
  If you have comments, suggestions or bug reports please visit http://support.expdigital.co.uk

Id
  CControlRoot.hpp,v 1.6 2007/02/27 19:47:11 paul Exp

Definition at line 44 of file CControlRoot.hpp.

## Public Member Functions

- virtual void addControl (IControl *control)
- CControlRoot (IWindow *parent)
- virtual void clearControls ()
- virtual bool controlIsLocked () const
- virtual void drawRootControl (CGraphics &graphics)
- virtual IControl * getControlAtIndex (const long index, bool isIndex=true)
- virtual IControl * getControlAtPoint (const CPoint &point)
- virtual long getControlIndex (IControl *control)
- virtual IControl * getDropEnabledControlAtPoint (const CPoint &point)
- virtual void getGlobalCoordinatesOfControl (IControl *control, CPoint &point)
- virtual IControl * getKeyEnabledControlAtPoint (const CPoint &point)
- virtual const IControl * getLastUsedControl () const
- virtual IControl * getLockedControl () const
- virtual IControl * getMouseEnabledControlAtPoint (const CPoint &point)
- virtual long getNumberOfControls ()
- virtual long getNumberOfInsertedControls ()
- virtual IWindow * getParentWindow () const
- virtual void getWindowCoordinatesOfControl (IControl *control, CPoint &point)
- virtual CPoint getWindowOffset ()
- virtual void handleDoubleClick (CMouseEvent &event)
- virtual void handleFileDrop (const CDropEvent &event)
- virtual bool handleKeyDown (const CKeyboardEvent &event)
- virtual bool handleKeyUp (const CKeyboardEvent &event)
- virtual void handleLeftButtonDown (CMouseEvent &event)
- virtual void handleLeftButtonUp (CMouseEvent &event)
- virtual void handleMouseLeavingArea (CMouseEvent &event)
- virtual void handleMouseMovement (CMouseEvent &event)
- virtual void handleMouseScroll (CMouseEvent &event)
- virtual void handleRightButtonDown (CMouseEvent &event)
- virtual void handleRightButtonUp (CMouseEvent &event)
- virtual bool isControlAttatched (IControl *control)
- virtual void isVSTAttatched (const bool attatched=true)
- virtual void lockControl (IControl *control)
- virtual void removeControl (IControl *control)
- virtual void setBackgroundImage (IImage *image)
- virtual void setParentWindow (IWindow *parent)
- virtual void startToolTipTimer ()
- virtual void stopToolTipTimer ()
- virtual void unlockControl ()
- virtual void updateArea (const CRect &area)
- virtual void updateControl (const long index, bool isIndex)
- virtual void updateControl (IControl *control)
- virtual ~CControlRoot ()

## Protected Member Functions

- void postProcessMouseEvent (IControl *theControl)
- IControl * preProcessMouseEvent (CMouseEvent &event)

## Protected Attributes

- TCountedPointerArray< IControl > * m_controlArray
- IImage * m_controlRootBackgroundImage
- bool m_isVSTAttatched
- IControl * m_lastControl
- IControl * m_lockedControl
- CPoint m_originalPosition
- IWindow * m_parentWindow
- CMouseEvent m_subMouseEvent

## Constructor & Destructor Documentation

Exponent::GUI::Controls::CControlRoot::CControlRoot | ( | IWindow * | parent | ) |

Construction

Parameters:

  | parent | The window that this control root is attatched to

virtual Exponent::GUI::Controls::CControlRoot::~CControlRoot | ( |  | ) | `[virtual]`

Destruction

## Member Function Documentation

virtual void Exponent::GUI::Controls::CControlRoot::addControl | ( | IControl * | control | ) | `[virtual]`

Add a control

Parameters:

  | control | A control that becomes a child of this

Implements Exponent::GUI::Controls::IControlRoot.

Reimplemented in Exponent::GUI::Controls::CControlPanel.

virtual void Exponent::GUI::Controls::CControlRoot::clearControls | ( |  | ) | `[virtual]`

Remove all controls

See also:
  removeControl

Implements Exponent::GUI::Controls::IControlRoot.

virtual bool Exponent::GUI::Controls::CControlRoot::controlIsLocked | ( |  | ) | const`[virtual]`

Is there a control locked

Return values:

  | bool | True if a control is locked

Implements Exponent::GUI::Controls::IControlRoot.

virtual void Exponent::GUI::Controls::CControlRoot::drawRootControl | ( | CGraphics & | graphics | ) | `[virtual]`

Draw the root control

Parameters:

  | graphics | The graphics context

Reimplemented in Exponent::GUI::Controls::CControlPanel.

virtual IControl* Exponent::GUI::Controls::CControlRoot::getControlAtIndex | ( | const long | index,
|  | bool | isIndex = `true` |
| ) |  |  | `[virtual]`

Get a control at a specific index or uniqueId

Parameters:

  | index | The index of the control within the array or if isIndex is false then matches the unique id of the control
  | isIndex | If true then index is treated as an index, if is false then index is treated as control id

See also:
  IControl::getUniqueId()

Return values:

  | IControl* | The control or NULL on error

Implements Exponent::GUI::Controls::IControlRoot.

virtual IControl* Exponent::GUI::Controls::CControlRoot::getControlAtPoint | ( | const CPoint & | point | ) | `[virtual]`

Get the control at this point (point is relative to this' top left)

Parameters:

  | point | The point to check at

Return values:

  | IControl* | The control, or NULL on error or none

Implements Exponent::GUI::Controls::IControlRoot.

virtual long Exponent::GUI::Controls::CControlRoot::getControlIndex | ( | IControl * | control | ) | `[virtual]`

Get the index of a control

Return values:

  | long | The index of the control passed, or TPOINTERCOLLECTION_FAILED_TO_FIND_POINTER if not found

See also:
  TCountedPointerArray

  TPointerCollection

Implements Exponent::GUI::Controls::IControlRoot.

virtual IControl* Exponent::GUI::Controls::CControlRoot::getDropEnabledControlAtPoint | ( | const CPoint & | point | ) | `[virtual]`

Get he control at this point, checks for drop file enabling

Parameters:

  | point | The point to check at

Return values:

  | IControl* | The control, or NULL on error or none

Implements Exponent::GUI::Controls::IControlRoot.

virtual void Exponent::GUI::Controls::CControlRoot::getGlobalCoordinatesOfControl | ( | IControl * | control,
|  | CPoint & | point |
| ) |  |  | `[virtual]`

Get the global location of the control

Parameters:

  | control | The control to get the global coordinates of
  | point | On return contains the global position of the control

Implements Exponent::GUI::Controls::IControlRoot.

Reimplemented in Exponent::GUI::Controls::CControlPanel.

virtual IControl* Exponent::GUI::Controls::CControlRoot::getKeyEnabledControlAtPoint | ( | const CPoint & | point | ) | `[virtual]`

Get the key enabled control at this point, checks for key handling

Parameters:

  | point | The point to check at

Return values:

  | IControl* | The control, or NULL on error or none

Implements Exponent::GUI::Controls::IControlRoot.

virtual const IControl* Exponent::GUI::Controls::CControlRoot::getLastUsedControl | ( |  | ) | const`[inline, virtual]`

Get the last used control

Return values:

  | const | IControl* The last control that sucessfully receieved mouse commands

Definition at line 201 of file CControlRoot.hpp.

References m_lastControl.

virtual IControl* Exponent::GUI::Controls::CControlRoot::getLockedControl | ( |  | ) | const`[virtual]`

Get the locked control

Return values:

  | IControl* | The locked control or NULL

Implements Exponent::GUI::Controls::IControlRoot.

virtual IControl* Exponent::GUI::Controls::CControlRoot::getMouseEnabledControlAtPoint | ( | const CPoint & | point | ) | `[virtual]`

Get the control at this point, checks for mouse enabling

Parameters:

  | point | The point to check at

Return values:

  | IControl* | The control, or NULL on error or none

Implements Exponent::GUI::Controls::IControlRoot.

virtual long Exponent::GUI::Controls::CControlRoot::getNumberOfControls | ( |  | ) | `[virtual]`

Get the number of controls embedded in this root

Return values:

  | long | The number of controls embedded in this root

Implements Exponent::GUI::Controls::IControlRoot.

virtual long Exponent::GUI::Controls::CControlRoot::getNumberOfInsertedControls | ( |  | ) | `[virtual]`

Get the number of controls embedded in this root, actually inserted <= getNumberOfControls

Return values:

  | long | The array insert index

Implements Exponent::GUI::Controls::IControlRoot.

virtual IWindow* Exponent::GUI::Controls::CControlRoot::getParentWindow | ( |  | ) | const`[virtual]`

Get the parent window

Return values:

  | IWindow* | The parent window

Implements Exponent::GUI::Controls::IControlRoot.

virtual void Exponent::GUI::Controls::CControlRoot::getWindowCoordinatesOfControl | ( | IControl * | control,
|  | CPoint & | point |
| ) |  |  | `[virtual]`

Get the window (absoloute) position of a control

Parameters:

  | control | The control to find the absolute position of
  | point | The position of the control on return

Implements Exponent::GUI::Controls::IControlRoot.

Reimplemented in Exponent::GUI::Controls::CControlPanel, and Exponent::GUI::Controls::CScrollPanel.

virtual CPoint Exponent::GUI::Controls::CControlRoot::getWindowOffset | ( |  | ) | `[virtual]`

Get window offset

Return values:

  | CPoint | The window offset for this panel

Implements Exponent::GUI::Controls::IControlRoot.

Reimplemented in Exponent::GUI::Controls::CControlPanel, and Exponent::GUI::Controls::CScrollPanel.

virtual void Exponent::GUI::Controls::CControlRoot::handleDoubleClick | ( | CMouseEvent & | event | ) | `[virtual]`

Handle a double click on the left button

Parameters:

  | event | The event to handle

Implements Exponent::GUI::Listeners::IMouseListener.

virtual void Exponent::GUI::Controls::CControlRoot::handleFileDrop | ( | const CDropEvent & | event | ) | `[virtual]`

Handle a file drop

Parameters:

  | event | The event to handle

Reimplemented in Exponent::GUI::Controls::CControlPanel.

virtual bool Exponent::GUI::Controls::CControlRoot::handleKeyDown | ( | const CKeyboardEvent & | event | ) | `[virtual]`

Handle key down events

Parameters:

  | event | The event to handle

Reimplemented in Exponent::GUI::Controls::CControlPanel.

virtual bool Exponent::GUI::Controls::CControlRoot::handleKeyUp | ( | const CKeyboardEvent & | event | ) | `[virtual]`

Handle key up events

Parameters:

  | event | The event to handle

Reimplemented in Exponent::GUI::Controls::CControlPanel.

virtual void Exponent::GUI::Controls::CControlRoot::handleLeftButtonDown | ( | CMouseEvent & | event | ) | `[virtual]`

Handle left button being clicked

Parameters:

  | event | The event to handle

Implements Exponent::GUI::Listeners::IMouseListener.

virtual void Exponent::GUI::Controls::CControlRoot::handleLeftButtonUp | ( | CMouseEvent & | event | ) | `[virtual]`

Handle left button being released

Parameters:

  | event | The event to handle

Implements Exponent::GUI::Listeners::IMouseListener.

virtual void Exponent::GUI::Controls::CControlRoot::handleMouseLeavingArea | ( | CMouseEvent & | event | ) | `[virtual]`

Handle a mouse leaving movement

Parameters:

  | event | The event to handle

Implements Exponent::GUI::Listeners::IMouseListener.

virtual void Exponent::GUI::Controls::CControlRoot::handleMouseMovement | ( | CMouseEvent & | event | ) | `[virtual]`

Handle the mouse movement

Parameters:

  | event | The event to handle

Implements Exponent::GUI::Listeners::IMouseListener.

virtual void Exponent::GUI::Controls::CControlRoot::handleMouseScroll | ( | CMouseEvent & | event | ) | `[virtual]`

Handle the scroll wheel

Parameters:

  | event | The event to handle

Implements Exponent::GUI::Listeners::IMouseListener.

virtual void Exponent::GUI::Controls::CControlRoot::handleRightButtonDown | ( | CMouseEvent & | event | ) | `[virtual]`

Handle the right button being clicked

Parameters:

  | event | The event to handle

Implements Exponent::GUI::Listeners::IMouseListener.

virtual void Exponent::GUI::Controls::CControlRoot::handleRightButtonUp | ( | CMouseEvent & | event | ) | `[virtual]`

Handle the right button being released

Parameters:

  | event | The event to handle

Implements Exponent::GUI::Listeners::IMouseListener.

virtual bool Exponent::GUI::Controls::CControlRoot::isControlAttatched | ( | IControl * | control | ) | `[virtual]`

Is a certain control attatched?

Parameters:

  | control | The control to check if its attatched to this root

Return values:

  | bool | True if the control is attatched, false otherwise

virtual void Exponent::GUI::Controls::CControlRoot::isVSTAttatched | ( | const bool | attatched = `true` | ) | `[inline, virtual]`

Is attatched to VST window

Parameters:

  | attatched | True if this window is attatched to a VST window, false otherwise

Definition at line 109 of file CControlRoot.hpp.

References m_isVSTAttatched.

virtual void Exponent::GUI::Controls::CControlRoot::lockControl | ( | IControl * | control | ) | `[virtual]`

Lock a control (only this control recieves mouse info)

Parameters:

  | control | The control to feed all events to

Implements Exponent::GUI::Controls::IControlRoot.

Reimplemented in Exponent::GUI::Controls::CControlPanel.

void Exponent::GUI::Controls::CControlRoot::postProcessMouseEvent | ( | IControl * | theControl | ) | `[protected]`

Do all post processing on a mouse event

Parameters:

  | theControl | The control to post mouse event process

IControl* Exponent::GUI::Controls::CControlRoot::preProcessMouseEvent | ( | CMouseEvent & | event | ) | `[protected]`

Do all pre processing on a mouse event

Parameters:

  | event | The event to process

Return values:

  | IControl* | The control that should recieve the event or NULL if none

virtual void Exponent::GUI::Controls::CControlRoot::removeControl | ( | IControl * | control | ) | `[virtual]`

Remove a control

Parameters:

  | control | The control to remove from the child list

Implements Exponent::GUI::Controls::IControlRoot.

virtual void Exponent::GUI::Controls::CControlRoot::setBackgroundImage | ( | IImage * | image | ) | `[virtual]`

Set the background image

Parameters:

  | image | The image to use for the background of the root control

virtual void Exponent::GUI::Controls::CControlRoot::setParentWindow | ( | IWindow * | parent | ) | `[virtual]`

Set the parent window

Parameters:

  | parent | The parent window

virtual void Exponent::GUI::Controls::CControlRoot::startToolTipTimer | ( |  | ) | `[virtual]`

Start the timer to work out if the tool tip should fire up

Implements Exponent::GUI::Controls::IControlRoot.

virtual void Exponent::GUI::Controls::CControlRoot::stopToolTipTimer | ( |  | ) | `[virtual]`

Stop the tool tip timer from running

Implements Exponent::GUI::Controls::IControlRoot.

virtual void Exponent::GUI::Controls::CControlRoot::unlockControl | ( |  | ) | `[virtual]`

Unlock a control

See also:
  lockControl

Implements Exponent::GUI::Controls::IControlRoot.

Reimplemented in Exponent::GUI::Controls::CControlPanel.

virtual void Exponent::GUI::Controls::CControlRoot::updateArea | ( | const CRect & | area | ) | `[virtual]`

Update an area

Parameters:

  | area | The area to update relative to our top left

Implements Exponent::GUI::Controls::IControlRoot.

Reimplemented in Exponent::GUI::Controls::CControlPanel, and Exponent::GUI::Controls::CScrollPanel.

virtual void Exponent::GUI::Controls::CControlRoot::updateControl | ( | const long | index,
|  | bool | isIndex |
| ) |  |  | `[virtual]`

Update (redraw) a control at a specific index, or with a specific id if isIndex = false

Parameters:

  | index | The index of the control within the array or if isIndex is false then matches the unique id of the control
  | isIndex | If true then index is treated as an index, if is false then index is treated as control id

See also:
  IControl::getUniqueId()

Implements Exponent::GUI::Controls::IControlRoot.

virtual void Exponent::GUI::Controls::CControlRoot::updateControl | ( | IControl * | control | ) | `[virtual]`

Update (redraw) a control

Parameters:

  | control | The control to redraw

Implements Exponent::GUI::Controls::IControlRoot.

Reimplemented in Exponent::GUI::Controls::CControlPanel, and Exponent::GUI::Controls::CScrollPanel.

## Member Data Documentation

TCountedPointerArray<IControl>* Exponent::GUI::Controls::CControlRoot::m_controlArray`[protected]`

The array of child controls

Definition at line 365 of file CControlRoot.hpp.

Referenced by Exponent::GUI::Controls::CRadioButton::getButtons().

IImage* Exponent::GUI::Controls::CControlRoot::m_controlRootBackgroundImage`[protected]`

The background image

Definition at line 368 of file CControlRoot.hpp.

bool Exponent::GUI::Controls::CControlRoot::m_isVSTAttatched`[protected]`

Are we attatched to a VST window

Definition at line 372 of file CControlRoot.hpp.

Referenced by isVSTAttatched().

IControl* Exponent::GUI::Controls::CControlRoot::m_lastControl`[protected]`

The last control clicked

Definition at line 367 of file CControlRoot.hpp.

Referenced by getLastUsedControl().

IControl* Exponent::GUI::Controls::CControlRoot::m_lockedControl`[protected]`

The current control

Definition at line 366 of file CControlRoot.hpp.

CPoint Exponent::GUI::Controls::CControlRoot::m_originalPosition`[protected]`

The original position for mouse events

Definition at line 371 of file CControlRoot.hpp.

IWindow* Exponent::GUI::Controls::CControlRoot::m_parentWindow`[protected]`

The parent window

Definition at line 369 of file CControlRoot.hpp.

CMouseEvent Exponent::GUI::Controls::CControlRoot::m_subMouseEvent`[protected]`

The sub mouse event

Definition at line 370 of file CControlRoot.hpp.