ICS

QicsTable Documentation Set

QicsSelection Class Reference

Represents a single, contiguous selection. More...

#include <QicsSelection.h>

List of all members.

Public Member Functions

 QicsSelection ()
 QicsSelection (int anchor_row, int anchor_col, int end_row, int end_col, bool select_state=true)
 QicsSelection (int anchor_row, int anchor_col, int start_row, int start_col, int end_row, int end_col, bool select_state=true)
 QicsSelection (const QicsSelection &sel)
void setSelected (bool set)
bool selected (void) const
bool isValid (void) const
void setAnchorRow (int anchor_row)
void setAnchorColumn (int anchor_col)
void setAnchorCell (int anchor_row, int anchor_col)
void setStartRow (int start_row)
void setStartColumn (int start_col)
void setStartCell (int start_row, int start_col)
void setEndRow (int end_row)
void setEndColumn (int end_col)
void setEndCell (int end_row, int end_col)
int anchorRow (void) const
int anchorColumn (void) const
int startRow (void) const
int startColumn (void) const
int endRow (void) const
int endColumn (void) const
int topRow (void) const
int leftColumn (void) const
int bottomRow (void) const
int rightColumn (void) const
int numColumns (void) const
int numRows (void) const
void setEntireRow (int row)
void setEntireColumn (int col)
bool intersects (const QicsSelection &sel)
bool contains (int row, int col) const
QicsSelection operator & (const QicsSelection &sel)
QicsSelection intersect (const QicsSelection &sel)
QicsSelection operator| (const QicsSelection &sel)
QicsSelectionoperator|= (const QicsSelection &sel)

Protected Attributes

bool mySelectState
int myAnchorRow
int myAnchorCol
int myStartRow
int myStartCol
int myEndRow
int myEndCol

Related Functions

(Note that these are not member functions.)

QICS_EXPORT bool operator== (const QicsSelection &r1, const QicsSelection &r2)
QICS_EXPORT bool operator!= (const QicsSelection &r1, const QicsSelection &r2)


Detailed Description

Represents a single, contiguous selection.

QicsSelection represents a single, contiguous selection in the QicsTable widget. A QicsSelection consists of an anchor cell, where the selection begins, and an end cell, where the cell ends. The end cell indices are not necessarily greater than the anchor cell (i.e. it is valid for the anchor cell to be (5,5) and the end cell to be (0,0)).

If an entire row is selected, leftColumn() will be set to 0, and rightColumn() will be set to QicsLAST_COLUMN. Similarly, if and entire column is selected, topRow() will be set to 0, and bottomRow() will be set to QicsLAST_ROW.

This class is used by QicsTable to define table selections. A complete table selection consists of a list of selection objects (QicsSelectionList).

In some cases, a QicsSelection object may represent an "unselection". This can occur if a user control-clicks in an already selected cell. If this happens, this type of selection is indicated by the selected() property returning false.


Constructor & Destructor Documentation

QicsSelection::QicsSelection (  ) 

Constructor that creates an empty selection

QicsSelection::QicsSelection ( int  anchor_row,
int  anchor_col,
int  end_row,
int  end_col,
bool  select_state = true 
)

Constructs a selection from (anchor_row, anchor_col ) to (end_row, end_col ). If select_state is false, this "selection" represents an action by the user that has caused these cells to be unselected.

QicsSelection::QicsSelection ( int  anchor_row,
int  anchor_col,
int  start_row,
int  start_col,
int  end_row,
int  end_col,
bool  select_state = true 
)

Constructs a selection from (start_row, start_col) to (end_row, end_col) with anchor in (anchor_row, anchor_col). If select_state is false, this "selection" represents an action by the user that has caused these cells to be unselected.

QicsSelection::QicsSelection ( const QicsSelection sel  ) 

Constructs for the class


Member Function Documentation

void QicsSelection::setSelected ( bool  set  )  [inline]

Sets whether the cells in this selection have been selected or unselected.

bool QicsSelection::selected ( void   )  const [inline]

Returns whether the cells in this selection have been selected or unselected.

bool QicsSelection::isValid ( void   )  const

Returns true if the selection is valid, or false if it is not valid.

void QicsSelection::setAnchorRow ( int  anchor_row  ) 

Sets the row index of the anchor cell in the selection.

void QicsSelection::setAnchorColumn ( int  anchor_col  ) 

Sets the column index of the anchor cell in the selection.

void QicsSelection::setAnchorCell ( int  anchor_row,
int  anchor_col 
)

Sets the row and column indices of the anchor cell in the selection.

void QicsSelection::setStartRow ( int  start_row  ) 

Sets the row index of the end cell in the selection.

Since:
2.2

void QicsSelection::setStartColumn ( int  start_col  ) 

Sets the column index of the end cell in the selection.

Since:
2.2

void QicsSelection::setStartCell ( int  start_row,
int  start_col 
)

Sets the row and column indices of the end cell in the selection.

Since:
2.2

void QicsSelection::setEndRow ( int  end_row  ) 

Sets the row index of the end cell in the selection.

void QicsSelection::setEndColumn ( int  end_col  ) 

Sets the column index of the end cell in the selection.

void QicsSelection::setEndCell ( int  end_row,
int  end_col 
)

Sets the row and column indices of the end cell in the selection.

int QicsSelection::anchorRow ( void   )  const [inline]

Returns the row index of the anchor cell in the selection.

int QicsSelection::anchorColumn ( void   )  const [inline]

Returns the column index of the anchor cell in the selection.

int QicsSelection::startRow ( void   )  const [inline]

Returns the row index of the start cell in the selection.

Since:
2.2

int QicsSelection::startColumn ( void   )  const [inline]

Returns the column index of the start cell in the selection.

Since:
2.2

int QicsSelection::endRow ( void   )  const [inline]

Returns the row index of the end cell in the selection.

int QicsSelection::endColumn ( void   )  const [inline]

Returns the column index of the end cell in the selection.

int QicsSelection::topRow ( void   )  const [inline]

Returns the lesser of the row indices of the anchor and end cells.

int QicsSelection::leftColumn ( void   )  const [inline]

Returns the lesser of the column indices of the anchor and end cells.

int QicsSelection::bottomRow ( void   )  const [inline]

Returns the greater of the row indices of the anchor and end cells.

int QicsSelection::rightColumn ( void   )  const [inline]

Returns the greater of the column indices of the anchor and end cells.

int QicsSelection::numColumns ( void   )  const [inline]

Returns the width of the selection (in columns).

int QicsSelection::numRows ( void   )  const [inline]

Returns the height of the selection (in rows).

void QicsSelection::setEntireRow ( int  row  ) 

Sets the value of this selection to all of row row.

void QicsSelection::setEntireColumn ( int  col  ) 

Sets the value of this selection to all of column col.

bool QicsSelection::intersects ( const QicsSelection sel  ) 

Returns true if sel intersects with this selection (i.e. there at least one cell that is contained in both selections), or false otherwise.

bool QicsSelection::contains ( int  row,
int  col 
) const [inline]

Returns true if selection contains row and col inside.

Since:
2.2

QicsSelection QicsSelection::operator & ( const QicsSelection sel  ) 

Returns the intersection of this selection and sel.

QicsSelection QicsSelection::intersect ( const QicsSelection sel  ) 

Returns the intersection of this selection and sel.

QicsSelection QicsSelection::operator| ( const QicsSelection sel  ) 

Returns the union of this selection and sel.

Since:
2.2

QicsSelection& QicsSelection::operator|= ( const QicsSelection sel  )  [inline]

Returns the union of this selection and sel.

Since:
2.2


Friends And Related Function Documentation

QICS_EXPORT bool operator== ( const QicsSelection r1,
const QicsSelection r2 
) [friend]

Returns true if the two selections are identical, or false otherwise.

QICS_EXPORT bool operator!= ( const QicsSelection r1,
const QicsSelection r2 
) [friend]

Returns true if the two selections are not identical, or false otherwise.


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

All trademarks and copyrights on this page are properties of their respective owners.
The rest is copyright 1999-2006 Integrated Computer Solutions, Inc.