MityDSP Documentation Index

MityDSP::tcGuiKnob Class Reference

#include <ggui/gui_knob.h>

Inheritance diagram for MityDSP::tcGuiKnob:
MityDSP::tcGuiObject

List of all members.

Public Member Functions

 tcGuiKnob (const char *name, tcBench *bench, int idd)
virtual ~tcGuiKnob ()
virtual bool ParseXML (TiXmlElement *ahDom)
void create ()
void set_position (int pos)
bool lbutton_down (int x, int y)
void lbutton_up (int x, int y)
void mouse_move (int x, int y, int flags)
virtual void draw (tcGuiDspDisplay &pd)
void set_knob_callbacks (KNOB_POSITION_CB knob_position_cb)
virtual int get_min_range ()
virtual int get_max_range ()
virtual int get_position ()
void set_min_range (int range)
void set_max_range (int range)

Protected Member Functions

void mouse_delta (int delta)

Protected Attributes

bool m_clicked
 true if the knob is clicked
int m_min_range
 Minimum position.
int m_max_range
 Maximum position.
int m_position
 current knob position, used for indexing image sections
KNOB_POSITION_CB m_knob_position_cb
 callback for knob position changes.

Detailed Description

The tcGuiKnob class is a derived tcGuiObject class that implements a skinnable spinning knob (e.g., an analog dial that goes to 11) control.

See also:
tcGuiKnob Page

Constructor & Destructor Documentation

tcGuiKnob::tcGuiKnob ( const char *  name,
tcBench bench,
int  idd 
)

Constructor

Parameters:
name Object ID name from the XML file.
bench The Controlling tcBench object for this widget.
name The windows control ID that we assigned to this control.
tcGuiKnob::~tcGuiKnob (  )  [virtual]

Destructor


Member Function Documentation

bool tcGuiKnob::ParseXML ( TiXmlElement *  apElement  )  [virtual]

Parse common XML elements from the DOM.

Reimplemented from MityDSP::tcGuiObject.

void tcGuiKnob::create (  )  [virtual]

This function creates the knob control.

Note:
This function is called after all of the XML file settings are read.

Reimplemented from MityDSP::tcGuiObject.

void tcGuiKnob::set_position ( int  pos  ) 

This function moves the X & Y sliders to the specified position.

Note:
It does NOT invoke an action, it is intended to be called from the script VM.
Parameters:
pos New knob position
bool tcGuiKnob::lbutton_down ( int  x,
int  y 
) [virtual]

This function is the button click event handler.

Parameters:
x screen x position of event.
y screen y position of event.

Reimplemented from MityDSP::tcGuiObject.

void tcGuiKnob::lbutton_up ( int  x,
int  y 
) [virtual]

This function is the button up event handler. It is needed by the listbox to release the scrollbar sliding state if the scrollbar is currently activated.

Parameters:
x screen x position of event.
y screen y position of event.

Reimplemented from MityDSP::tcGuiObject.

void tcGuiKnob::mouse_move ( int  x,
int  y,
int  flags 
) [virtual]

This function moves the XY slider positions when the mouse is dragged through the XY control. After scaling the new line positions to slider positions, an action may be called if the slider positions have changed.

Parameters:
x Delta of the X line position.
y Delta of the Y line position. - GUI_SHIFT_KEY if shift button held down

  • GUI_CNTRL_KEY if CNTRL button held down

Reimplemented from MityDSP::tcGuiObject.

void tcGuiKnob::draw ( tcGuiDspDisplay pd  )  [virtual]

This function draws the knob.

Parameters:
pd reference to painting device context to render into.

Reimplemented from MityDSP::tcGuiObject.

void MityDSP::tcGuiKnob::set_knob_callbacks ( KNOB_POSITION_CB  knob_position_cb  )  [inline]
virtual int MityDSP::tcGuiKnob::get_min_range (  )  [inline, virtual]
virtual int MityDSP::tcGuiKnob::get_max_range (  )  [inline, virtual]
virtual int MityDSP::tcGuiKnob::get_position (  )  [inline, virtual]
void MityDSP::tcGuiKnob::set_min_range ( int  range  )  [inline]
void MityDSP::tcGuiKnob::set_max_range ( int  range  )  [inline]
void tcGuiKnob::mouse_delta ( int  delta  )  [protected]

Update the position of the knob based on the amount of mouse movement.

Parameters:
delta amount of mouse movement in pixels
Note:
this routine will invalidate the widget if necessary

Member Data Documentation

true if the knob is clicked

Minimum position.

Maximum position.

current knob position, used for indexing image sections

callback for knob position changes.


  
Generated on Wed Mar 17 18:24:43 2010 for MityDSP Skinnable Graphics User Interface (GGUI) by  Doxygen Version 1.6.1
Copyright © 2009, Critical Link LLC, All rights reserved.