MityDSP Documentation Index

MityDSP::tcGuiSlider Class Reference

#include <ggui/gui_slider.h>

Inheritance diagram for MityDSP::tcGuiSlider:
MityDSP::tcGuiObject

List of all members.

Public Member Functions

 tcGuiSlider (const char *name, tcBench *bench, int idd)
 ~tcGuiSlider ()
virtual bool ParseXML (TiXmlElement *ahDom)
void set_direction (int dir)
void set_slider_pos (int pos)
void set_thumb_image (tcGuiImage *image)
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)
void draw (tcGuiDspDisplay &pd)
void set_slider_callbacks (SLIDER_POSITION_CB slider_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

int slide_to_draw_pos (int slide_pos)
int draw_to_slide_pos (int draw_pos)
void mouse_delta (int delta, int flags)

Protected Attributes

int m_min_range
 Minimum position (not used by all objects).
int m_max_range
 Maximum position (not used by all objects).
int m_position
 Current position (not used by all objects).
tcGuiImagem_thumb
 image represending sliding portion/knob of widget
int m_thumb_width
 width of the sliding portion/knob of the widget
int m_thumb_height
 height of the sliding portion/know of the widget
bool m_thumb_highlight
 true if the thumb support highlighting
bool m_clicked
 true if the slider clicked
int m_track_pos
int m_direction
 direction of the slider
SLIDER_POSITION_CB m_slider_position_cb
 callback for active slider

Detailed Description

The tcGuiSlider class is a widget class for a sliding control.

See also:
tcGuiSlider Page

Constructor & Destructor Documentation

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

Constructor

Parameters:
name Object ID name from the XML file.
bench Controlling tcBench class for this widget.
idd The windows control ID that we assigned to this control.
tcGuiSlider::~tcGuiSlider (  ) 

Destructor

Parameters:
name Object ID name from the XML file.
bench Controlling tcBench class for this widget.
idd The windows control ID that we assigned to this control.

Member Function Documentation

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

Parse common XML elements from the DOM.

Reimplemented from MityDSP::tcGuiObject.

void MityDSP::tcGuiSlider::set_direction ( int  dir  )  [inline]
void MityDSP::tcGuiSlider::set_slider_pos ( int  pos  )  [inline]
void MityDSP::tcGuiSlider::set_thumb_image ( tcGuiImage image  )  [inline]
void tcGuiSlider::create (  )  [virtual]

This function creates the slider.

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

Reimplemented from MityDSP::tcGuiObject.

void tcGuiSlider::set_position ( int  pos  ) 

This function moves the slider to the specified position.

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

Slider left button down handler.

Parameters:
x x screen coordinate of mouse event
y x screen coordinate of mouse event
Returns:
true if button event was handled

Reimplemented from MityDSP::tcGuiObject.

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

Slider left button up handler.

Parameters:
x x screen coordinate of mouse event
y x screen coordinate of mouse event
Returns:
true if button event was handled

Reimplemented from MityDSP::tcGuiObject.

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

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

Parameters:
x x screen coordinate of mouse event
y x screen coordinate of mouse event
flags - GUI_SHIFT_KEY if shift button held down

  • GUI_CNTRL_KEY if CNTRL button held down

Reimplemented from MityDSP::tcGuiObject.

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

This function draws the slider and its label.

Parameters:
pd reference to painting device context to draw in.

Reimplemented from MityDSP::tcGuiObject.

void MityDSP::tcGuiSlider::set_slider_callbacks ( SLIDER_POSITION_CB  slider_position_cb  )  [inline]
virtual int MityDSP::tcGuiSlider::get_min_range (  )  [inline, virtual]
virtual int MityDSP::tcGuiSlider::get_max_range (  )  [inline, virtual]
virtual int MityDSP::tcGuiSlider::get_position (  )  [inline, virtual]
void MityDSP::tcGuiSlider::set_min_range ( int  range  )  [inline]
void MityDSP::tcGuiSlider::set_max_range ( int  range  )  [inline]
int tcGuiSlider::slide_to_draw_pos ( int  slide_pos  )  [protected]

Determine pixel offset within widget to draw the "thumb" portion of the slider control.

Parameters:
slide_pos position of slider (m_min_range <= slide_pos <= m_max_range)
Returns:
y pixel offset if m_direction is SLIDER_VERT else x pixel offset
int tcGuiSlider::draw_to_slide_pos ( int  draw_pos  )  [protected]

Determine logical slide position of widget given a thumb drawing position

Parameters:
y pixel offset if m_direction is SLIDER_VERT else x pixel offset
Returns:
slide_pos position of slider (m_min_range <= slide_pos <= m_max_range)
void tcGuiSlider::mouse_delta ( int  delta,
int  flags 
) [protected]

I really don't know what this does.

Parameters:
delta a change
flags - GUI_SHIFT_KEY if shift button held down

  • GUI_CNTRL_KEY if CNTRL button held down

Member Data Documentation

Minimum position (not used by all objects).

Maximum position (not used by all objects).

Current position (not used by all objects).

image represending sliding portion/knob of widget

width of the sliding portion/knob of the widget

height of the sliding portion/know of the widget

true if the thumb support highlighting

true if the slider clicked

direction of the slider

callback for active slider


  
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.