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

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

# Exponent::GUI::Controls::IControl Interface Reference

Inheritance diagram for Exponent::GUI::Controls::IControl:

List of all members.

## Detailed Description

Interface to a control.

Controls are leightweight classes that can draw themselves and can handle input from various sources (depending on what listener you register as)
Each control has several key function and attributes:

- Each control has a unique idnetifier. This must be unique within this controls root control. This is how you know which control is sending which event (unless the event includes a reference to the control as
  See also:
    CActionEvent)
- Each control must be seated inside a control root of some type.
  See also:
    IControlRoot
- Controls have a value. This value is a double precision floating point number which should be in the range of 0 - 1
- Controls have an area. This area is relative to their parents top left, so an area of 0,0,100,100 would place a square control (100px in size) in the top left of its parent
- Controls can force themselves to be redrawn using the update call

See also:
  CGraphics

  IControlRoot

  CControl

Date:
  19/03/2005

Author:
  Paul Chana

Version:
  1.0.0 Initial version

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
  IControl.hpp,v 1.7 2007/02/08 21:07:54 paul Exp

Definition at line 66 of file IControl.hpp.

## Public Member Functions

- virtual void controlIsDropFileEnabled (const bool dropEnabled=true)=0
- virtual void controlIsEnabledFor (const CString &identifier)=0
- virtual void controlIsKeyEnabled (const bool keyEnabled=true)=0
- virtual void controlIsMouseEnabled (const bool mouseEnabled=true)=0
- virtual void disableControl ()=0
- virtual void drawControl (CGraphics &graphics)=0
- virtual void enableControl ()=0
- virtual const CRect & getAbsoluteRect () const=0
- virtual const CRect & getArea () const=0
- virtual const CDimension & getDimension () const=0
- virtual IControl * getParentControl () const=0
- virtual IControlRoot * getRootControl () const=0
- virtual long getUniqueId () const=0
- virtual double getValue () const=0
- IControl ()
- virtual bool isContainer () const=0
- virtual bool isDropFileEnabled () const=0
- virtual bool isEnabledFor (const CString &identifier)=0
- virtual bool isKeyEnabled () const=0
- virtual bool isMouseEnabled () const=0
- virtual bool needsRightClick () const=0
- virtual void registerActionListener (IActionListener *listener)=0
- virtual bool serializeFromNode (CXMLNode &node)=0
- virtual bool serializeToNode (CXMLNode &node)=0
- virtual void setArea (const CRect &area)=0
- virtual void setControlRoot (IControlRoot *controlRoot)=0
- virtual void setDisabledImage (IImage *theImage)=0
- virtual void setParentControl (IControl *parent)=0
- virtual void setPrimaryImage (IImage *theImage)=0
- virtual void setUniqueId (const long id)=0
- virtual void setValue (const double value)=0
- virtual void update ()=0
- virtual ~IControl ()

## Constructor & Destructor Documentation

Exponent::GUI::Controls::IControl::IControl | ( |  | ) | `[inline]`

Construction

Definition at line 78 of file IControl.hpp.

virtual Exponent::GUI::Controls::IControl::~IControl | ( |  | ) | `[inline, virtual]`

Destruction

Definition at line 83 of file IControl.hpp.

## Member Function Documentation

virtual void Exponent::GUI::Controls::IControl::controlIsDropFileEnabled | ( | const bool | dropEnabled = `true` | ) | `[pure virtual]`

Does the control accept dropped files?

Parameters:

  | dropEnabled | True if the control accepts dropped file messages, false otherwise

Implemented in Exponent::GUI::Controls::CControl.

virtual void Exponent::GUI::Controls::IControl::controlIsEnabledFor | ( | const CString & | identifier | ) | `[pure virtual]`

Reserved for Future use

Parameters:

  | identifier | The identifier of the control that this control is enabled for

Implemented in Exponent::GUI::Controls::CControl.

virtual void Exponent::GUI::Controls::IControl::controlIsKeyEnabled | ( | const bool | keyEnabled = `true` | ) | `[pure virtual]`

Does the control accept key messages

Parameters:

  | keyEnabled | True if the control accepts keyboard messages, false otherwise

Implemented in Exponent::GUI::Controls::CControl.

virtual void Exponent::GUI::Controls::IControl::controlIsMouseEnabled | ( | const bool | mouseEnabled = `true` | ) | `[pure virtual]`

Does the control accept mouse messages?

Parameters:

  | mouseEnabled | True if the control accepts mouse messages, false otherwise

Implemented in Exponent::GUI::Controls::CControl.

virtual void Exponent::GUI::Controls::IControl::disableControl | ( |  | ) | `[pure virtual]`

Disable the control

Implemented in Exponent::GUI::Controls::CControl, and Exponent::GUI::Controls::CControlPanel.

virtual void Exponent::GUI::Controls::IControl::drawControl | ( | CGraphics & | graphics | ) | `[pure virtual]`

Draw the controls

Parameters:

  | graphics | The graphics context

See also:
  CControl::drawControl

virtual void Exponent::GUI::Controls::IControl::enableControl | ( |  | ) | `[pure virtual]`

Enable a control

Implemented in Exponent::GUI::Controls::CControl, and Exponent::GUI::Controls::CControlPanel.

virtual const CRect& Exponent::GUI::Controls::IControl::getAbsoluteRect | ( |  | ) | const`[pure virtual]`

Get the position on the window

Note:
  The returned position may not be the complete area of the control, ie it may be clipped or otherwise
  altered. This function is mainly included for root control use and is *not* recommended for internal control
  use, except in exceptional circumstance.

See also:
  IControlRoot::getGlobalCoordinatesOfControl

  IControlRoot::getWindowCoordinatesOfControl

Return values:

  | const | CRect& The absolute rectangle of the control - ie the actual on screen position fully adjusted

Implemented in Exponent::GUI::Controls::CControl.

virtual const CRect& Exponent::GUI::Controls::IControl::getArea | ( |  | ) | const`[pure virtual]`

Get the position relative to their root

Return values:

  | const | CRect& The controls area relative to the root control

Implemented in Exponent::GUI::Controls::CControl.

virtual const CDimension& Exponent::GUI::Controls::IControl::getDimension | ( |  | ) | const`[pure virtual]`

Get the size of the control

Return values:

  | const | CDimension& The dimension of the control

Implemented in Exponent::GUI::Controls::CControl.

virtual IControl* Exponent::GUI::Controls::IControl::getParentControl | ( |  | ) | const`[pure virtual]`

Get the parent control

Return values:

  | IControl* | The parent control

Implemented in Exponent::GUI::Controls::CControl.

virtual IControlRoot* Exponent::GUI::Controls::IControl::getRootControl | ( |  | ) | const`[pure virtual]`

Get the root control

Return values:

  | IControlRoot* | The control root

Implemented in Exponent::GUI::Controls::CControl.

virtual long Exponent::GUI::Controls::IControl::getUniqueId | ( |  | ) | const`[pure virtual]`

Get the id of the control

Return values:

  | long | The unique control identifier

Implemented in Exponent::GUI::Controls::CControl.

virtual double Exponent::GUI::Controls::IControl::getValue | ( |  | ) | const`[pure virtual]`

Get the value of the control

Return values:

  | double | The value of the control (0 - 1 ranged)

Implemented in Exponent::GUI::Controls::CControl.

virtual bool Exponent::GUI::Controls::IControl::isContainer | ( |  | ) | const`[pure virtual]`

Is this control a container of other controls

Return values:

  | bool | True if the control is a control container, false otherwise

Implemented in Exponent::GUI::Controls::CControl, and Exponent::GUI::Controls::CControlPanel.

virtual bool Exponent::GUI::Controls::IControl::isDropFileEnabled | ( |  | ) | const`[pure virtual]`

Is the control drop enabled

Return values:

  | bool | True if the control can accept dropped files, false otherwise

Implemented in Exponent::GUI::Controls::CControl.

virtual bool Exponent::GUI::Controls::IControl::isEnabledFor | ( | const CString & | identifier | ) | `[pure virtual]`

Is the control enabled for (future use)

Parameters:

  | identifier | The identifier for the usage required.

Note:
  Not currently enabled, for future use only

Implemented in Exponent::GUI::Controls::CControl.

virtual bool Exponent::GUI::Controls::IControl::isKeyEnabled | ( |  | ) | const`[pure virtual]`

Is the control key enabled

Return values:

  | bool | True if the control can accept keyboard handling messages, false otherwise

Implemented in Exponent::GUI::Controls::CControl.

virtual bool Exponent::GUI::Controls::IControl::isMouseEnabled | ( |  | ) | const`[pure virtual]`

Is the control mouse enabled

Return values:

  | bool | True if control accepts mouse handling functionality, false otherwise

Implemented in Exponent::GUI::Controls::CControl.

virtual bool Exponent::GUI::Controls::IControl::needsRightClick | ( |  | ) | const`[pure virtual]`

Does the control require a right click feed?

Return values:

  | bool | True if the control needs right click information, false otherwise

Implemented in Exponent::GUI::Controls::CControl.

virtual void Exponent::GUI::Controls::IControl::registerActionListener | ( | IActionListener * | listener | ) | `[pure virtual]`

Register the action listener

Parameters:

  | listener | The action listener for this control

virtual bool Exponent::GUI::Controls::IControl::serializeFromNode | ( | CXMLNode & | node | ) | `[pure virtual]`

Serialise the control from a filename

Parameters:

  | node | The node that you should setup from

Return values:

  | bool | True if loaded from node properly, false otherwise

Note:
  FOR FUTURE USE, DO NOT USE YET!

virtual bool Exponent::GUI::Controls::IControl::serializeToNode | ( | CXMLNode & | node | ) | `[pure virtual]`

Serialise the control from a filename

Parameters:

  | node | The node that you should setup

Return values:

  | bool | True if saved to node properly, false otherwise

Note:
  FOR FUTURE USE, DO NOT USE YET!

virtual void Exponent::GUI::Controls::IControl::setArea | ( | const CRect & | area | ) | `[pure virtual]`

Set the area of the control

Parameters:

  | area | The are of the control relative to the root control

virtual void Exponent::GUI::Controls::IControl::setControlRoot | ( | IControlRoot * | controlRoot | ) | `[pure virtual]`

Set the root control that this control is sitting on

Parameters:

  | controlRoot | The root control

Implemented in Exponent::GUI::Controls::CControl, and Exponent::GUI::Controls::CControlPanel.

virtual void Exponent::GUI::Controls::IControl::setDisabledImage | ( | IImage * | theImage | ) | `[pure virtual]`

Set the disabled image

Parameters:

  | theImage | The disabled image for the control

virtual void Exponent::GUI::Controls::IControl::setParentControl | ( | IControl * | parent | ) | `[pure virtual]`

Set the parent control

Parameters:

  | parent | The parent container control

Implemented in Exponent::GUI::Controls::CControl.

virtual void Exponent::GUI::Controls::IControl::setPrimaryImage | ( | IImage * | theImage | ) | `[pure virtual]`

Set the primary (usually background) image

Parameters:

  | theImage | The primary image for the control

virtual void Exponent::GUI::Controls::IControl::setUniqueId | ( | const long | id | ) | `[pure virtual]`

Set the id of the control

Parameters:

  | id | The unique id of the control

Implemented in Exponent::GUI::Controls::CControl.

virtual void Exponent::GUI::Controls::IControl::setValue | ( | const double | value | ) | `[pure virtual]`

Set the vlaue of the control

Parameters:

  | value | The value of the control (0 - 1 ranged)

Implemented in Exponent::GUI::Controls::CCenterSlider, Exponent::GUI::Controls::CControl, Exponent::GUI::Controls::CLatchingButton, Exponent::GUI::Controls::CLevelMeter, Exponent::GUI::Controls::CMomentaryButton, Exponent::GUI::Controls::CProgressBar, and Exponent::GUI::Controls::CSlider.

virtual void Exponent::GUI::Controls::IControl::update | ( |  | ) | `[pure virtual]`

Update the control (redraw it)

Implemented in Exponent::GUI::Controls::CControl.