MityDSP Documentation Index

MityDSP::tcGuiObject Class Reference

#include <ggui/gui_object.h>

Inheritance diagram for MityDSP::tcGuiObject:
MityDSP::tcGuiButton MityDSP::tcGuiCheckBox MityDSP::tcGuiDisplay MityDSP::tcGuiGraph MityDSP::tcGuiImage MityDSP::tcGuiKnob MityDSP::tcGuiLabel MityDSP::tcGuiLamp MityDSP::tcGuiListbox MityDSP::tcGuiSlider MityDSP::tcGuiSpinBox

List of all members.

Public Types

enum  teAlignment {
  eeAlignLeft = 0x0000, eeAlignHCenter = 0x0001, eeAlignRight = 0x0002, eeAlignHMask = 0x0003,
  eeAlignTop = 0x0000, eeAlignVCenter = 0x0010, eeAlignBottom = 0x0020, eeAlignVMask = 0x0030,
  eeAlignCenter = eeAlignHCenter|eeAlignVCenter, eeAlignTopLeft = eeAlignTop|eeAlignLeft
}

Public Member Functions

 tcGuiObject (const char *name, tcBench *bench, int idd, uint32 type)
virtual ~tcGuiObject ()
virtual bool ParseXML (TiXmlElement *ahDom)
const char * name ()
const GSTRINGgname ()
uint32 type ()
int idd ()
const char * get_text ()
bool is_visible ()
int get_x_pos ()
int get_y_pos ()
int get_height ()
int get_width ()
void get_rect (tcRect &rect)
int get_type ()
virtual tcGuiObjectget_parent_obj ()
virtual void create ()
virtual void show (bool show=true)
virtual void hide ()
virtual void set_text (const char *text)
virtual void set_x_pos (int x)
virtual void set_y_pos (int y)
virtual void set_height (int h)
virtual void set_width (int w)
void set_image (tcGuiImage *image)
virtual void set_text_x_pos (int x)
virtual void set_text_y_pos (int y)
void set_text_font (tcDspFont *font)
void set_text_align (int align)
void set_text_color (tsRgb color)
void set_text_vertical (bool vert)
void set_text_wrap (bool wrap)
void set_fg_color (tsRgb color)
void set_bg_color (tsRgb color)
void set_user_id (int id)
virtual void set_animate (bool animate)
void set_user_ptr (void *ptr)
int get_user_id ()
tsRgb get_fg_color ()
tsRgb get_bg_color ()
tsRgb get_text_color ()
virtual bool is_point_in (int x, int y)
virtual bool is_rect_overlapped (tcRect &rect)
virtual bool lbutton_down (int x, int y)
virtual void lbutton_up (int x, int y)
virtual void mouse_move (int x, int y, int flags)
virtual bool does_l_mouse ()
virtual void animate ()
virtual void draw (tcGuiDspDisplay &pd)
void invalidate (tcRect *bckgrnd_redraw=NULL)

Protected Member Functions

virtual void calculate_text_rect (int alignment)
virtual void draw_text (tcGuiDspDisplay &pd, int alignment, int dip=0, float opacity=1.0F)

Protected Attributes

bool m_created
 true when XML file parsing is complete and object has been initialized
bool m_visible
 true when object is potentially visible on the full screen
uint32 m_type
tcBenchm_bench
 pointer to the tcGuiBench (widget manager) object
bool m_animate
 true if this widget will perform animation
GSTRING m_name
 name of the widget
int m_idd
 unique ID number of the widget
int m_x_pos
 screen x position of the widget
int m_y_pos
 screen y position of the widget
int m_height
 widget height
int m_width
 widget widget
tcRect m_obj_rect
 bounding rectangle of widget (screen coordinates) (may not include all text)
tcRect m_text_rect
 bounding rectangle text for widget (screen coordinates)
int m_lcapture_x
int m_lcapture_y
int m_rcapture_x
int m_rcapture_y
tsRgb m_fg_color
 foregroun color to use when rendering tcGuiObject
tsRgb m_bg_color
 background color to use when rendering tcGuiObject
tsRgb m_text_color
 color to use when rendering tcGuiObject text
tcDspFont * m_font
 font to use when rendering tcGuiObject text
GSTRING m_text
 base tcGuiObject class text data
int m_text_x_pos
 reference screen x position of object text
int m_text_y_pos
 reference screen y position of object text
int m_text_align
 alignment flags used for text rendering
bool m_text_vertical
bool m_text_wrap
 true if this text string should be wrapped to available space when drawn
int m_user_id
void * m_user_ptr
tcGuiImagem_image
 pointer to optional background image

Detailed Description

The tcGuiObject class is an abstract base class from which all ggui skinnable widgets should be derived.

See also:
tcGuiObject Page

Member Enumeration Documentation

This enumeration is used to describe how widget text should be drawn with respect to the text location point.

Enumerator:
eeAlignLeft 

Horizontal left aligned.

eeAlignHCenter 

Horizontal center aligned.

eeAlignRight 

Horizontal right alignment.

eeAlignHMask 

Horizontal alignment mask bits.

eeAlignTop 

Vertical top aligned.

eeAlignVCenter 

Vertical center aligned.

eeAlignBottom 

Vertical bottom alignment.

eeAlignVMask 

Vertical alignment mask bits.

eeAlignCenter 

Vertical center aligned.

eeAlignTopLeft 

Horizontal left aligned.


Constructor & Destructor Documentation

tcGuiObject::tcGuiObject ( const char *  name,
tcBench bench,
int  idd,
uint32  type 
)

Constructor

Parameters:
name Object ID name from the XML file.
parent Parent window (the GGUI main window).
idd The windows control ID that we assigned to this control.
type The object type.
tcGuiObject::~tcGuiObject (  )  [virtual]

Destructor


Member Function Documentation

bool tcGuiObject::ParseXML ( TiXmlElement *  apElement  )  [virtual]
const char* MityDSP::tcGuiObject::name (  )  [inline]
const GSTRING* MityDSP::tcGuiObject::gname (  )  [inline]
uint32 MityDSP::tcGuiObject::type (  )  [inline]
int MityDSP::tcGuiObject::idd (  )  [inline]
const char* MityDSP::tcGuiObject::get_text (  )  [inline]
bool MityDSP::tcGuiObject::is_visible (  )  [inline]
int MityDSP::tcGuiObject::get_x_pos (  )  [inline]
int MityDSP::tcGuiObject::get_y_pos (  )  [inline]
int MityDSP::tcGuiObject::get_height (  )  [inline]
int MityDSP::tcGuiObject::get_width (  )  [inline]
void tcGuiObject::get_rect ( tcRect rect  ) 

Get the bounding rectangle for the object.

Note:
this rectangle does not include the bounding rectangle of the associated text (if any) of the object.
Parameters:
rect output bounding rectangle
int MityDSP::tcGuiObject::get_type (  )  [inline]
virtual tcGuiObject* MityDSP::tcGuiObject::get_parent_obj (  )  [inline, virtual]
virtual void MityDSP::tcGuiObject::create (  )  [inline, virtual]
void tcGuiObject::show ( bool  show = true  )  [virtual]

This function un-hides the object. If hidden the object will not respond to mouse clicks or appear on the screen.

Note:
This function is usually called when the active screen changes from within the script virtual machine.

Reimplemented in MityDSP::tcGuiGraph.

void tcGuiObject::hide (  )  [virtual]

This function hides the object. If hidden the object will not respond to mouse clicks or appear on the screen.

Note:
This function is usually called when the active screen changes from within the script virtual machine.

Reimplemented in MityDSP::tcGuiGraph.

void tcGuiObject::set_text ( const char *  text  )  [virtual]

Set the text for an object.

Parameters:
text text to apply.

Reimplemented in MityDSP::tcGuiDisplay.

virtual void MityDSP::tcGuiObject::set_x_pos ( int  x  )  [inline, virtual]
virtual void MityDSP::tcGuiObject::set_y_pos ( int  y  )  [inline, virtual]
virtual void MityDSP::tcGuiObject::set_height ( int  h  )  [inline, virtual]
virtual void MityDSP::tcGuiObject::set_width ( int  w  )  [inline, virtual]
void MityDSP::tcGuiObject::set_image ( tcGuiImage image  )  [inline]
virtual void MityDSP::tcGuiObject::set_text_x_pos ( int  x  )  [inline, virtual]
virtual void MityDSP::tcGuiObject::set_text_y_pos ( int  y  )  [inline, virtual]
void MityDSP::tcGuiObject::set_text_font ( tcDspFont *  font  )  [inline]
void MityDSP::tcGuiObject::set_text_align ( int  align  )  [inline]
void MityDSP::tcGuiObject::set_text_color ( tsRgb  color  )  [inline]
void MityDSP::tcGuiObject::set_text_vertical ( bool  vert  )  [inline]
void MityDSP::tcGuiObject::set_text_wrap ( bool  wrap  )  [inline]
void MityDSP::tcGuiObject::set_fg_color ( tsRgb  color  )  [inline]
void MityDSP::tcGuiObject::set_bg_color ( tsRgb  color  )  [inline]
void MityDSP::tcGuiObject::set_user_id ( int  id  )  [inline]
virtual void MityDSP::tcGuiObject::set_animate ( bool  animate  )  [inline, virtual]

Reimplemented in MityDSP::tcGuiDisplay.

void MityDSP::tcGuiObject::set_user_ptr ( void *  ptr  )  [inline]
int MityDSP::tcGuiObject::get_user_id (  )  [inline]
tsRgb MityDSP::tcGuiObject::get_fg_color (  )  [inline]
tsRgb MityDSP::tcGuiObject::get_bg_color (  )  [inline]
tsRgb MityDSP::tcGuiObject::get_text_color (  )  [inline]
bool tcGuiObject::is_point_in ( int  x,
int  y 
) [virtual]

This function determines if the specified point is within the object rectangle.

Parameters:
x The X position to test.
y The Y position to test.
Returns:
true if the point is in the control rectangle, false if not.
bool tcGuiObject::is_rect_overlapped ( tcRect rect  )  [virtual]

This function determines if the specified rect overlaps the object rectangle.

Parameters:
rect the rectangle to test
Returns:
true if the rectangle overlaps.
virtual bool MityDSP::tcGuiObject::lbutton_down ( int  x,
int  y 
) [inline, virtual]
void tcGuiObject::lbutton_up ( int  x,
int  y 
) [virtual]

Empty method for handling left mouse button up events. Should be overridden by objects requiring left button up events.

Parameters:
x x screen coordinate of up event
y y screen coordinate of up event

Reimplemented in MityDSP::tcGuiButton, MityDSP::tcGuiCheckBox, MityDSP::tcGuiKnob, MityDSP::tcGuiListbox, MityDSP::tcGuiSlider, and MityDSP::tcGuiSpinBox.

virtual void MityDSP::tcGuiObject::mouse_move ( int  x,
int  y,
int  flags 
) [inline, virtual]
virtual bool MityDSP::tcGuiObject::does_l_mouse (  )  [inline, virtual]
virtual void MityDSP::tcGuiObject::animate (  )  [inline, virtual]
virtual void MityDSP::tcGuiObject::draw ( tcGuiDspDisplay pd  )  [inline, virtual]
void tcGuiObject::invalidate ( tcRect bckgrnd_redraw = NULL  ) 

Force an object to invalidate the region of the screen it is situated in.

Note:
this routine will invalidate the bounding rectangle that includes it's object width and height as well as any associated text set in the set_text method.
this routine is not executed in the object is not visible.
Parameters:
bckgrnd_redraw not used, set to NULL
void tcGuiObject::calculate_text_rect ( int  alignment  )  [protected, virtual]

Re-computes the bounding box of the associated object text set in set_text method. This method should be called whenever the text fields or positions have been changed.

Parameters:
alignment text alignment flags
Note:
This method is currently unimplemented in the MityDSP. The results of this operation will set the text bounding rectangle equal to the object bounding rectangle (from xml_set_x_pos, xml_set_y_pos, xml_set_width, xml_set_height).

Todo:
Need to fix this for MityDSP port... SJG 9/9/09 - Added check for m_text.strlen() as in

void tcGuiObject::draw_text ( tcGuiDspDisplay pd,
int  alignment,
int  dip = 0,
float  opacity = 1.0F 
) [protected, virtual]

Draws the text set in set_text() method to the screen context supplied.

Parameters:
pd reference to active screen display context.
alignment text alignment bitmask
dip +x and +y offset text will be drawn dip pixels lower and to the right of nominal text location.

Member Data Documentation

true when XML file parsing is complete and object has been initialized

true when object is potentially visible on the full screen

uint32 MityDSP::tcGuiObject::m_type [protected]

pointer to the tcGuiBench (widget manager) object

true if this widget will perform animation

name of the widget

int MityDSP::tcGuiObject::m_idd [protected]

unique ID number of the widget

screen x position of the widget

screen y position of the widget

widget height

widget widget

bounding rectangle of widget (screen coordinates) (may not include all text)

bounding rectangle text for widget (screen coordinates)

foregroun color to use when rendering tcGuiObject

background color to use when rendering tcGuiObject

color to use when rendering tcGuiObject text

tcDspFont* MityDSP::tcGuiObject::m_font [protected]

font to use when rendering tcGuiObject text

base tcGuiObject class text data

reference screen x position of object text

reference screen y position of object text

alignment flags used for text rendering

true if this text string should be wrapped to available space when drawn

pointer to optional background image


  
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.