#include <MPxUITableControl.h>
MPxUITableControl is the base class for creating new spreadsheet like interfaces. Every UI control has an associated command that is 'in-charge' of that control. Therefore, when creating a new table control, you will need to create an associated MPxControlCommand. Please refer to the MPxControlCommand documentation for details on how to use these class together.
At a minimum, when creating a new table control, you must overload getCell( ... ). Other methods available for overloading are getLabel(...), allowEdit( ... ), allowSelection( ... ), and collapseOrExpandRow( ... ).
Public Types | |
enum | MLabelType { kNoLabel, kRowLabel, kColumnLabel, kAllLabels } |
Types of labels available in the control. More... | |
Public Member Functions | |
MPxUITableControl (MPxControlCommand &) | |
virtual | ~MPxUITableControl () |
MStatus | redrawLabels (MLabelType lt=kAllLabels) |
MStatus | redrawCells () |
MStatus | addToSelection (unsigned int row, unsigned int col) |
MStatus | removeFromSelection (unsigned int row, unsigned int column) |
MStatus | clearSelection () |
MStatus | setSelection (unsigned int row, unsigned int column) |
MStatus | setSelection (unsigned int firstRow, unsigned int lastRow, unsigned int firstCol, unsigned int lastCol) |
MStatus | setNumberOfRows (unsigned int count) |
unsigned int | numberOfRows (MStatus *ReturnStatus=NULL) |
MStatus | setNumberOfColumns (unsigned int count) |
unsigned int | numberOfColumns (MStatus *ReturnStatus=NULL) const |
bool | suspendUpdates (bool update, MStatus *ReturnStatue=NULL) |
bool | isSelected (unsigned int row, unsigned int col, MStatus *status=NULL) |
virtual bool | collapseOrExpandRow (unsigned int row) |
Protected Member Functions | |
virtual MString | cellString (unsigned int r, unsigned int c, bool &ValidCell) |
virtual MString | labelString (MLabelType labelType, unsigned int n) |
virtual bool | getCell (unsigned int r, unsigned int c, MString &value) |
NO SCRIPT SUPPORT. | |
virtual void | getLabel (MLabelType labelType, unsigned int n, MString &value) |
NO SCRIPT SUPPORT. | |
virtual bool | allowEdit () const |
virtual bool | allowSelection (int top, int left, int bottom, int right) |
Friends | |
class | MPxControlCommand |
MPxUITableControl::MPxUITableControl | ( | MPxControlCommand & | command | ) |
Class constructor. You will always need to provide a constructor that takes a control command instance as an argument, and it is illegal to define your standard constructors.
MPxUITableControl::~MPxUITableControl | ( | ) | [virtual] |
Class destructor.
MStatus MPxUITableControl::redrawLabels | ( | MPxUITableControl::MLabelType | labelType = kAllLabels |
) |
Tells the table control to redraw the label entries.
[in] | labelType | Specifies which labels to redraw. |
MStatus MPxUITableControl::redrawCells | ( | ) |
Tells the UI control to redraw the cells of the table. The table control maintains a database of cell entries and it will populate these entries using getCell interface.
MStatus MPxUITableControl::addToSelection | ( | unsigned int | row, | |
unsigned int | col | |||
) |
Add the follow cell to the selection data structure. To keep track of which entries that should be highlighted, an internal table is maintained.
[in] | row | table row entry. |
[in] | col | table col entry. |
MStatus MPxUITableControl::removeFromSelection | ( | unsigned int | row, | |
unsigned int | column | |||
) |
Removes the specified cell entry from the internal selection list.
[in] | row | cell row entry |
[in] | column | cell column entry |
MStatus MPxUITableControl::clearSelection | ( | ) |
Clears the selection table. This will remove all highlighted cells from the table.
MStatus MPxUITableControl::setSelection | ( | unsigned int | row, | |
unsigned int | column | |||
) |
Sets the table selection list based on the row & column entry. This replaces the current selection list with the new entry.
[in] | row | cell row entry |
[in] | column | cell column entry |
MStatus MPxUITableControl::setSelection | ( | unsigned int | firstRow, | |
unsigned int | lastRow, | |||
unsigned int | firstCol, | |||
unsigned int | lastCol | |||
) |
Sets the selection to be the range of cells specified. This replaces the current selection with the specified selection range.
[in] | firstRow | first row of the selection |
[in] | lastRow | last row of the selection |
[in] | firstCol | first column of the selection |
[in] | lastCol | last column of the selection |
MStatus MPxUITableControl::setNumberOfRows | ( | unsigned int | count | ) |
Specifies the number of rows for the table.
[in] | count | number of rows desired. |
unsigned int MPxUITableControl::numberOfRows | ( | MStatus * | ReturnStatus = NULL |
) |
Returns the number of rows in the table.
[out] | ReturnStatus | Status of the call. |
MStatus MPxUITableControl::setNumberOfColumns | ( | unsigned int | count | ) |
Specifies the number of columns for the table.
[in] | count | number of columns desired. |
unsigned int MPxUITableControl::numberOfColumns | ( | MStatus * | ReturnStatus = NULL |
) | const |
Returns the number of columns in the table.
[out] | ReturnStatus | status of the call. |
bool MPxUITableControl::suspendUpdates | ( | bool | update, | |
MStatus * | ReturnStatus = NULL | |||
) |
When set to true, it prevents the UI from updating the table. The old suspend status is returned.
[in] | update | state the new suspend status. |
[out] | ReturnStatus | status of the call. |
bool MPxUITableControl::isSelected | ( | unsigned int | row, | |
unsigned int | col, | |||
MStatus * | ReturnStatus = NULL | |||
) |
Returns true if the specified cell is selected.
[in] | row | cell row position. |
[in] | col | cell col position. |
bool MPxUITableControl::collapseOrExpandRow | ( | unsigned int | row | ) | [virtual] |
This is called when a row should be collapsed or expanded (depending on its current state).
[in] | row | the row to collapse. |
MString MPxUITableControl::cellString | ( | unsigned int | r, | |
unsigned int | c, | |||
bool & | isValidCell | |||
) | [protected, virtual] |
Derived classes MUST either override this method or the cellString method. It is used to describe the contents of a cell.
[in] | r | row index |
[in] | c | column index |
[in] | isValidCell | the value of the specified table entry. |
MString MPxUITableControl::labelString | ( | MLabelType | labelType, | |
unsigned int | n | |||
) | [protected, virtual] |
Specifies the label value for the given row or column (as defined by) MLabelType. The base implementation of the method always returns an empty string.
[in] | labelType | is it a row or column label |
[in] | n | row or column entry |
bool MPxUITableControl::getCell | ( | unsigned int | row, | |
unsigned int | column, | |||
MString & | value | |||
) | [protected, virtual] |
NO SCRIPT SUPPORT.
Derived classes MUST either override this method or the cellString method. It is used to describe the contents of a cell.
Python Notes
This method is not supported in Python. See the cellString() function which returns a string.
[in] | row | row index |
[in] | column | column index |
[in] | value | the value of the specified table entry. |
void MPxUITableControl::getLabel | ( | MLabelType | labelType, | |
unsigned int | n, | |||
MString & | value | |||
) | [protected, virtual] |
NO SCRIPT SUPPORT.
Specifies the label value for the given row or column (as defined by) MLabelType. The base implementation of the method always returns an empty string.
Python Notes
This method is not supported in Python. See the labelString() function which returns a string.
[in] | labelType | is it a row or column label |
[in] | n | row or column entry |
[in] | value | the string value of the label. |
bool MPxUITableControl::allowEdit | ( | ) | const [protected, virtual] |
Tells the base UI table control class if this control is editable. It is possible to implement tables that simple display information and do not allow the user to edit them.
bool MPxUITableControl::allowSelection | ( | int | top, | |
int | left, | |||
int | bottom, | |||
int | right | |||
) | [protected, virtual] |
This method is called when a selection occurs. In this base implementation it always returns true. However, this method can be overridden to allow or disallow a selection.
[in] | top | top cell coordinate |
[in] | left | left cell coordinate |
[in] | bottom | bottom cell coordinate |
[in] | right | right cell coordinate |
Autodesk® Maya® 2009 © 1997-2008 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |