<< Return to Main Index

< Return to Class Index

CGXGridCore::SetSelection

void SetSelection(POSITION SelRectId, ROWCOL nTop = 0, ROWCOL nLeft = 0, ROWCOL nBottom = 0, ROWCOL nRight = 0);

SelRectId

A POSITION-object for the range list. If SelRectId is NULL the range list will be emptied; else nTop, nLeft, nBottom and nRight specify the coordinates for the range reference with SelRectId.

nTop

Specifies the first row.

nLeft

Specifies the first column.

nBottom

Specifies the last row.

nRight

Specifies the last column.

Remarks

Selects a range of cells, rows or columns and inverts the cells. If you want to add a new range to the range-list, you first have to create a range-object on the heap and determine its position-object as in the following example:

   POSITION area = GetParam( )->GetRangeList( )->AddTail(new CGXRange);
   SetSelection(area, nTopRow, nLeftCol, nBottomRow, nRightCol);

The display is updated either with a call to PrepareChangeSelection or PrepareClearSelection, and the range is updated afterward by assigning the specified coordinates to the range.

Control-Factory Specific ->

This method has been implemented using the abstraction mechanism as discussed in the chapter "Reducing the size of your application" in the user's guide. A call to the ImplementUserSelectRange method from within the control factory class' InitializeGridComponents method will make the concrete implementation of this method available to your application.

If no concrete implementation is available this method performs no action. A warning will be displayed in the debug window.

END Control-Factory Specific

See Also

CGXGridCore::PrepareChangeSelection CGXGridCore::PrepareClearSelection

CGXGridCore

Class Overview | Class Members