Exponent::GUI::Controls::CControlPanel Class Reference

Inheritance diagram for Exponent::GUI::Controls::CControlPanel:

Exponent::GUI::Controls::CControlRoot Exponent::GUI::Controls::CControl Exponent::GUI::Controls::IControlRoot Exponent::GUI::Controls::IControl Exponent::GUI::Listeners::IMouseListener Exponent::GUI::Listeners::IDropFileListener Exponent::GUI::Listeners::IKeyboardListener Exponent::GUI::Controls::CMenuItemDisplay Exponent::GUI::Controls::CPresetBrowser Exponent::GUI::Controls::CPresetBrowser::CPresetBrowserHead Exponent::GUI::Controls::CPresetBrowser::CPresetBrowserSelector Exponent::GUI::Controls::CRadioButton Exponent::GUI::Controls::CScrollPanel List of all members.

Detailed Description

A control panel is a control that holds other controls It inherits from both CControl and CControlRoot, allowing you to pass it controls to add as children.

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

Definition at line 37 of file CControlPanel.hpp.

Public Member Functions

Protected Member Functions

Protected Attributes


Constructor & Destructor Documentation

Exponent::GUI::Controls::CControlPanel::CControlPanel ( IWindow *  parent,
IControlRoot root,
const long  uniqueId,
const CRect &  area,
IActionListener *  listener = NULL 
)

Construction

Parameters:
parent THe parent window holding this control root
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
Note:
The root that is passed in to this constructor is the root for *this*, not for any sub children that are added to it.
Under the Exponent API graphics system, every control must have a root control - This is the control that is responsible for delegating all
mouse events, graphics calls etc. Generally for custom groupings of controls you will inherit from CControlPanel and then create custom controls
inside it. To perform this action you would use this as the parent. For example:
 CMyControlPanel::CMyControlPanel(IWindow *parent, IControlRoot *root, const long uniqueId, const CRect &area, IActionListener *listener)
                : CControlPanel(parent, root, uniqueId, area, listener)
 {
        // Notice that we are being added to root, not our children....
      
      // Create our child controls, here we just create a generic control, but this could be any control that we choose
        // Notice that the area is set to be relative to *our* top left..
      CControl *control = new CControl(this, 10, CRect(0, 0, 10, 10), NULL);
        // Now we add the control so that it will draw, recieve mouse moves etc...
        this->addControl(control);
 }

virtual Exponent::GUI::Controls::CControlPanel::~CControlPanel (  )  [virtual]

Destruction


Member Function Documentation

virtual void Exponent::GUI::Controls::CControlPanel::addControl ( IControl control  )  [virtual]

Add a control

Parameters:
control A control that becomes a child of this

Reimplemented from Exponent::GUI::Controls::CControlRoot.

virtual void Exponent::GUI::Controls::CControlPanel::dereference (  )  [inline, virtual]

Dereference

See also:
ICountedObject

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

Definition at line 278 of file CControlPanel.hpp.

References Exponent::GUI::Controls::CControl::dereference().

virtual void Exponent::GUI::Controls::CControlPanel::disableControl (  )  [virtual]

Disable the control

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

virtual void Exponent::GUI::Controls::CControlPanel::drawControl ( CGraphics &  graphics  )  [virtual]

Draw the control

Parameters:
graphics The graphics context

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

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

virtual bool Exponent::GUI::Controls::CControlPanel::drawEnabledControl ( CGraphics &  graphics  )  [protected, virtual]

Check if the control is enabled. If it isnt, draw the disabled background and return

Parameters:
graphics The graphics context
Return values:
bool True if the control should be drawn, false otherwise

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

virtual void Exponent::GUI::Controls::CControlPanel::drawRootControl ( CGraphics &  graphics  )  [virtual]

Draw the root control

Parameters:
graphics The graphics context

Reimplemented from Exponent::GUI::Controls::CControlRoot.

virtual void Exponent::GUI::Controls::CControlPanel::enableControl (  )  [virtual]

Enable a control

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

void Exponent::GUI::Controls::CControlPanel::flushSizeChange (  )  [protected]

Fluush throught a size change of some sort

virtual void Exponent::GUI::Controls::CControlPanel::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

Reimplemented from Exponent::GUI::Controls::CControlRoot.

virtual void Exponent::GUI::Controls::CControlPanel::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

Reimplemented from Exponent::GUI::Controls::CControlRoot.

Reimplemented in Exponent::GUI::Controls::CScrollPanel.

virtual CPoint Exponent::GUI::Controls::CControlPanel::getWindowOffset (  )  [virtual]

Get window offset

Return values:
CPoint The window offset for this panel

Reimplemented from Exponent::GUI::Controls::CControlRoot.

Reimplemented in Exponent::GUI::Controls::CScrollPanel.

virtual void Exponent::GUI::Controls::CControlPanel::handleDoubleClick ( CMouseEvent &  event  )  [virtual]

Handle a double click on the left button

Parameters:
event The event to handle

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

Reimplemented in Exponent::GUI::Controls::CScrollPanel.

virtual void Exponent::GUI::Controls::CControlPanel::handleFileDrop ( const CDropEvent &  event  )  [virtual]

Handle a file drop

Parameters:
event The event to handle

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

virtual bool Exponent::GUI::Controls::CControlPanel::handleKeyDown ( const CKeyboardEvent &  event  )  [virtual]

Handle key down events

Parameters:
event The event to handle

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

virtual bool Exponent::GUI::Controls::CControlPanel::handleKeyUp ( const CKeyboardEvent &  event  )  [virtual]

Handle key up events

Parameters:
event The event to handle

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

virtual void Exponent::GUI::Controls::CControlPanel::handleLeftButtonDown ( CMouseEvent &  event  )  [virtual]

Handle left button being clicked

Parameters:
event The event to handle

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

Reimplemented in Exponent::GUI::Controls::CScrollPanel.

virtual void Exponent::GUI::Controls::CControlPanel::handleLeftButtonUp ( CMouseEvent &  event  )  [virtual]

Handle left button being released

Parameters:
event The event to handle

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

Reimplemented in Exponent::GUI::Controls::CScrollPanel.

virtual void Exponent::GUI::Controls::CControlPanel::handleMouseLeavingArea ( CMouseEvent &  event  )  [virtual]

Handle a mouse leaving movement

Parameters:
event The event to handle

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

Reimplemented in Exponent::GUI::Controls::CScrollPanel.

virtual void Exponent::GUI::Controls::CControlPanel::handleMouseMovement ( CMouseEvent &  event  )  [virtual]

Handle the mouse movement

Parameters:
event The event to handle

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

Reimplemented in Exponent::GUI::Controls::CScrollPanel.

virtual void Exponent::GUI::Controls::CControlPanel::handleMouseScroll ( CMouseEvent &  event  )  [virtual]

Handle the scroll wheel

Parameters:
event The event to handle

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

Reimplemented in Exponent::GUI::Controls::CScrollPanel.

virtual void Exponent::GUI::Controls::CControlPanel::handleRightButtonDown ( CMouseEvent &  event  )  [virtual]

Handle the right button being clicked

Parameters:
event The event to handle

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

Reimplemented in Exponent::GUI::Controls::CScrollPanel.

virtual void Exponent::GUI::Controls::CControlPanel::handleRightButtonUp ( CMouseEvent &  event  )  [virtual]

Handle the right button being released

Parameters:
event The event to handle

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

Reimplemented in Exponent::GUI::Controls::CScrollPanel.

virtual bool Exponent::GUI::Controls::CControlPanel::isContainer (  )  const [inline, virtual]

Is this control a container of other controls

Return values:
bool True, this control can contain others

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

Definition at line 112 of file CControlPanel.hpp.

virtual void Exponent::GUI::Controls::CControlPanel::lockControl ( IControl control  )  [virtual]

Lock a control (only this control recieves mouse info)

Parameters:
control The control to feed all events to

Reimplemented from Exponent::GUI::Controls::CControlRoot.

virtual void Exponent::GUI::Controls::CControlPanel::onDrawDrawThePanelBounds ( const bool  draw = true  )  [inline, virtual]

Should we draw the panel bounds?

Parameters:
draw If true the panel bounding box will be drawn, if false will not. Useful during debugging

Definition at line 249 of file CControlPanel.hpp.

References m_drawPanelBounds.

virtual void Exponent::GUI::Controls::CControlPanel::referenced (  )  [inline, virtual]

Reference

See also:
ICountedObject

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

Definition at line 269 of file CControlPanel.hpp.

References Exponent::GUI::Controls::CControl::referenced().

virtual void Exponent::GUI::Controls::CControlPanel::setArea ( const CRect &  area  )  [virtual]

Set the size of the control

Parameters:
area The are of the control

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

Reimplemented in Exponent::GUI::Controls::CRadioButton.

virtual void Exponent::GUI::Controls::CControlPanel::setBoundsColour ( const CAlphaColour &  boundsColour  )  [inline, virtual]

Set the colour of the bounds

Parameters:
boundsColour The colour of the bounding box

Definition at line 261 of file CControlPanel.hpp.

References m_boundsColour.

virtual void Exponent::GUI::Controls::CControlPanel::setControlRoot ( IControlRoot controlRoot  )  [virtual]

Set the root control that this control is sitting on

Parameters:
controlRoot The root control of this panel

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

void Exponent::GUI::Controls::CControlPanel::shouldClip ( const bool  clip = true  ) 

Should we clip children control

Parameters:
clip If true clipping is applied, not recommended when placing inside a scroll panel

virtual void Exponent::GUI::Controls::CControlPanel::unlockControl (  )  [virtual]

Unlock a control

See also:
lockControl

Reimplemented from Exponent::GUI::Controls::CControlRoot.

virtual void Exponent::GUI::Controls::CControlPanel::updateArea ( const CRect &  area  )  [virtual]

Update an area

Parameters:
area The area relative to our top left to redraw

Reimplemented from Exponent::GUI::Controls::CControlRoot.

Reimplemented in Exponent::GUI::Controls::CScrollPanel.

virtual void Exponent::GUI::Controls::CControlPanel::updateControl ( IControl control  )  [virtual]

Update (redraw) a control

Parameters:
control The control to redraw

Reimplemented from Exponent::GUI::Controls::CControlRoot.

Reimplemented in Exponent::GUI::Controls::CScrollPanel.


Member Data Documentation

CAlphaColour Exponent::GUI::Controls::CControlPanel::m_boundsColour [protected]

THe colour of the bounds

Definition at line 313 of file CControlPanel.hpp.

Referenced by setBoundsColour().

bool Exponent::GUI::Controls::CControlPanel::m_drawPanelBounds [protected]

Should we draw the bounds of the panel

Definition at line 312 of file CControlPanel.hpp.

Referenced by onDrawDrawThePanelBounds().


Infinity API - Exponent::GUI::Controls::CControlPanel Class Reference generated on 7 Mar 2007