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

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

# Exponent::GUI::Controls::CRangeSlider Class Reference

Inheritance diagram for Exponent::GUI::Controls::CRangeSlider:

List of all members.

## Detailed Description

A slider that allows you to change the top and bottom value as well as move the entire slider.

Date:
  17/04/2005

Author:
  Paul Chana

Version:
  1.0.0 Initial version

  1.0.1 Added Jump to max

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

Definition at line 40 of file CRangeSlider.hpp.

## Public Member Functions

- CRangeSlider (IControlRoot *root, const long uniqueId, const CRect &area, IActionListener *listener=NULL)
- virtual void drawControl (CGraphics &graphics)
- virtual double getMaximumValue () const
- virtual double getMinimumValue () const
- 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 lockPositions (const bool lockMin, const bool lockMax, const double minValue, const double maxValue, const bool jumpToMax=true)
- virtual void setColours (CAlphaColour frameColour, CAlphaColour backgroundColour, CAlphaColour handleColour, CAlphaColour handleOverColour, CAlphaColour handleDownColour)
- virtual void setMaximumValue (const double maxValue)
- virtual void setMinimumValue (const double minValue)
- virtual ~CRangeSlider ()

## Protected Types

- enum EDragId {
  e_notDragging = 0,
  e_draggingTop,
  e_draggingHandle,
  e_draggingBottom
  }
    What is being draggged? More...

## Protected Member Functions

- virtual void checkAndLock (const CPoint &point)
- bool handleBarMovement (CMouseEvent &event)
- bool handleBottomMovement (CMouseEvent &event)
- void handleMovement (CMouseEvent &event)
- bool handleTopMovement (CMouseEvent &event)

## Protected Attributes

- EDragId m_dragId
- CPoint m_grabOffset
- CAlphaColour m_handleColour
- CAlphaColour m_handleDownColour
- CAlphaColour m_handleOverColour
- bool m_isVertical
- bool m_jumpToMax
- bool m_lockMax
- bool m_lockMin
- double m_maxValue
- double m_minValue
- CRect m_sliderArea
- CRolloverButton::ERolloverState m_state

## Member Enumeration Documentation

enum Exponent::GUI::Controls::CRangeSlider::EDragId`[protected]`

What is being draggged?

Enumerator:

  e_notDragging | Nothing being dragged
  e_draggingTop | Top being dragged
  e_draggingHandle | Main bit being dragged
  e_draggingBottom | Bottom being dragged

Definition at line 162 of file CRangeSlider.hpp.

## Constructor & Destructor Documentation

Exponent::GUI::Controls::CRangeSlider::CRangeSlider | ( | IControlRoot * | root,
|  | const long | uniqueId,
|  | const CRect & | area,
|  | IActionListener * | listener = `NULL` |
| ) |  |  |

Construction

Parameters:

  | root | The root control that this control is being added to
  | uniqueId | The unique Identifier of this control or CCONTROL_NO_ID_REQUIRED if no id is required
  | area | The area of this control relative to the root controls top left
  | listener | The action listener

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

Destruction

## Member Function Documentation

virtual void Exponent::GUI::Controls::CRangeSlider::checkAndLock | ( | const CPoint & | point | ) | `[protected, virtual]`

Check if the area is rolled over and lock if necessary

Parameters:

  | point | The point to check

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

Draw the controls

Parameters:

  | graphics | The graphics context

Reimplemented from Exponent::GUI::Controls::CControl.

Reimplemented in Exponent::GUI::Controls::CModulatedSlider.

virtual double Exponent::GUI::Controls::CRangeSlider::getMaximumValue | ( |  | ) | const`[inline, virtual]`

Get the maximum value

Return values:

  | double | The maximum value of the slider

Definition at line 88 of file CRangeSlider.hpp.

References m_maxValue.

virtual double Exponent::GUI::Controls::CRangeSlider::getMinimumValue | ( |  | ) | const`[inline, virtual]`

Get the minimum value

Return values:

  | double | The minimum value of the slider

Definition at line 82 of file CRangeSlider.hpp.

References m_minValue.

bool Exponent::GUI::Controls::CRangeSlider::handleBarMovement | ( | CMouseEvent & | event | ) | `[protected]`

Handle movement in the handle

Parameters:

  | event | The event to handle

bool Exponent::GUI::Controls::CRangeSlider::handleBottomMovement | ( | CMouseEvent & | event | ) | `[protected]`

Handle movement in the bottom of the bar

Parameters:

  | event | The event to handle

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

Handle left button being clicked

Parameters:

  | event | The event to handle

Reimplemented from Exponent::GUI::Controls::CControl.

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

Handle left button being released

Parameters:

  | event | The event to handle

Reimplemented from Exponent::GUI::Controls::CControl.

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

Handle the mouse leaving the window area

Parameters:

  | event | The event to handle

Reimplemented from Exponent::GUI::Controls::CControl.

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

Handle the mouse movement

Parameters:

  | event | The event to handle

Reimplemented from Exponent::GUI::Controls::CControl.

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

Handle the scroll wheel

Parameters:

  | event | The event to handle

Reimplemented from Exponent::GUI::Controls::CControl.

void Exponent::GUI::Controls::CRangeSlider::handleMovement | ( | CMouseEvent & | event | ) | `[protected]`

Handle movement

Parameters:

  | event | The event to handle

bool Exponent::GUI::Controls::CRangeSlider::handleTopMovement | ( | CMouseEvent & | event | ) | `[protected]`

Handle movement in the top of the bar

Parameters:

  | event | The event to handle

virtual void Exponent::GUI::Controls::CRangeSlider::lockPositions | ( | const bool | lockMin,
|  | const bool | lockMax,
|  | const double | minValue,
|  | const double | maxValue,
|  | const bool | jumpToMax = `true` |
| ) |  |  | `[virtual]`

Lock the positions

Parameters:

  | lockMin | If true min is locked to minValue
  | lockMax | If true max is locked to maxValue
  | minValue | If lockMin is true the min is locked to this value
  | maxValue | If lockMax is true the max is locked to this value
  | jumpToMax | If true the max will jump to this position, generally for use if min is locked in place

virtual void Exponent::GUI::Controls::CRangeSlider::setColours | ( | CAlphaColour | frameColour,
|  | CAlphaColour | backgroundColour,
|  | CAlphaColour | handleColour,
|  | CAlphaColour | handleOverColour,
|  | CAlphaColour | handleDownColour |
| ) |  |  | `[virtual]`

Set the colours

Parameters:

  | frameColour | The colour of the frame
  | backgroundColour | The background colour of the control
  | handleColour | The colour of the area that can be grabbed by the user
  | handleOverColour | The colour of the area that can be grabbed by the user when mouse is over
  | handleDownColour | The colour of the area that can be grabbed by the user when mouse is grabbing it

virtual void Exponent::GUI::Controls::CRangeSlider::setMaximumValue | ( | const double | maxValue | ) | `[virtual]`

Set the maximum value

Parameters:

  | maxValue | The maximum value

virtual void Exponent::GUI::Controls::CRangeSlider::setMinimumValue | ( | const double | minValue | ) | `[virtual]`

Set the minimum value

Parameters:

  | minValue | The minimum value

## Member Data Documentation

EDragId Exponent::GUI::Controls::CRangeSlider::m_dragId`[protected]`

Drag id

Definition at line 212 of file CRangeSlider.hpp.

CPoint Exponent::GUI::Controls::CRangeSlider::m_grabOffset`[protected]`

What is the offset to where they grabbed?

Definition at line 205 of file CRangeSlider.hpp.

CAlphaColour Exponent::GUI::Controls::CRangeSlider::m_handleColour`[protected]`

Colour of the slider

Definition at line 206 of file CRangeSlider.hpp.

CAlphaColour Exponent::GUI::Controls::CRangeSlider::m_handleDownColour`[protected]`

Colour of the slider when mouse is down

Definition at line 208 of file CRangeSlider.hpp.

CAlphaColour Exponent::GUI::Controls::CRangeSlider::m_handleOverColour`[protected]`

Colour of the slider when mouse is over

Definition at line 207 of file CRangeSlider.hpp.

bool Exponent::GUI::Controls::CRangeSlider::m_isVertical`[protected]`

Is the slider vertical?

Definition at line 211 of file CRangeSlider.hpp.

bool Exponent::GUI::Controls::CRangeSlider::m_jumpToMax`[protected]`

Should mouse down jump to the max value? -> implies lock min, moveable max

Definition at line 219 of file CRangeSlider.hpp.

bool Exponent::GUI::Controls::CRangeSlider::m_lockMax`[protected]`

Lock the max?

Definition at line 217 of file CRangeSlider.hpp.

bool Exponent::GUI::Controls::CRangeSlider::m_lockMin`[protected]`

Lock the min?

Definition at line 218 of file CRangeSlider.hpp.

double Exponent::GUI::Controls::CRangeSlider::m_maxValue`[protected]`

The max value

Definition at line 215 of file CRangeSlider.hpp.

Referenced by getMaximumValue().

double Exponent::GUI::Controls::CRangeSlider::m_minValue`[protected]`

The minimum values

Definition at line 214 of file CRangeSlider.hpp.

Referenced by getMinimumValue().

CRect Exponent::GUI::Controls::CRangeSlider::m_sliderArea`[protected]`

The area of the slider

Definition at line 204 of file CRangeSlider.hpp.

CRolloverButton::ERolloverState Exponent::GUI::Controls::CRangeSlider::m_state`[protected]`

Current state of slider (0 = off : 1 = over : 2 = on)

Definition at line 210 of file CRangeSlider.hpp.