Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Gadget class. More...
#include <ilviews/gadgets/amatrix.h>
Public Member Functions | |
IlBoolean | allowCellMode () const |
Indicates whether the matrix can draw items on several continuous cells. More... | |
virtual IlBoolean | cellBBox (IlUShort colno, IlUShort rowno, IlvRect &rect, const IlvTransformer *t=0) const |
Computes the bounding box of a given cell. More... | |
virtual void | cellInfo (IlUShort colno, IlUShort rowno, IlUShort &startcol, IlUShort &startrow, IlUShort &nbcol, IlUShort &nbrow) const |
Returns cell information. More... | |
virtual IlBoolean | columnBBox (IlUShort colno, IlvRect &rect, const IlvTransformer *t=0) const |
Computes the bounding box of a given column. More... | |
virtual IlUShort | columns () const =0 |
Returns the number of columns in the matrix. More... | |
virtual IlBoolean | columnSameWidth () const =0 |
Returns IlTrue if all the columns in the matrix have the same width. More... | |
virtual void | drawGadgetContents (IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *clip=0) const |
Draws the gadget contents. More... | |
virtual void | drawItem (IlvPort *dst, IlUShort colno, IlUShort rowno, const IlvRect &itembbox, const IlvRect &clip) const |
Is called by the matrix to draw an item. More... | |
virtual void | ensureVisible (IlUShort colno, IlUShort rowno, IlBoolean redraw=IlTrue) |
Scrolls the matrix to make the specified item visible. More... | |
IlUShort | firstColumn () const |
Returns the index of the first visible column. More... | |
IlUShort | firstRow () const |
Returns the index of the first visible row. More... | |
virtual IlvDim | getColumnPosition (IlUShort col) const |
Returns the position of a column. More... | |
virtual IlvDim | getColumnsDistance (IlUShort fromcol, IlUShort tocol) const |
Returns the distance between two columns. More... | |
virtual IlvDim | getColumnWidth (IlUShort colno) const =0 |
Returns the width of the specified column. More... | |
virtual IlvPalette * | getGridPalette () const |
Returns the palette used to draw the matrix grid. More... | |
IlUShort | getNbFixedColumn () const |
Returns the number of fixed columns. More... | |
IlUShort | getNbFixedRow () const |
Returns the number of fixed rows. More... | |
virtual IlvDim | getRowHeight (IlUShort rowno) const =0 |
Returns the height of the specified row. More... | |
virtual IlvDim | getRowPosition (IlUShort row) const |
Returns the position of a row. More... | |
virtual IlvDim | getRowsDistance (IlUShort fromrow, IlUShort torow) const |
Returns the distance between two rows. More... | |
virtual void | getVisibleItems (IlUShort &fromcol, IlUShort &tocol, IlUShort &fromrow, IlUShort &torow, const IlvTransformer *t=0) const |
Computes the range of the items that are visible in the matrix. More... | |
virtual IlBoolean | handleGadgetEvent (IlvEvent &) |
Handles the gadget events. More... | |
virtual IlBoolean | handleMatrixEvent (IlvEvent &event) |
Handles the events sent to the matrix. More... | |
virtual void | invalidateColumn (IlUShort colno) const |
Redraws a column. More... | |
virtual void | invalidateRect (const IlvRect &rect) const |
Redraws a portion of the matrix. More... | |
virtual void | invalidateRow (IlUShort rowno) const |
Redraws a row. More... | |
IlBoolean | isShowingGrid () const |
Returns IlTrue if the matrix grid is displayed. More... | |
virtual IlBoolean | pointToPosition (const IlvPoint &point, IlUShort &colno, IlUShort &rowno, const IlvTransformer *t=0) const |
Returns the location of the item located at the specified point. More... | |
virtual IlBoolean | rowBBox (IlUShort rowno, IlvRect &rect, const IlvTransformer *t=0) const |
Computes the bounding box of the specified row. More... | |
virtual IlUShort | rows () const =0 |
Returns the number of rows in the matrix. More... | |
virtual IlBoolean | rowSameHeight () const =0 |
Returns IlTrue if all the rows in the matrix have the same height. More... | |
virtual void | scrollBarBBox (IlvDirection dir, IlvRect &bbox, const IlvTransformer *t=0) const |
Returns the bounding box of the specified internal scroll bar. More... | |
virtual void | scrollBarHasMoved (IlvDirection pos) |
Is called when an internal scroll bar has moved. More... | |
virtual void | scrollTo (IlUShort colno, IlUShort rowno) |
Changes the first visible column and row. More... | |
void | scrollToColumn (IlUShort colno) |
Changes the first visible column. More... | |
void | scrollToRow (IlUShort rowno) |
Changes the first visible row. More... | |
void | setNbFixedColumn (IlUShort count) |
Sets the number of fixed rows. More... | |
void | setNbFixedRow (IlUShort count) |
Sets the number of fixed rows. More... | |
IlBoolean | showGrid (IlBoolean value) |
Specifies whether the matrix grid should be displayed. More... | |
Public Member Functions inherited from IlvScrolledGadget | |
IlvScrolledGadget (IlvDisplay *display, const IlvRect &rect, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Constructor. More... | |
virtual void | adjustScrollBars (IlBoolean redraw=IlFalse) |
Recomputes the scroll bars. More... | |
void | computeBBox (IlvRect &ibox, IlvRect &vs, IlvRect &hs, const IlvTransformer *t=0) const |
Computes the bounding boxes of the elements that compose the gadget. More... | |
void | computeBBox (IlvRect &ibox, IlvRect &vbox, IlvRect &vs, IlvRect &hs, const IlvTransformer *t=0) const |
Computes the bounding boxes of the elements that compose the gadget. More... | |
virtual void | drawBackground (IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *clip=0) const |
Draws the gadget background. More... | |
virtual void | drawFrame (IlvPort *dst, const IlvTransformer *t=0, const IlvRegion *clip=0) const |
Draws the gadget frame. More... | |
virtual void | drawScrollBar (IlvPort *dst, IlvDirection direction, const IlvTransformer *t=0, const IlvRegion *clip=0) const |
Draws the specified internal scroll bar. More... | |
void | fitToRect (const IlvRect &rect) |
Resizes the object so that the scrollable area fits the specified rectangle. More... | |
IlUShort | getBottomMargin () const |
Returns the bottom margin. More... | |
IlvScrollBar * | getHorizontalScrollBar () const |
Returns a pointer to the internal horizontal scroll bar. More... | |
IlUShort | getLeftMargin () const |
Returns the left margin. More... | |
IlUShort | getRightMargin () const |
Returns the right margin. More... | |
IlvScrollBar * | getScrollBar (IlvDirection direction) const |
Returns a pointer to the specified internal scroll bar. More... | |
void | getScrollBarShowAsNeeded (IlBoolean &vert, IlBoolean &hor) const |
Returns the scroll bar mode of the internal scroll bars. More... | |
IlUShort | getTopMargin () const |
Returns the top margin. More... | |
IlvScrollBar * | getVerticalScrollBar () const |
Returns a pointer to the internal vertical scroll bar. More... | |
virtual IlBoolean | handleScrollBarsEvent (IlvEvent &event) |
Handles the internal scroll bars event. More... | |
void | hideScrollBar (IlvDirection direction, IlBoolean redraw=IlTrue) |
Hides the specified internal scroll bar. More... | |
virtual void | internalBBox (IlvRect &bbox, const IlvTransformer *t=0) const |
Returns the internal bounding box of the gadget. More... | |
void | moveScrollBar (IlvDirection direction, IlvPosition where, IlBoolean redraw=IlTrue) |
Moves the specified internal scroll bar to a new position. More... | |
virtual void | scrollableSize (IlvDim &width, IlvDim &height) const |
Returns the size of the scrollable area of the gadget. More... | |
void | scrollBarShowAsNeeded (IlBoolean vertical, IlBoolean horizontal, IlBoolean redraw=IlTrue) |
Sets the scroll bar mode of the internal scroll bars. More... | |
virtual void | scrollBarVisibilityChanged (IlvDirection direction) |
Is called when an internal scroll bar is shown or hidden. More... | |
void | setBottomMargin (IlUShort margin) |
Sets the bottom margin. More... | |
void | setLeftMargin (IlUShort margin) |
Sets the left margin. More... | |
void | setMargin (IlUShort val) |
Sets the left, right, top, and bottom margins. More... | |
void | setRightMargin (IlUShort margin) |
Sets the right margin. More... | |
void | setTopMargin (IlUShort margin) |
Sets the top margin. More... | |
void | showScrollBar (IlvDirection direction, IlBoolean redraw=IlTrue) |
Shows the specified internal scroll bar. More... | |
virtual void | visibleBBox (IlvRect &bbox, const IlvTransformer *t=0) const |
Returns the visible bounding box of the gadget. More... | |
IlvPosition | whereIsScrollBar (IlvDirection direction) const |
Returns the location of the specified internal scroll bar. More... | |
Protected Member Functions | |
IlvAbstractMatrix (IlvDisplay *display, const IlvRect &rect, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Constructor. More... | |
virtual void | adjustFromScrollBar (const IlvScrollBar *sb, IlvDirection dir) |
Is called to adjust the gadget to the scroll bars values. More... | |
virtual void | adjustScrollBarValue (IlvScrollBar *sb, IlvDirection dir) |
Is called to adjust the scroll bar values. More... | |
virtual IlvScrollBar * | createScrollBar (const IlvRect &r, IlvDirection dir, IlUShort t, IlvPalette *p) |
Returns a new instance of the IlvScrollBar class. More... | |
Protected Member Functions inherited from IlvScrolledGadget | |
IlvDim | getLimitHeightValue () const |
Returns the limit value for the vertical scrolling. More... | |
IlvDim | getLimitWidthValue () const |
Returns the limit value for the horizontal scrolling. More... | |
IlvDim | getScrollableHeight () const |
Returns the height of the scrollable area. More... | |
IlvDim | getScrollableWidth () const |
Returns the width of the scrollable area. More... | |
void | setLimitHeightValue (IlvDim value) |
Sets the limit value for the vertical scrolling. More... | |
void | setLimitWidthValue (IlvDim value) |
Sets the limit value for the horizontal scrolling. More... | |
void | setScrollableHeight (IlvDim height) |
Sets the height of the scrollable area. More... | |
void | setScrollableWidth (IlvDim width) |
Sets the width of the scrollable area. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from IlvScrolledGadget | |
static IlSymbol * | ScrollBarMovedSymbol () |
Returns the callback type for the Scroll Bar Moved callback. More... | |
static IlSymbol * | ScrollBarVisibilitySymbol () |
Returns the callback type for the Scroll Bar Visibility Changed callback. More... | |
Gadget class.
Library: ilvadvgdt
This gadget class is an abstract class that can draw any object in a rectangular grid. This class is designed to be subclassed. IlvAbstractMatrix
does not contain any values. When subclassing the IlvAbstractMatrix
class, you must specify the number of rows and columns, the height of each row, the width of each column, whether you want to draw a grid around items, and how items are to be drawn in the grid. The IlvAbstractMatrix
class can also draw items that extend over several adjacent cells. Scroll bars can be attached to a matrix. You can also set a number of fixed columns and fixed rows.
|
protected |
Constructor.
This constructor initializes a new empty instance of IlvAbstractMatrix
.
display | The connection to the display. |
rect | The size of the matrix. |
thickness | The thickness of the matrix. |
palette | The palette used by the matrix. |
|
protectedvirtual |
Is called to adjust the gadget to the scroll bars values.
Is called each time the scroll bar scrollbar of direction direction moves. If you want to detect these events, you must redefine this member function in a subclass. The default implementation does nothing.
scrollbar | The scroll bar object. |
direction | The direction of the scroll bar. Valid values are: IlvHorizontal and IlvVertical . |
Reimplemented from IlvScrolledGadget.
|
protectedvirtual |
Is called to adjust the scroll bar values.
Is called by the member function IlvScrolledGadget::adjustScrollBars
to adjust the values of the scroll bar scrollbar of direction direction. This member function must modify the scrollbar values to match the gadget scrolling mode. If you want to detect these events, you must redefine this member function in a subclass. The default implementation does nothing.
scrollbar | The scroll bar object. |
direction | The direction of the scroll bar. Valid values are: IlvHorizontal and IlvVertical . |
Reimplemented from IlvScrolledGadget.
IlBoolean IlvAbstractMatrix::allowCellMode | ( | ) | const |
Indicates whether the matrix can draw items on several continuous cells.
The default value is IlFalse
. Subclasses may set this flag differently in their constructors.
_allowCellMode
specifying whether the IlvAbstractMatrix
can draws items on several continuous rows or columns (IlTrue
) or not (IlFalse
).
|
virtual |
Computes the bounding box of a given cell.
Computes in rect the bounding box of the item located at colno and rowno when the matrix is drawn with the transformer t. If the item extends over several cells, the global bounding box of the cell is returned.
colno | The column index. |
rowno | The row index. |
rect | The cell bounding box. |
t | The transformer applied to the matrix. |
IlTrue
if the item is visible (even partially) and IlFalse
otherwise.
|
virtual |
Returns cell information.
If IlvAbstractMatrix::allowCellMode
returns IlTrue
, the matrix can draw items on several cells A cell is the intersection of a row and a column. Overloading this member function allows you to draw an item over multiple cells. In this method rowno and colno represent a cell. Given this position, you must return the starting position of the item (top-left position) in startrow and startcol and the number of rows and columns of the item that contains this cell in nbrow and nbcol. For example, if you want to have an item positioned at 10,10
that extends over five rows and five columns, write:
_allowCellMode
to IlTrue
in your constructor. Furthermore, you should not have overlapping items. colno | The column index. |
rowno | The row index. |
startcol | The returned starting column. |
startrow | The returned starting row. |
nbcol | The returned number of columns. |
nbrow | The returned number of rows. |
|
virtual |
Computes the bounding box of a given column.
Computes in rect the bounding box of the column specified by colno when the matrix is drawn with the transformer t.
colno | The column index. |
rect | The column bounding box. |
t | The transformer applied to the matrix. |
IlTrue
if the column is visible (even partially) and IlFalse
otherwise.
|
pure virtual |
|
pure virtual |
Returns IlTrue
if all the columns in the matrix have the same width.
Must be defined in subclasses to return IlTrue
if the columns of the matrix have the same width, and IlFalse
if not. Drawings are optimized if IlTrue
is returned.
IlTrue
if all the columns in the matrix have the same width or IlFalse
otherwise. Implemented in IlvMatrix.
|
protectedvirtual |
Returns a new instance of the IlvScrollBar
class.
Is called by the member function IlvScrolledGadget::showScrollBar
to create a new scroll bar. If you want to create your own scroll bars, you can override this member function in a subclass.
rect | The bounding box of the scroll bar to be created. |
direction | The direction of the scroll bar to be created. Valid values are: IlvHorizontal and IlvVertical . |
thickness | The thickness of the scroll bar to create. |
palette | The palette of the scroll bar to create. |
Reimplemented from IlvScrolledGadget.
|
virtual |
Draws the gadget contents.
Is called from the draw
method. The default implementation does nothing.
dst | The destination drawing port. |
t | The transformer applied to the gadget. |
clip | The clipping area. |
Reimplemented from IlvScrolledGadget.
|
virtual |
Is called by the matrix to draw an item.
This method does nothing and should be redefined in subclasses to draw items.
dst | The destination drawing port. |
colno | The column of the item to be drawn. If the item extends over several columns, colno specifies the left location of the item. |
rowno | The row of the item to be drawn. If the item extends over several rows, rowno specifies the top location of the item. |
itembbox | The rectangle inside which the item should be drawn. If the item extends over several cells, itembbox is the bounding box of the cells contained by the item. |
clip | The clipping area. |
|
virtual |
Scrolls the matrix to make the specified item visible.
Scrolls the matrix so that the item located at the intersection of colno and rowno becomes visible.
colno | The column index. |
rowno | The row index. |
redraw | A Boolean value specifying whether the matrix should be redrawn. |
IlUShort IlvAbstractMatrix::firstColumn | ( | ) | const |
IlUShort IlvAbstractMatrix::firstRow | ( | ) | const |
Returns the index of the first visible row.
Returns the position of a column.
0
, it returns 0
. col | The column index. |
Reimplemented in IlvMatrix.
|
virtual |
Returns the distance between two columns.
Computes the distance between the columns fromcol and tocol. It is implemented as the sum of getColumnWidth(i)
from fromcol to tocol -1
. You can override this member function in a subclass to accelerate computing. Note that it is already optimized if the columns have the same width.
fromcol | The starting column. |
tocol | The ending column. |
Reimplemented in IlvMatrix.
Returns the width of the specified column.
Must be redefined by subclasses to return the width of the column of index colno. The column numbering starts at 0
. This member function must be redefined even if all the columns have the same width, in which case the IlvAbstractMatrix
uses getColumnWidth(0)
. The code of this member function must be as efficient as possible to optimize the drawing.
colno | The column index. |
Implemented in IlvMatrix.
|
virtual |
IlUShort IlvAbstractMatrix::getNbFixedColumn | ( | ) | const |
Returns the number of fixed columns.
Fixed columns are continuous columns from 0
to getNbFixedColumn()-1
. They are always visible and do not scroll.
IlUShort IlvAbstractMatrix::getNbFixedRow | ( | ) | const |
Returns the number of fixed rows.
Fixed rows are continuous rows from 0
to getNbFixedRow()-1
. They are always visible and do not scroll.
Returns the height of the specified row.
Must be redefined in subclasses to return the height of the row of index rowno. The row numbering starts at 0
. This member function must be redefined even if all the rows have the same height, in which case the IlvAbstractMatrix
uses getRowHeight(0)
. The code of this member function must be as efficient as possible to optimize the drawing.
rowno | The row index. |
Implemented in IlvMatrix.
Returns the position of a row.
0
, it returns 0
. row | The row index. |
Reimplemented in IlvMatrix.
|
virtual |
Returns the distance between two rows.
Computes the distance between the rows fromrow and torow. It is implemented as the sum of getRowHeight(i)
from fromrow to torow -1
. You can override this member function in a subclass to accelerate computing. Note that it is already optimized if the rows have the same height.
fromrow | The starting row. |
torow | The ending row. |
Reimplemented in IlvMatrix.
|
virtual |
Computes the range of the items that are visible in the matrix.
Fills the parameters fromcol with the first visible column, tocol with the last visible column, fromrow with the first visible row and torow with the last visible row. Only the scrollable part of the matrix is concerned with the exclusion of fixed rows and columns.
fromcol | The first visible column. |
tocol | The last visible column. |
fromrow | The first visible row. |
torow | The last visible row. |
t | The transformer applied to the matrix. |
Handles the gadget events.
Is called by IlvScrolledGadget::handleEvent
when the member function handleScrollBarsEvent
returns IlFalse
. Its default implementation does nothing. You can override this member function to implement your own gadget behavior.
event | The event. |
Reimplemented from IlvScrolledGadget.
Handles the events sent to the matrix.
Is called by the member function handleEvent
to handle an event applying to the matrix. Scroll bar events are handled by the method IlvScrolledGadget::handleScrollBarsEvent
. The default implementation does nothing and must be redefined if necessary.
event | The event. |
IlTrue
if the matrix used the events, or IlFalse
otherwise. Reimplemented in IlvMatrix, IlvFileChooserSheet, IlvHierarchicalSheet, and IlvSheet.
|
virtual |
Redraws a column.
colno | The index of the column to be redrawn. |
|
virtual |
Redraws a portion of the matrix.
rect | The rectangle to be redrawn. |
|
virtual |
Redraws a row.
rowno | The index of the row to be redrawn. |
IlBoolean IlvAbstractMatrix::isShowingGrid | ( | ) | const |
Returns IlTrue
if the matrix grid is displayed.
IlTrue
if items in the matrix are delimited by a grid and IlFalse
otherwise.
|
virtual |
Returns the location of the item located at the specified point.
Puts in colno and rowno the location of the item that is under the point point when the matrix is displayed using the transformer t.
point | The point expressed in the view coordinates. |
colno | The returned column index. |
rowno | The returned row index. |
t | The transformer applied to the matrix. |
IlTrue
if there is an item at this location. Otherwise, it returns IlFalse
.
|
virtual |
Computes the bounding box of the specified row.
Computes in rect the bounding box of the row specified by rowno when the matrix is drawn with the transformer t.
rowno | The row index. |
rect | The row bounding box. |
t | The transformer applied to the matrix. |
IlTrue
if the row is visible (even partially) and IlFalse
otherwise.
|
pure virtual |
|
pure virtual |
Returns IlTrue
if all the rows in the matrix have the same height.
Must be redefined in subclasses to return IlTrue
if the rows in the matrix have the same height and IlFalse
if not. Drawings are optimized if IlTrue
is returned.
IlTrue
if all the rows in the matrix have the same height or IlFalse
otherwise. Implemented in IlvMatrix.
|
virtual |
Returns the bounding box of the specified internal scroll bar.
Puts in bbox the bounding box of the internal scroll bar specified by direction using the transformer t. If you want to change the internal scroll bars bounding box, you can override this member function in a subclass.
direction | The direction of the internal scroll bar. Valid values are: IlvHorizontal and IlvVertical . |
bbox | The returned internal scroll bar bounding box. |
t | The transformer applied to the gadget. |
Reimplemented from IlvScrolledGadget.
|
virtual |
Is called when an internal scroll bar has moved.
Is called by handleEvent
each time the value of the internal scroll bar specified by direction changes. The default implementation invokes the Scroll Bar Moved callback.
direction | The direction of the internal scroll bar. Valid values are: IlvHorizontal and IlvVertical . |
Reimplemented from IlvScrolledGadget.
Changes the first visible column and row.
Scrolls the matrix so that the first visible column becomes colno and the first visible row rowno. Calling this method with a row or column that is fixed has no effect. The matrix is redrawn only if it is scrolled.
colno | The new first column. |
rowno | The new first row. |
Reimplemented in IlvSheet.
void IlvAbstractMatrix::scrollToColumn | ( | IlUShort | colno | ) |
Changes the first visible column.
Scrolls the matrix so that the first visible column becomes colno. Calling this method with a column that is fixed has no effect.
colno | The new first column. |
void IlvAbstractMatrix::scrollToRow | ( | IlUShort | rowno | ) |
Changes the first visible row.
Scrolls the matrix so that the first visible row becomes rowno. Calling this method with a row that is fixed has no effect.
rowno | The new first row. |
void IlvAbstractMatrix::setNbFixedColumn | ( | IlUShort | count | ) |
Sets the number of fixed rows.
Fixed columns are continuous columns from 0
to getNbFixedColumn()-1
. They are always visible and do not scroll.
count | The new number of fixed columns. |
void IlvAbstractMatrix::setNbFixedRow | ( | IlUShort | count | ) |
Sets the number of fixed rows.
Fixed rows are continuous rows from 0
to getNbFixedRow()-1
. They are always visible and do not scroll.
count | The new number of fixed rows. |
Specifies whether the matrix grid should be displayed.
Sets the grid display flag to v
and returns the new value.
value | The new grid display flag. |
IlTrue
if the matrix grid is displayed. Otherwise, returns IlFalse
. © Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.