Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

vgui_text_tableau Class Reference

#include <vgui_text_tableau.h>

Inheritance diagram for vgui_text_tableau:

Inheritance graph
[legend]
List of all members.

Detailed Description

Tableau for rendering text.

Each piece of text is associated with an integer handle through which it can be retrieved, moved about, changed or removed.

This tableau will not display any text unless you have compiled with GLUT.

Definition at line 36 of file vgui_text_tableau.h.

Public Member Functions

 vgui_text_tableau ()
 Constructor - don't use this, use vgui_text_tableau_new.
void clear ()
 Remove all text from the display.
unsigned size () const
 Returns the number of pieces of text displayed in this tableau.
vcl_string type_name () const
 Returns the tableau name ("vgui_text_tableau").
int add (float x, float y, char const *text)
 Add the given text to the display at the given x,y position.
int add (float x, float y, vcl_string const &text)
 Add the given vcl_string to the display at the given x,y position.
void set_colour (float r, float g, float b)
 Set the colour of the text.
void set_size (unsigned sz)
 Set the size of the text.
float get_posx (int handle) const
 Return the x-coordinate of the text associated to given handle.
float get_posy (int handle) const
 Return the y-coordinate of the text associated to given handle.
vcl_string const & get_text (int handle) const
 Return the text associated to the given handle.
void move (int handle, float nx, float ny)
 Move text associated to given handle to the given x,y position.
void change (int handle, char const *ntext)
 Change the text associated to given handle to the given new text.
void change (int handle, vcl_string const &ntext)
 Change the text associated to given handle to the given new vcl_string.
void remove (int handle)
 Delete text associated to given handle from the display.
bool handle (vgui_event const &)
 Handles all events sent to this tableau.
virtual vcl_string name () const
 Return the name of the tableau.
virtual vcl_string file_name () const
 Return the name of a file associated with some tableau below (if meaningful).
virtual vcl_string pretty_name () const
 Used to provide an informative name for printouts, debugging etc.
void get_parents (vcl_vector< vgui_tableau_sptr > *out) const
 Get the parent tableaux for this tableau.
void get_children (vcl_vector< vgui_tableau_sptr > *out) const
 Get the child tableaux for this tableau.
vgui_tableau_sptr get_child (unsigned i) const
 Get the ith child or return 0.
virtual bool add_child (vgui_tableau_sptr const &)
 Add the given tableau to the list of child tableaux.
virtual bool remove_child (vgui_tableau_sptr const &)
 Remove the given child from the list of child tableaux.
virtual bool notify_replaced_child (vgui_tableau_sptr const &old_child, vgui_tableau_sptr const &new_child)
 Called whenever a child of this tableau is about to be forcibly replaced.
virtual void add_popup (vgui_menu &)
 Add the given menu to the popup menu for the tableau.
virtual void get_popup (vgui_popup_params const &, vgui_menu &)
 Get the default popup menu for the tableau.
virtual void post_message (char const *, void const *)
 Post a message event.
virtual void post_redraw ()
 Post a draw event.
virtual void post_overlay_redraw ()
 Post a overlay-redraw event.
virtual void post_idle_request ()
 Post an idle request event.
virtual bool get_bounding_box (float low[3], float high[3]) const
 Get the bounding box of this tableau.
virtual bool draw ()
 Called by default handle when it receives a draw event.
virtual bool mouse_down (int x, int y, vgui_button, vgui_modifier)
 Called by default handle when it receives a mouse down event.
virtual bool mouse_up (int x, int y, vgui_button, vgui_modifier)
 Called by default handle when it receives a mouse up event.
virtual bool motion (int x, int y)
 Called by handle when it receives a mouse motion event.
virtual bool key_press (int x, int y, vgui_key, vgui_modifier)
 Called by default handle when it receives a key-press event.
virtual bool help ()
 Called by default handle when it receives a '?' pressed event.
virtual bool idle ()
 Called when the application is otherwise idle.
void ref () const
 Increase the reference count by one (for smart pointers).
void unref () const
 Decrease the reference count by one (for smart pointers).

Static Public Member Functions

static void get_all (vcl_vector< vgui_tableau_sptr > *out)
 Push all tableaux onto the given vector.
static bool exists (vgui_tableau_sptr const &)
 Returns true if the given address points to a valid tableau.

Protected Member Functions

 ~vgui_text_tableau ()
 Destructor - called by vgui_text_tableau_sptr.

Private Attributes

vcl_vector< float > xs
vcl_vector< float > ys
vcl_vector< float > r_
vcl_vector< float > g_
vcl_vector< float > b_
vcl_vector< vcl_string > ts
vcl_vector< unsigned > sz_
float cur_r_
float cur_g_
float cur_b_
unsigned cur_sz_
unsigned first_empty
 Position of the first empty space in the vectors.


Constructor & Destructor Documentation

vgui_text_tableau::vgui_text_tableau  ) 
 

Constructor - don't use this, use vgui_text_tableau_new.

Creates empty text tableau.

Definition at line 21 of file vgui_text_tableau.cxx.

vgui_text_tableau::~vgui_text_tableau  )  [inline, protected]
 

Destructor - called by vgui_text_tableau_sptr.

Definition at line 93 of file vgui_text_tableau.h.


Member Function Documentation

int vgui_text_tableau::add float  x,
float  y,
vcl_string const &  text
[inline]
 

Add the given vcl_string to the display at the given x,y position.

Definition at line 56 of file vgui_text_tableau.h.

int vgui_text_tableau::add float  x,
float  y,
char const *  text
 

Add the given text to the display at the given x,y position.

Definition at line 49 of file vgui_text_tableau.cxx.

bool vgui_tableau::add_child vgui_tableau_sptr const &   )  [virtual, inherited]
 

Add the given tableau to the list of child tableaux.

Virtual overridden by consenting parents.

Reimplemented in vgui_composite_tableau, vgui_deck_tableau, and vgui_wrapper_tableau.

Definition at line 283 of file vgui_tableau.cxx.

void vgui_tableau::add_popup vgui_menu  )  [virtual, inherited]
 

Add the given menu to the popup menu for the tableau.

This method is for tableaux to implement if they want to _add_ some items to the popup menu. They can assign to or clear 'menu', but that is not recommended as it would remove what other tableaux put there. The recommended usage is to .add() items or to .include() another menu.

** This is an interface method. it abstracts a behaviour. **

Reimplemented in vgui_active_tableau, vgui_clear_tableau, and vgui_satellite_tableau_t< object, data >.

Definition at line 315 of file vgui_tableau.cxx.

void vgui_text_tableau::change int  handle,
vcl_string const &  ntext
[inline]
 

Change the text associated to given handle to the given new vcl_string.

Definition at line 82 of file vgui_text_tableau.h.

void vgui_text_tableau::change int  handle,
char const *  ntext
 

Change the text associated to given handle to the given new text.

Definition at line 132 of file vgui_text_tableau.cxx.

void vgui_text_tableau::clear  ) 
 

Remove all text from the display.

Definition at line 39 of file vgui_text_tableau.cxx.

bool vgui_tableau::draw  )  [virtual, inherited]
 

Called by default handle when it receives a draw event.

Reimplemented in vgui_function_tableau.

Definition at line 175 of file vgui_tableau.cxx.

bool vgui_tableau::exists vgui_tableau_sptr const &   )  [static, inherited]
 

Returns true if the given address points to a valid tableau.

Definition at line 384 of file vgui_tableau.cxx.

virtual vcl_string vgui_tableau::file_name  )  const [inline, virtual, inherited]
 

Return the name of a file associated with some tableau below (if meaningful).

Reimplemented in vgui_blender_tableau, vgui_composite_tableau, vgui_deck_tableau, vgui_easy2D_tableau, vgui_enhance_tableau, vgui_image_tableau, vgui_roi_tableau, vgui_wrapper_tableau, and vgui_vrml_tableau.

Definition at line 92 of file vgui_tableau.h.

void vgui_tableau::get_all vcl_vector< vgui_tableau_sptr > *  out  )  [static, inherited]
 

Push all tableaux onto the given vector.

Definition at line 375 of file vgui_tableau.cxx.

bool vgui_tableau::get_bounding_box float  low[3],
float  high[3]
const [virtual, inherited]
 

Get the bounding box of this tableau.

If infinite in extent, or nothing is drawn, or you can't be bothered to implement it, return false. const. if you need to cache, cast away const.

Reimplemented in vgui_composite_tableau, vgui_image_tableau, vgui_roi_tableau, and vgui_wrapper_tableau.

Definition at line 197 of file vgui_tableau.cxx.

vgui_tableau_sptr vgui_tableau::get_child unsigned  i  )  const [inherited]
 

Get the ith child or return 0.

Definition at line 273 of file vgui_tableau.cxx.

void vgui_tableau::get_children vcl_vector< vgui_tableau_sptr > *  out  )  const [inherited]
 

Get the child tableaux for this tableau.

Definition at line 266 of file vgui_tableau.cxx.

void vgui_tableau::get_parents vcl_vector< vgui_tableau_sptr > *  out  )  const [inherited]
 

Get the parent tableaux for this tableau.

Definition at line 259 of file vgui_tableau.cxx.

void vgui_tableau::get_popup vgui_popup_params const &  params,
vgui_menu menu
[virtual, inherited]
 

Get the default popup menu for the tableau.

If recurse is, true, recursively add the popup menus for children and children's children etc.

** this is a mixin method. it does some work for you. **

Reimplemented in vgui_deck_tableau, vgui_image_tableau, vgui_poly_tableau, vgui_shell_tableau, vgui_tview_launcher_tableau, and vgui_tview_tableau.

Definition at line 326 of file vgui_tableau.cxx.

float vgui_text_tableau::get_posx int  handle  )  const
 

Return the x-coordinate of the text associated to given handle.

Definition at line 98 of file vgui_text_tableau.cxx.

float vgui_text_tableau::get_posy int  handle  )  const
 

Return the y-coordinate of the text associated to given handle.

Definition at line 104 of file vgui_text_tableau.cxx.

vcl_string const & vgui_text_tableau::get_text int  handle  )  const
 

Return the text associated to the given handle.

Definition at line 110 of file vgui_text_tableau.cxx.

bool vgui_text_tableau::handle vgui_event const &   )  [virtual]
 

Handles all events sent to this tableau.

In particular, uses draw events to render the text.

Reimplemented from vgui_tableau.

Definition at line 139 of file vgui_text_tableau.cxx.

bool vgui_tableau::help  )  [virtual, inherited]
 

Called by default handle when it receives a '?' pressed event.

Reimplemented in vgui_composite_tableau, vgui_deck_tableau, vgui_function_tableau, vgui_listmanager2D_tableau, vgui_viewer2D_tableau, and vgui_viewer3D_tableau.

Definition at line 165 of file vgui_tableau.cxx.

bool vgui_tableau::idle  )  [virtual, inherited]
 

Called when the application is otherwise idle.

Override if you want to do idle processing. Return false once your idle processing is complete, or if you have no need for more idle processing. Return true if you need more idle processing time.

Definition at line 184 of file vgui_tableau.cxx.

bool vgui_tableau::key_press int  x,
int  y,
vgui_key  ,
vgui_modifier 
[virtual, inherited]
 

Called by default handle when it receives a key-press event.

Reimplemented in vgui_deck_tableau, vgui_function_tableau, vgui_listmanager2D_tableau, vgui_viewer2D_tableau, and vgui_viewer3D_tableau.

Definition at line 155 of file vgui_tableau.cxx.

bool vgui_tableau::motion int  x,
int  y
[virtual, inherited]
 

Called by handle when it receives a mouse motion event.

Reimplemented in vgui_displaylist2D_tableau, vgui_function_tableau, and vgui_listmanager2D_tableau.

Definition at line 145 of file vgui_tableau.cxx.

bool vgui_tableau::mouse_down int  x,
int  y,
vgui_button  ,
vgui_modifier 
[virtual, inherited]
 

Called by default handle when it receives a mouse down event.

Reimplemented in vgui_displaylist2D_tableau, vgui_displaylist3D_tableau, vgui_function_tableau, vgui_listmanager2D_tableau, vgui_viewer2D_tableau, and vgui_viewer3D_tableau.

Definition at line 125 of file vgui_tableau.cxx.

bool vgui_tableau::mouse_up int  x,
int  y,
vgui_button  ,
vgui_modifier 
[virtual, inherited]
 

Called by default handle when it receives a mouse up event.

Reimplemented in vgui_function_tableau, vgui_viewer2D_tableau, and vgui_viewer3D_tableau.

Definition at line 135 of file vgui_tableau.cxx.

void vgui_text_tableau::move int  handle,
float  nx,
float  ny
 

Move text associated to given handle to the given x,y position.

Definition at line 77 of file vgui_text_tableau.cxx.

virtual vcl_string vgui_tableau::name void   )  const [inline, virtual, inherited]
 

Return the name of the tableau.

Reimplemented in vgui_easy2D_tableau.

Definition at line 89 of file vgui_tableau.h.

bool vgui_tableau::notify_replaced_child vgui_tableau_sptr const &  old_child,
vgui_tableau_sptr const &  new_child
[virtual, inherited]
 

Called whenever a child of this tableau is about to be forcibly replaced.

This method is called when some part of the program (typically the parent_child_link mechanism) is about to forcibly replace a child of this tableau. The canonical reason to override this is in order to invalidate caches.

Definition at line 301 of file vgui_tableau.cxx.

void vgui_tableau::post_idle_request  )  [virtual, inherited]
 

Post an idle request event.

The fact that this is virtual does not imply that you should go and override it.

Posting an idle event request means that your tableau has some idle processing that it'd like to do. This means that your tableau will continue to receive vgui_IDLE events until the event handler returns false (i.e. all idle processing is complete). The idle event handler should return false when it has no idle processing, or has completed its idle processing. It may return true if has only partially completed its idle processing; in this case, it will receive more idle event to allow it to complete processing.

Reimplemented in vgui_adaptor_tableau.

Definition at line 234 of file vgui_tableau.cxx.

void vgui_tableau::post_message char const *  ,
void const * 
[virtual, inherited]
 

Post a message event.

The fact that this is virtual does not imply that you should go and override it.

Reimplemented in vgui_adaptor_tableau.

Definition at line 204 of file vgui_tableau.cxx.

void vgui_tableau::post_overlay_redraw  )  [virtual, inherited]
 

Post a overlay-redraw event.

The fact that this is virtual does not imply that you should go and override it.

Reimplemented in vgui_adaptor_tableau.

Definition at line 224 of file vgui_tableau.cxx.

void vgui_tableau::post_redraw  )  [virtual, inherited]
 

Post a draw event.

The fact that this is virtual does not imply that you should go and override it.

Reimplemented in vgui_adaptor_tableau.

Definition at line 214 of file vgui_tableau.cxx.

virtual vcl_string vgui_tableau::pretty_name  )  const [inline, virtual, inherited]
 

Used to provide an informative name for printouts, debugging etc.

Often it's type_name() + some representation of the essential state.

Reimplemented in vgui_composite_tableau, vgui_deck_tableau, vgui_easy2D_tableau, vgui_image_tableau, vgui_roi_tableau, vgui_wrapper_tableau, and vgui_vrml_tableau.

Definition at line 96 of file vgui_tableau.h.

void vgui_tableau::ref  )  const [inherited]
 

Increase the reference count by one (for smart pointers).

"const" is for convenience, it is cast away internally.

Definition at line 78 of file vgui_tableau.cxx.

void vgui_text_tableau::remove int  handle  ) 
 

Delete text associated to given handle from the display.

Definition at line 116 of file vgui_text_tableau.cxx.

bool vgui_tableau::remove_child vgui_tableau_sptr const &   )  [virtual, inherited]
 

Remove the given child from the list of child tableaux.

Reimplemented in vgui_composite_tableau, vgui_deck_tableau, and vgui_wrapper_tableau.

Definition at line 290 of file vgui_tableau.cxx.

void vgui_text_tableau::set_colour float  r,
float  g,
float  b
 

Set the colour of the text.

Definition at line 85 of file vgui_text_tableau.cxx.

void vgui_text_tableau::set_size unsigned  sz  ) 
 

Set the size of the text.

This is one of the sizes supported by vgui_text_put.

Definition at line 94 of file vgui_text_tableau.cxx.

unsigned vgui_text_tableau::size  )  const
 

Returns the number of pieces of text displayed in this tableau.

Definition at line 32 of file vgui_text_tableau.cxx.

vcl_string vgui_text_tableau::type_name  )  const [virtual]
 

Returns the tableau name ("vgui_text_tableau").

Reimplemented from vgui_tableau.

Definition at line 30 of file vgui_text_tableau.cxx.

void vgui_tableau::unref  )  const [inherited]
 

Decrease the reference count by one (for smart pointers).

"const" is for convenience, it is cast away internally. If the reference count reaches zero then delete the object.

Definition at line 86 of file vgui_tableau.cxx.


Member Data Documentation

vcl_vector<float> vgui_text_tableau::b_ [private]
 

Definition at line 98 of file vgui_text_tableau.h.

float vgui_text_tableau::cur_b_ [private]
 

Definition at line 102 of file vgui_text_tableau.h.

float vgui_text_tableau::cur_g_ [private]
 

Definition at line 102 of file vgui_text_tableau.h.

float vgui_text_tableau::cur_r_ [private]
 

Definition at line 102 of file vgui_text_tableau.h.

unsigned vgui_text_tableau::cur_sz_ [private]
 

Definition at line 103 of file vgui_text_tableau.h.

unsigned vgui_text_tableau::first_empty [private]
 

Position of the first empty space in the vectors.

Definition at line 106 of file vgui_text_tableau.h.

vcl_vector<float> vgui_text_tableau::g_ [private]
 

Definition at line 98 of file vgui_text_tableau.h.

vcl_vector<float> vgui_text_tableau::r_ [private]
 

Definition at line 98 of file vgui_text_tableau.h.

vcl_vector<unsigned> vgui_text_tableau::sz_ [private]
 

Definition at line 100 of file vgui_text_tableau.h.

vcl_vector<vcl_string> vgui_text_tableau::ts [private]
 

Definition at line 99 of file vgui_text_tableau.h.

vcl_vector<float> vgui_text_tableau::xs [private]
 

Definition at line 96 of file vgui_text_tableau.h.

vcl_vector<float> vgui_text_tableau::ys [private]
 

Definition at line 97 of file vgui_text_tableau.h.


The documentation for this class was generated from the following files:
Generated on Thu Jan 10 14:42:30 2008 for core/vgui by  doxygen 1.4.4