Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
vgui_grid_tableau Class Reference

A tableau which renders its child tableaux as a rectangular grid. More...

#include <vgui_grid_tableau.h>

Inheritance diagram for vgui_grid_tableau:
Inheritance graph
[legend]

List of all members.

Public Types

typedef vgui_grid_tableau_data grid_data
typedef vcl_vector< itemcontainer
typedef container::iterator iterator
typedef container::const_iterator const_iterator

Public Member Functions

vcl_string type_name () const
 Returns the type name of the tableau ("vgui_grid_tableau" in this case).
 vgui_grid_tableau (unsigned initial_columns=1, unsigned initial_rows=1)
 Constructor - don't use this, use vgui_grid_tableau_new.
 vgui_grid_tableau (vgui_tableau_sptr const &l, vgui_tableau_sptr const &r)
 Constructor - don't use this, use vgui_grid_tableau_new.
 vgui_grid_tableau (vgui_tableau_sptr const &l, vgui_tableau_sptr const &m, vgui_tableau_sptr const &r)
 Constructor - don't use this, use vgui_grid_tableau_new.
float get_x (unsigned index)
 Given the column number, returns the x coord for that column.
float get_y (unsigned index)
 Given the row number, returns the y coord for that row.
float get_w ()
 Get the width of each column.
float get_h ()
 Get the height of each row.
void add_next (vgui_tableau_sptr const &tab)
 Adds a tableau to the next free space in the grid and the list of tableaux.
void add_next (vgui_tableau_sptr const &tab, unsigned &col, unsigned &row)
 Adds a tableau to the next free space and returns the grid location.
void add_at (vgui_tableau_sptr const &tab, unsigned col_pos, unsigned row_pos)
 Add (or replace the tableau at the given position with) the given tableau.
void remove_at (unsigned col_pos, unsigned row_pos)
 Removes the tableau at the given grid coordinates from the display.
unsigned rows () const
 Returns the number of rows in the grid.
unsigned cols () const
 Returns the number of columns in the grid.
vgui_tableau_sptr get_tableau_at (unsigned col_pos, unsigned row_pos)
 Returns a pointer to the tableau at the given position.
vcl_vector< vgui_tableau_sptrget_tableau_list ()
 Returns the list of tableaux.
void get_active_position (unsigned *col_pos, unsigned *row_pos)
 Returns the active tableau, this is the tableau with the mouse in.
void get_last_selected_position (unsigned *col_pos, unsigned *row_pos)
 Returns the most recently selected column and row positions.
int get_selected_positions (vcl_vector< int > *col_pos, vcl_vector< int > *row_pos, vcl_vector< int > *times)
 Gets the positions and times of selection of the selected tableaux.
void set_selected (int r, int c, bool onoff=true)
 Select a certain tableau.
void set_grid_size_changeable (bool v)
 True to allow the grid size to change, false to have fixed size.
void set_uses_paging_events (bool v)
 True to use paging events, false to ignore them.
void set_frames_selectable (bool v)
 True to use mouse down events, false to ignore them.
void set_unique_selected (bool u)
 Only allow one grid cell to be selected at a time, others are deselected.
void emulate_ntab ()
 Use this to emulate the deprecated bitab and tritab:.
void layout_grid ()
 Redraw the grid keeping each tableau in its current row and column.
void layout_grid2 ()
 Redraw the grid of tableaux packing them in without gaps.
void add_column ()
 Add an empty column to the RHS of the grid.
void remove_column ()
 Remove last column on RHS of the grid.
void add_row ()
 Add an empty row to the bottom of the grid.
void remove_row ()
 Remove last row on the bottom of the grid.
void page_up ()
 Flip forwards through the list of tableaux.
void page_down ()
 Flip backwards through the list of tableaux.
bool handle (const vgui_event &)
 Handle any events matching the {vgui_event_condition}s.
bool cell_bounding_box (unsigned col, unsigned row, float &xmin, float &ymin, float &xmax, float &ymax)
 Window coordinates of the cell bounding box at col, row.
void get_popup (vgui_popup_params const &, vgui_menu &)
 Get popup menu.
unsigned size () const
 Returns the number of items in the list of items.
iterator begin ()
 Return an iterator pointing to the first item in the list of items.
const_iterator begin () const
 Return a const iterator pointing to the first item in the list of items.
iterator end ()
 Return an iterator pointing to the last item in the list of items.
const_iterator end () const
 Return a const iterator pointing to the last item in the list of items.
void erase (iterator)
 Erase the item at the given position from the list of items.
int add (vgui_tableau_sptr const &, float x, float y, float w, float h)
 Adds the given tableau to the given proportion of the viewport.
void remove (int id)
 Remove subtableau, referred to by handle.
void move (int id, float x, float y, float w, float h)
 Move subtableau to a new location.
void replace (int id, vgui_tableau_sptr const &tab)
 Replace the tableau with the given ID, with the given tableau.
vgui_tableau_sptr get (int id) const
 Get pointer to tableau from id.
void set_outline_color (const int id, const int r, const int g, const int b)
 Set color to outline 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 post_message (char const *, void const *)
 Post a message event.
virtual void post_redraw ()
 Post a draw event.
virtual void post_overlay_redraw ()
 Post an 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_grid_tableau ()
 Destructor - called by vgui_grid_tableau_sptr.
bool handle (GLint const vp[4], vgui_event const &e)
 Handles events for this tableau and passes unused ones to the correct child.
int get_active (GLint const vp[4], int wx, int wy) const
 Misnomer - returns the index of child under the pointer's position.
int get_current () const
int get_current_id ()
 Returns the ID of the current child.
void set_current (GLint const vp[4], int index)
 Sets the child under the pointer to current.

Protected Attributes

int current
 Index of the item currently getting events.
vcl_vector< itemsub
 List of items displayed by this tableau.
bool may_switch_child

Private Member Functions

void init (unsigned initial_cols, unsigned initial_rows)
 Initialisation called by all constructors.
void add_default (unsigned col_pos, unsigned row_pos)
 Adds the default tableau to the given space in the grid.
void select_current (int time)
 Make the current tableau selected by saving the current time.
void deselect_current ()
 Mark the current table as deselected by setting the time to -1.

Private Attributes

vgui_event_condition cond_row_add
vgui_event_condition cond_row_remove
vgui_event_condition cond_col_add
vgui_event_condition cond_col_remove
vgui_event_condition cond_flip_fwd
vgui_event_condition cond_flip_bwd
vgui_event_condition cond_select
vgui_event_condition cond_deselect
int INCREMENT_COLS
int INCREMENT_ROWS
bool grid_size_changeable
unsigned nb_cols
unsigned max_cols
unsigned nb_rows
unsigned max_rows
unsigned last_selected [2]
bool unique_selected_
vgui_tableau_sptr default_tab
vcl_vector< vgui_tableau_sptrtabs
vbl_array_2d< grid_datagrid_pos

Detailed Description

A tableau which renders its child tableaux as a rectangular grid.

It is derived from vgui_poly_tableau but unlike vgui_poly_tableau, the child tableaux of vgui_grid_tableau can only be laid out in an m by n rectangular grid. Rows and columns are numbered starting from 0 with (0,0) in the top left and (m-1,n-1) in the bottom right.

The default behaviour of vgui_grid is to keep a list of every tableau added to the grid (using add_next to add to the next free position or add_at to add at a specific grid position). Users can flip through this list of tableaux, 'tabs', by clicking in the grid position they wish to change, and using PageUp and PageDown to go through the list. When a new tableau is added using add_at the old tableau at that position is kept in the 'tabs' list and can still be viewed by using PageUp and PageDown. Each grid position provides a view of the deck of tableaux kept in 'tabs'. A tableau will only be removed from 'tabs' by using remove_at.

By default, the user can make the grid larger or smaller by using (CTRL) + and - to add and remove (rows and) columns.

These default behaviours can be changed using set_uses_paging_events and set_grid_size_changeable. This stops vgui_grid using the events, but still passes them down to the child tableaux. By disabling PageUp and PageDown you can prevent users from changing the displayed tableau - this could also be useful if you want to show two vgui_deck tableau and so want the PageUp and PageDown events to pass through vgui_grid and be used by the child decks. Disabling plus and minus events gives a grid tableau of fixed size.

This tableau was originally written for xcv, so look at this application to get a better idea what it does.

Definition at line 71 of file vgui_grid_tableau.h.


Member Typedef Documentation

typedef container::const_iterator vgui_poly_tableau::const_iterator [inherited]

Definition at line 108 of file vgui_poly_tableau.h.

typedef vcl_vector<item> vgui_poly_tableau::container [inherited]

Definition at line 106 of file vgui_poly_tableau.h.

Definition at line 74 of file vgui_grid_tableau.h.

typedef container::iterator vgui_poly_tableau::iterator [inherited]

Definition at line 107 of file vgui_poly_tableau.h.


Constructor & Destructor Documentation

vgui_grid_tableau::vgui_grid_tableau ( unsigned  initial_columns = 1,
unsigned  initial_rows = 1 
) [inline]

Constructor - don't use this, use vgui_grid_tableau_new.

Takes the initial number of columns and rows.

Definition at line 81 of file vgui_grid_tableau.h.

vgui_grid_tableau::vgui_grid_tableau ( vgui_tableau_sptr const &  l,
vgui_tableau_sptr const &  r 
)

Constructor - don't use this, use vgui_grid_tableau_new.

Makes a bitab.

This creates a bi-tab, taking the two tableaux as parameters.

Definition at line 64 of file vgui_grid_tableau.cxx.

vgui_grid_tableau::vgui_grid_tableau ( vgui_tableau_sptr const &  l,
vgui_tableau_sptr const &  m,
vgui_tableau_sptr const &  r 
)

Constructor - don't use this, use vgui_grid_tableau_new.

Makes a tritab.

This creates a tri-tab, taking the three tableau as parameters.

Definition at line 73 of file vgui_grid_tableau.cxx.

vgui_grid_tableau::~vgui_grid_tableau ( ) [inline, protected]

Destructor - called by vgui_grid_tableau_sptr.

Definition at line 207 of file vgui_grid_tableau.h.


Member Function Documentation

int vgui_poly_tableau::add ( vgui_tableau_sptr const &  t,
float  x,
float  y,
float  w,
float  h 
) [inherited]

Adds the given tableau to the given proportion of the viewport.

x,y,w,h specify a portion of the vgui_poly_tableau's viewport in coordinates which go from 0 to 1. Returns handle to child.

x,y,w,h specify a portion of the vgui_poly_tableau's viewport in coordinates which go from 0 to 1.

Definition at line 176 of file vgui_poly_tableau.cxx.

void vgui_grid_tableau::add_at ( vgui_tableau_sptr const &  tab,
unsigned  col_pos,
unsigned  row_pos 
)

Add (or replace the tableau at the given position with) the given tableau.

Adds the given tableau to the end of the vcl_list of tableaux.

Definition at line 200 of file vgui_grid_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_selector_tableau, vgui_deck_tableau, and vgui_wrapper_tableau.

Definition at line 284 of file vgui_tableau.cxx.

void vgui_grid_tableau::add_column ( )

Add an empty column to the RHS of the grid.

Definition at line 425 of file vgui_grid_tableau.cxx.

void vgui_grid_tableau::add_default ( unsigned  col_pos,
unsigned  row_pos 
) [private]

Adds the default tableau to the given space in the grid.

Adds the default tableau to the given space in the grid (but not to the vcl_list of tableaux).

(but not to the vcl_list of tableaux).

Note, it is assumed that the given grid position is empty or uninitialized so nothing is removed from the grid position before the default is added.

Definition at line 123 of file vgui_grid_tableau.cxx.

void vgui_grid_tableau::add_next ( vgui_tableau_sptr const &  tab)

Adds a tableau to the next free space in the grid and the list of tableaux.

Definition at line 191 of file vgui_grid_tableau.cxx.

void vgui_grid_tableau::add_next ( vgui_tableau_sptr const &  tab,
unsigned &  col,
unsigned &  row 
)

Adds a tableau to the next free space and returns the grid location.

Adds a tableau to the next free space in the grid and to the end of the vcl_list of tableaux.

If there are no free spaces and the grid size is changeable then it adds a new column to the RHS of the grid and adds the new tableau to the top of it.

Definition at line 140 of file vgui_grid_tableau.cxx.

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

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

Add given menu to the tableau popup menu.

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_satellite_tableau_t< object, data >, vgui_active_tableau, and vgui_clear_tableau.

Definition at line 316 of file vgui_tableau.cxx.

void vgui_grid_tableau::add_row ( )

Add an empty row to the bottom of the grid.

Definition at line 464 of file vgui_grid_tableau.cxx.

iterator vgui_poly_tableau::begin ( ) [inline, inherited]

Return an iterator pointing to the first item in the list of items.

Definition at line 114 of file vgui_poly_tableau.h.

const_iterator vgui_poly_tableau::begin ( ) const [inline, inherited]

Return a const iterator pointing to the first item in the list of items.

Definition at line 117 of file vgui_poly_tableau.h.

bool vgui_grid_tableau::cell_bounding_box ( unsigned  col,
unsigned  row,
float &  xmin,
float &  ymin,
float &  xmax,
float &  ymax 
)

Window coordinates of the cell bounding box at col, row.

Returns the bounds of the grid cell in screen coordinates at the specified col and row.

The computation is based on dividing the entire viewport by the number of row and columns.

Definition at line 282 of file vgui_grid_tableau.cxx.

unsigned vgui_grid_tableau::cols ( ) const [inline]

Returns the number of columns in the grid.

Definition at line 121 of file vgui_grid_tableau.h.

void vgui_grid_tableau::deselect_current ( ) [private]

Mark the current table as deselected by setting the time to -1.

Set the outline color to white.

Definition at line 598 of file vgui_grid_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 176 of file vgui_tableau.cxx.

void vgui_grid_tableau::emulate_ntab ( ) [inline]

Use this to emulate the deprecated bitab and tritab:.

Definition at line 167 of file vgui_grid_tableau.h.

iterator vgui_poly_tableau::end ( ) [inline, inherited]

Return an iterator pointing to the last item in the list of items.

Definition at line 120 of file vgui_poly_tableau.h.

const_iterator vgui_poly_tableau::end ( ) const [inline, inherited]

Return a const iterator pointing to the last item in the list of items.

Definition at line 123 of file vgui_poly_tableau.h.

void vgui_poly_tableau::erase ( iterator  i) [inherited]

Erase the item at the given position from the list of items.

Definition at line 93 of file vgui_poly_tableau.cxx.

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

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

Definition at line 385 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_easy2D_tableau, vgui_deck_tableau, vgui_composite_tableau, vgui_blender_tableau, vgui_roi_tableau, vgui_enhance_tableau, vgui_selector_tableau, vgui_image_tableau, vgui_wrapper_tableau, and vgui_vrml_tableau.

Definition at line 93 of file vgui_tableau.h.

vgui_tableau_sptr vgui_poly_tableau::get ( int  id) const [inherited]

Get pointer to tableau from id.

Returns the tableau with the given ID.

Definition at line 150 of file vgui_poly_tableau.cxx.

int vgui_poly_tableau::get_active ( GLint const  vp[4],
int  wx,
int  wy 
) const [protected, inherited]

Misnomer - returns the index of child under the pointer's position.

Misnomer - gets index of the child currently under the pointer's position.

Definition at line 195 of file vgui_poly_tableau.cxx.

void vgui_grid_tableau::get_active_position ( unsigned *  col_pos,
unsigned *  row_pos 
)

Returns the active tableau, this is the tableau with the mouse in.

Note that there is only one active tableau, while there may be many selected tableaux.

Definition at line 301 of file vgui_grid_tableau.cxx.

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

Push all tableaux onto the given vector.

Definition at line 376 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.

Return 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.

If infinite in extent, or nothing is drawn, or you can't be bothered to implement it, return false.

Reimplemented in vgui_composite_tableau, vgui_selector_tableau, vgui_image_tableau, vgui_roi_tableau, and vgui_wrapper_tableau.

Definition at line 198 of file vgui_tableau.cxx.

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

Get the ith child or return 0.

Get the ith child, or return 0.

Definition at line 274 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.

Push children onto the given vcl_vector.

Definition at line 267 of file vgui_tableau.cxx.

int vgui_poly_tableau::get_current ( ) const [inline, protected, inherited]

Definition at line 164 of file vgui_poly_tableau.h.

int vgui_poly_tableau::get_current_id ( ) [protected, inherited]

Returns the ID of the current child.

Definition at line 206 of file vgui_poly_tableau.cxx.

float vgui_grid_tableau::get_h ( )

Get the height of each row.

Definition at line 117 of file vgui_grid_tableau.cxx.

void vgui_grid_tableau::get_last_selected_position ( unsigned *  col_pos,
unsigned *  row_pos 
)

Returns the most recently selected column and row positions.

Definition at line 329 of file vgui_grid_tableau.cxx.

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

Get the parent tableaux for this tableau.

Push parents onto the given vcl_vector.

Definition at line 260 of file vgui_tableau.cxx.

void vgui_poly_tableau::get_popup ( vgui_popup_params const &  params,
vgui_menu menu 
) [virtual, inherited]

Get popup menu.

Reimplemented from vgui_tableau.

Definition at line 368 of file vgui_poly_tableau.cxx.

int vgui_grid_tableau::get_selected_positions ( vcl_vector< int > *  col_pos,
vcl_vector< int > *  row_pos,
vcl_vector< int > *  times 
)

Gets the positions and times of selection of the selected tableaux.

The number of selected tableau is returned. Their positions are returned in the vcl_vectors passed in as parameters. Note, a tableau is selected if it has been clicked on by the left mouse button. It can be deselected by clicking with the middle mouse button.

Definition at line 355 of file vgui_grid_tableau.cxx.

vgui_tableau_sptr vgui_grid_tableau::get_tableau_at ( unsigned  col_pos,
unsigned  row_pos 
)

Returns a pointer to the tableau at the given position.

Definition at line 261 of file vgui_grid_tableau.cxx.

vcl_vector<vgui_tableau_sptr> vgui_grid_tableau::get_tableau_list ( ) [inline]

Returns the list of tableaux.

Definition at line 127 of file vgui_grid_tableau.h.

float vgui_grid_tableau::get_w ( )

Get the width of each column.

Definition at line 113 of file vgui_grid_tableau.cxx.

float vgui_grid_tableau::get_x ( unsigned  col_pos)

Given the column number, returns the x coord for that column.

Note col_pos is numbered from 0.

Definition at line 84 of file vgui_grid_tableau.cxx.

float vgui_grid_tableau::get_y ( unsigned  row_pos)

Given the row number, returns the y coord for that row.

Note row_pos is numbered from 0. Note that poly_tableau coord system starts in the bottom left and we want rows to be numbered from the top down.

Definition at line 100 of file vgui_grid_tableau.cxx.

bool vgui_poly_tableau::handle ( GLint const  vp[4],
vgui_event const &  e 
) [protected, inherited]

Handles events for this tableau and passes unused ones to the correct child.

Definition at line 241 of file vgui_poly_tableau.cxx.

bool vgui_grid_tableau::handle ( const vgui_event e) [virtual]

Handle any events matching the {vgui_event_condition}s.

All other events go to the base class.

Reimplemented from vgui_poly_tableau.

Definition at line 613 of file vgui_grid_tableau.cxx.

bool vgui_tableau::help ( ) [virtual, inherited]

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

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

Definition at line 166 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 185 of file vgui_tableau.cxx.

void vgui_grid_tableau::init ( unsigned  initial_cols,
unsigned  initial_rows 
) [private]

Initialisation called by all constructors.

Definition at line 24 of file vgui_grid_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.

Caled by default handle when it receives a key press event.

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

Definition at line 156 of file vgui_tableau.cxx.

void vgui_grid_tableau::layout_grid ( )

Redraw the grid keeping each tableau in its current row and column.

Redraw the grid of tableaux keeping each tableau in its current row and column.

If for example a new column had been added, using this would redraw the grid with that column empty.

Definition at line 380 of file vgui_grid_tableau.cxx.

void vgui_grid_tableau::layout_grid2 ( )

Redraw the grid of tableaux packing them in without gaps.

Redraw the grid of tableaux packing them in without gaps, filling each row from top left downwards.

Fill each row from top left downwards.

Definition at line 396 of file vgui_grid_tableau.cxx.

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

Called by handle when it receives a mouse motion event.

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

Reimplemented in vgui_listmanager2D_tableau, vgui_function_tableau, and vgui_displaylist2D_tableau.

Definition at line 146 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_listmanager2D_tableau, vgui_viewer2D_tableau, vgui_function_tableau, vgui_viewer3D_tableau, vgui_displaylist3D_tableau, and vgui_displaylist2D_tableau.

Definition at line 126 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_viewer2D_tableau, vgui_function_tableau, and vgui_viewer3D_tableau.

Definition at line 136 of file vgui_tableau.cxx.

void vgui_poly_tableau::move ( int  id,
float  x,
float  y,
float  w,
float  h 
) [inherited]

Move subtableau to a new location.

Definition at line 117 of file vgui_poly_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 90 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.

Called when a child of this tableau is 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 302 of file vgui_tableau.cxx.

void vgui_grid_tableau::page_down ( )

Flip backwards through the list of tableaux.

Definition at line 532 of file vgui_grid_tableau.cxx.

void vgui_grid_tableau::page_up ( )

Flip forwards through the list of tableaux.

Definition at line 502 of file vgui_grid_tableau.cxx.

void vgui_tableau::post_idle_request ( void  ) [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 235 of file vgui_tableau.cxx.

void vgui_tableau::post_message ( char const *  msg,
void const *  data 
) [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 205 of file vgui_tableau.cxx.

void vgui_tableau::post_overlay_redraw ( void  ) [virtual, inherited]

Post an overlay-redraw event.

Post an 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 225 of file vgui_tableau.cxx.

void vgui_tableau::post_redraw ( void  ) [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 215 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_easy2D_tableau, vgui_deck_tableau, vgui_composite_tableau, vgui_roi_tableau, vgui_image_tableau, vgui_selector_tableau, vgui_wrapper_tableau, and vgui_vrml_tableau.

Definition at line 97 of file vgui_tableau.h.

void vgui_tableau::ref ( ) const [inherited]

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

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

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

Definition at line 79 of file vgui_tableau.cxx.

void vgui_poly_tableau::remove ( int  id) [inherited]

Remove subtableau, referred to by handle.

Definition at line 105 of file vgui_poly_tableau.cxx.

void vgui_grid_tableau::remove_at ( unsigned  col_pos,
unsigned  row_pos 
)

Removes the tableau at the given grid coordinates from the display.

Removes the tableau at the given grid coordinates from the display and from the vcl_list of tableau.

It is replaced in the grid by the default tableau.

Definition at line 234 of file vgui_grid_tableau.cxx.

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

Remove the given child from the list of child tableaux.

Remove the given tableau from the list of child tableaux.

Reimplemented in vgui_composite_tableau, vgui_selector_tableau, vgui_deck_tableau, and vgui_wrapper_tableau.

Definition at line 291 of file vgui_tableau.cxx.

void vgui_grid_tableau::remove_column ( )

Remove last column on RHS of the grid.

Definition at line 446 of file vgui_grid_tableau.cxx.

void vgui_grid_tableau::remove_row ( )

Remove last row on the bottom of the grid.

Definition at line 484 of file vgui_grid_tableau.cxx.

void vgui_poly_tableau::replace ( int  id,
vgui_tableau_sptr const &  tab 
) [inherited]

Replace the tableau with the given ID, with the given tableau.

Replace the tableau with the given ID by the given tableau.

Keep the same ID and do not change the value of 'current'.

Definition at line 134 of file vgui_poly_tableau.cxx.

unsigned vgui_grid_tableau::rows ( ) const [inline]

Returns the number of rows in the grid.

Definition at line 118 of file vgui_grid_tableau.h.

void vgui_grid_tableau::select_current ( int  time) [private]

Make the current tableau selected by saving the current time.

Set the outline color to red.

Definition at line 563 of file vgui_grid_tableau.cxx.

void vgui_poly_tableau::set_current ( GLint const  vp[4],
int  index 
) [protected, inherited]

Sets the child under the pointer to current.

Definition at line 213 of file vgui_poly_tableau.cxx.

void vgui_grid_tableau::set_frames_selectable ( bool  v) [inline]

True to use mouse down events, false to ignore them.

Definition at line 158 of file vgui_grid_tableau.h.

void vgui_grid_tableau::set_grid_size_changeable ( bool  v) [inline]

True to allow the grid size to change, false to have fixed size.

Definition at line 143 of file vgui_grid_tableau.h.

void vgui_poly_tableau::set_outline_color ( const int  id,
const int  r,
const int  g,
const int  b 
) [inherited]

Set color to outline tableau.

Sets the color that the tableau is outlined with .

Definition at line 160 of file vgui_poly_tableau.cxx.

void vgui_grid_tableau::set_selected ( int  r,
int  c,
bool  onoff = true 
)

Select a certain tableau.

Definition at line 338 of file vgui_grid_tableau.cxx.

void vgui_grid_tableau::set_unique_selected ( bool  u) [inline]

Only allow one grid cell to be selected at a time, others are deselected.

Definition at line 164 of file vgui_grid_tableau.h.

void vgui_grid_tableau::set_uses_paging_events ( bool  v) [inline]

True to use paging events, false to ignore them.

Definition at line 152 of file vgui_grid_tableau.h.

unsigned vgui_poly_tableau::size ( ) const [inline, inherited]

Returns the number of items in the list of items.

Definition at line 111 of file vgui_poly_tableau.h.

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

Returns the type name of the tableau ("vgui_grid_tableau" in this case).

Reimplemented from vgui_poly_tableau.

Definition at line 77 of file vgui_grid_tableau.h.

void vgui_tableau::unref ( ) const [inherited]

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

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.

If the reference count reaches zero then delete the object.

Definition at line 87 of file vgui_tableau.cxx.


Member Data Documentation

Definition at line 213 of file vgui_grid_tableau.h.

Definition at line 214 of file vgui_grid_tableau.h.

Definition at line 222 of file vgui_grid_tableau.h.

Definition at line 218 of file vgui_grid_tableau.h.

Definition at line 217 of file vgui_grid_tableau.h.

Definition at line 211 of file vgui_grid_tableau.h.

Definition at line 212 of file vgui_grid_tableau.h.

Definition at line 221 of file vgui_grid_tableau.h.

int vgui_poly_tableau::current [protected, inherited]

Index of the item currently getting events.

Definition at line 169 of file vgui_poly_tableau.h.

Definition at line 235 of file vgui_grid_tableau.h.

Definition at line 238 of file vgui_grid_tableau.h.

Definition at line 227 of file vgui_grid_tableau.h.

Definition at line 224 of file vgui_grid_tableau.h.

Definition at line 225 of file vgui_grid_tableau.h.

unsigned vgui_grid_tableau::last_selected[2] [private]

Definition at line 233 of file vgui_grid_tableau.h.

unsigned vgui_grid_tableau::max_cols [private]

Definition at line 230 of file vgui_grid_tableau.h.

unsigned vgui_grid_tableau::max_rows [private]

Definition at line 232 of file vgui_grid_tableau.h.

bool vgui_poly_tableau::may_switch_child [protected, inherited]

Definition at line 174 of file vgui_poly_tableau.h.

unsigned vgui_grid_tableau::nb_cols [private]

Definition at line 229 of file vgui_grid_tableau.h.

unsigned vgui_grid_tableau::nb_rows [private]

Definition at line 231 of file vgui_grid_tableau.h.

vcl_vector<item> vgui_poly_tableau::sub [protected, inherited]

List of items displayed by this tableau.

Definition at line 172 of file vgui_poly_tableau.h.

Definition at line 237 of file vgui_grid_tableau.h.

Definition at line 234 of file vgui_grid_tableau.h.


The documentation for this class was generated from the following files: