bgui_selector_tableau Class Reference

#include <bgui_selector_tableau.h>

Inheritance diagram for bgui_selector_tableau:

vgui_tableau vgui_parent_child_link_data List of all members.

Detailed Description

Tableau that allows the selection of one active child but displays all children.

The bgui_selector_tableau class can have any number of children, indexed from 0 upwards. The draw action of bgui_selector_tableau is to draw each of its children, in order, into the current context if they are marked visible. Events reaching the bgui_selector_tableau are passed on to the active child only.

The exceptions to this rule are : [a] the DRAW, DRAW_OVERLAY events which are sent to all children.

Definition at line 32 of file bgui_selector_tableau.h.


Public Member Functions

 bgui_selector_tableau ()
 Constructor - don't use this, use bgui_selector_tableau_new.
 bgui_selector_tableau (vcl_vector< vgui_tableau_sptr > const &children)
 Constructor - don't use this, use bgui_selector_tableau_new.
virtual bool handle (const vgui_event &)
 Handle all events sent to this tableau.
vcl_string type_name () const
 Returns the type of this tableau ('bgui_selector_tableau').
vcl_string file_name () const
 There is no obvious filename, so this just returns the type.
vcl_string pretty_name () const
 Returns a nice version of the name, including info on the children.
virtual void get_popup (const vgui_popup_params &, vgui_menu &m)
 Builds a popup menu for the user to select the active child and set visibility.
void add (vgui_tableau_sptr const &tab, vcl_string name="")
 Add a tableau to the list of child tableaux.
void remove (vgui_tableau_sptr const &tab)
 Remove a tableau from the list of child tableaux.
bool remove (const vcl_string name)
 Remove a tableau from the list of child tableaux by name.
void clear ()
 Clear the list of child tableaux.
vgui_tableau_sptr active_tableau () const
 Returns a smart pointer to the active tableau.
const vcl_string & active_name () const
 Returns the name of the active tableau.
vgui_tableau_sptr get_tableau (const vcl_string &name) const
 Returns a smart pointer to the tableau with the given name.
void set_active (const vcl_string &name)
 Make the child tableau with the given name the active child.
bool toggle (const vcl_string &name)
 Toggle the child tableau with the given name between visible/invisible.
bool is_visible (const vcl_string &name) const
 Returns true if the child tableau with the given name is active.
void active_to_top ()
 Move the active tableau to the top of the display list.
void active_raise ()
 Move the active tableau up one position in the display list.
void active_lower ()
 Move the active tableau down one position in the display list.
void active_to_bottom ()
 Move the active tableau to the bottom of the display list.
int num_children () const
 Returns the number of children.
const vcl_vector< vcl_string > & child_names () const
 Returns a vector containing the names of all children (in rendering order).
virtual void add_to_menu (vgui_menu &)
 for subclasses to add additional menus.
virtual vcl_string name () const
void get_parents (vcl_vector< vgui_tableau_sptr > *out) const
void get_children (vcl_vector< vgui_tableau_sptr > *out) const
vgui_tableau_sptr get_child (unsigned i) const
virtual bool notify_replaced_child (vgui_tableau_sptr const &old_child, vgui_tableau_sptr const &new_child)
virtual void add_popup (vgui_menu &)
virtual void post_message (char const *, void const *)
virtual void post_redraw ()
virtual void post_overlay_redraw ()
virtual void post_idle_request ()
virtual bool draw ()
virtual bool mouse_down (int x, int y, vgui_button, vgui_modifier)
virtual bool mouse_up (int x, int y, vgui_button, vgui_modifier)
virtual bool motion (int x, int y)
virtual bool key_press (int x, int y, vgui_key, vgui_modifier)
virtual bool help ()
virtual bool idle ()
void ref () const
void unref () const

Static Public Member Functions

static void get_all (vcl_vector< vgui_tableau_sptr > *out)
static bool exists (vgui_tableau_sptr const &)

Protected Member Functions

virtual ~bgui_selector_tableau ()
 Destructor - called by bgui_selector_tableau_sptr.
bool get_bounding_box (float low[3], float high[3]) const
 Returns a bounding box large enough to contain all child bounding boxes.
bool add_child (vgui_tableau_sptr const &t)
 Add to list of child tableaux.
bool remove_child (vgui_tableau_sptr const &)
 Remove given tableau from list of child tableaux.

Protected Attributes

vcl_map< vcl_string, bool > visible_
 Whether each child is visible or not (ie. using events).
vcl_vector< vcl_string > render_order_
 The unique child names sorted in rendering order.
vcl_map< vcl_string, vgui_parent_child_linkchild_map_
 A map from unique names to children.
vcl_string active_child_
 The name of the active tableau.

Constructor & Destructor Documentation

bgui_selector_tableau::bgui_selector_tableau (  ) 

Constructor - don't use this, use bgui_selector_tableau_new.

Creates an empty composite tableau.

Definition at line 26 of file bgui_selector_tableau.cxx.

bgui_selector_tableau::bgui_selector_tableau ( vcl_vector< vgui_tableau_sptr > const &  children  ) 

Constructor - don't use this, use bgui_selector_tableau_new.

Takes a vector of child tableaux.

Definition at line 34 of file bgui_selector_tableau.cxx.

bgui_selector_tableau::~bgui_selector_tableau (  )  [protected, virtual]

Destructor - called by bgui_selector_tableau_sptr.

Definition at line 43 of file bgui_selector_tableau.cxx.


Member Function Documentation

bool bgui_selector_tableau::handle ( const vgui_event  )  [virtual]

Handle all events sent to this tableau.

Key-press '?' prints info on this file, before being sent to the children.

Reimplemented from vgui_tableau.

Definition at line 69 of file bgui_selector_tableau.cxx.

vcl_string bgui_selector_tableau::type_name (  )  const [inline, virtual]

Returns the type of this tableau ('bgui_selector_tableau').

Reimplemented from vgui_tableau.

Definition at line 48 of file bgui_selector_tableau.h.

vcl_string bgui_selector_tableau::file_name (  )  const [virtual]

There is no obvious filename, so this just returns the type.

Reimplemented from vgui_tableau.

Definition at line 49 of file bgui_selector_tableau.cxx.

vcl_string bgui_selector_tableau::pretty_name (  )  const [virtual]

Returns a nice version of the name, including info on the children.

Reimplemented from vgui_tableau.

Definition at line 61 of file bgui_selector_tableau.cxx.

void bgui_selector_tableau::get_popup ( const vgui_popup_params ,
vgui_menu m 
) [virtual]

Builds a popup menu for the user to select the active child and set visibility.

Over-rides function in vgui_tableau.

Reimplemented from vgui_tableau.

Definition at line 380 of file bgui_selector_tableau.cxx.

void bgui_selector_tableau::add ( vgui_tableau_sptr const &  tab,
vcl_string  name = "" 
)

Add a tableau to the list of child tableaux.

Definition at line 143 of file bgui_selector_tableau.cxx.

void bgui_selector_tableau::remove ( vgui_tableau_sptr const &  tab  ) 

Remove a tableau from the list of child tableaux.

Definition at line 169 of file bgui_selector_tableau.cxx.

bool bgui_selector_tableau::remove ( const vcl_string  name  ) 

Remove a tableau from the list of child tableaux by name.

Definition at line 177 of file bgui_selector_tableau.cxx.

void bgui_selector_tableau::clear (  ) 

Clear the list of child tableaux.

Definition at line 208 of file bgui_selector_tableau.cxx.

vgui_tableau_sptr bgui_selector_tableau::active_tableau (  )  const

Returns a smart pointer to the active tableau.

Definition at line 218 of file bgui_selector_tableau.cxx.

const vcl_string& bgui_selector_tableau::active_name (  )  const [inline]

Returns the name of the active tableau.

Definition at line 76 of file bgui_selector_tableau.h.

vgui_tableau_sptr bgui_selector_tableau::get_tableau ( const vcl_string &  name  )  const

Returns a smart pointer to the tableau with the given name.

Definition at line 227 of file bgui_selector_tableau.cxx.

void bgui_selector_tableau::set_active ( const vcl_string &  name  ) 

Make the child tableau with the given name the active child.

Definition at line 270 of file bgui_selector_tableau.cxx.

bool bgui_selector_tableau::toggle ( const vcl_string &  name  ) 

Toggle the child tableau with the given name between visible/invisible.

Definition at line 250 of file bgui_selector_tableau.cxx.

bool bgui_selector_tableau::is_visible ( const vcl_string &  name  )  const

Returns true if the child tableau with the given name is active.

Definition at line 261 of file bgui_selector_tableau.cxx.

void bgui_selector_tableau::active_to_top (  ) 

Move the active tableau to the top of the display list.

Definition at line 302 of file bgui_selector_tableau.cxx.

void bgui_selector_tableau::active_raise (  ) 

Move the active tableau up one position in the display list.

Definition at line 278 of file bgui_selector_tableau.cxx.

void bgui_selector_tableau::active_lower (  ) 

Move the active tableau down one position in the display list.

Definition at line 290 of file bgui_selector_tableau.cxx.

void bgui_selector_tableau::active_to_bottom (  ) 

Move the active tableau to the bottom of the display list.

Definition at line 315 of file bgui_selector_tableau.cxx.

int bgui_selector_tableau::num_children (  )  const [inline]

Returns the number of children.

Definition at line 103 of file bgui_selector_tableau.h.

const vcl_vector<vcl_string>& bgui_selector_tableau::child_names (  )  const [inline]

Returns a vector containing the names of all children (in rendering order).

Definition at line 106 of file bgui_selector_tableau.h.

virtual void bgui_selector_tableau::add_to_menu ( vgui_menu  )  [inline, virtual]

for subclasses to add additional menus.

Definition at line 109 of file bgui_selector_tableau.h.

bool bgui_selector_tableau::get_bounding_box ( float  low[3],
float  high[3] 
) const [protected, virtual]

Returns a bounding box large enough to contain all child bounding boxes.

Reimplemented from vgui_tableau.

Definition at line 102 of file bgui_selector_tableau.cxx.

bool bgui_selector_tableau::add_child ( vgui_tableau_sptr const &  t  )  [protected, virtual]

Add to list of child tableaux.

virtual

Reimplemented from vgui_tableau.

Definition at line 161 of file bgui_selector_tableau.cxx.

bool bgui_selector_tableau::remove_child ( vgui_tableau_sptr const &   )  [protected, virtual]

Remove given tableau from list of child tableaux.

Reimplemented from vgui_tableau.

Definition at line 236 of file bgui_selector_tableau.cxx.


Member Data Documentation

vcl_map<vcl_string, bool> bgui_selector_tableau::visible_ [protected]

Whether each child is visible or not (ie. using events).

Definition at line 128 of file bgui_selector_tableau.h.

vcl_vector<vcl_string> bgui_selector_tableau::render_order_ [protected]

The unique child names sorted in rendering order.

Definition at line 131 of file bgui_selector_tableau.h.

vcl_map<vcl_string, vgui_parent_child_link> bgui_selector_tableau::child_map_ [protected]

A map from unique names to children.

Definition at line 134 of file bgui_selector_tableau.h.

vcl_string bgui_selector_tableau::active_child_ [protected]

The name of the active tableau.

Definition at line 137 of file bgui_selector_tableau.h.


The documentation for this class was generated from the following files:
Generated on Wed Dec 3 05:21:27 2008 for contrib/brl/bbas/bgui by  doxygen 1.5.1