Navigation:  Classes > bBrowser >

bBrowser:CellGroupMove()

Print this Topic    Previous pageReturn to chapter overviewNext page

Purpose

A callback method for moving a cell group.

Class

bBrowser

Type

Method

Syntax

<oBrowser>:CellGroupMove(

<iMode>,

<oCellGroupItem>,

<oCell>,

<cInfoText>

) Æ iResult

Arguments

<iMode>The mode of the cell group moving process. The following modes can occur:

 

Mode

Description

Return Value

BCGMM_START

The moving process for the cell group is started.

The return value BCGMR_VALID or BCGMR_UNDEFINED results in that the cell group being able to be moved.

The return value BCGMR_INVALID prevents moving the cell group.

BCGMM_CHECKCELL

The new position of the cell group can be checked.

The return value BCGMR_VALID results in that the cell group being able to be moved to the new position.

The return value BCGMR_INVALID prevents that the cell group may be moved to the new position.

The return value BCGMR_UNDEFINED results in that the bBrowser examining, whether the cell group conflict with another cell group at the new position. In this case the cell group may not be moved to this position.

BCGMM_FINISHREQUEST

The cell group moving was finished. The new position can be accepted or rejected.

The return value BCGMR_VALID or BCGMR_UNDEFINED results in that the cell group is moved to the new position.

The return value BCGMR_INVALID prevents that the cell group is moved to the new position.

BCGMM_FINISH

The cell group was moved to the new position.

The return value is not used.

BCGMM_ABORT

Moving the cell group was aborted

The return value is not used.

 

Data Type:Integer

 

<oCellGroupItem>The cell group which is moved.
Data Type:bCellGroupItem

 

<oCell>The new start cell to which the cell group should to be moved. The cell defines an absolute position.
Data Type:bCell

 

<cInfoText>An info text which should to be displayed below the cursor during moving the cell group. The argument must be passed by reference.
Data Type:String

Return Value

iResultA numeric value that indicates whether the mode was correctly processed. The following values are supported:

 

Value

Description

BCGMR_UNDEFINED

The mode was not processed.

 

The bBrowser processes the mode.

BCGMR_VALID

Moving the cell group is supported for the mode.

BCGMR_INVALID

Moving the cell group is not supported for the mode.

 

Data Type:Integer

Description

bBrowser:CellGroupMove() is a callback method that is called by the bBrowser whenever a cell group is to be moved with the mouse. The method checks whether a method with the same name is defined in the owner of the bBrowser and calls this with an object of class bCellGroupMoveEvent as argument.

 

The entire moving process of a cell group is divided into several steps. For each step the bBrowser calls the method CellGroupMove() with the appropriate mode. The owner of the bBrowser can react to these modes by the definition of its own CellGroupMove() method.

Samples

The following sample shows the definition of its own CellGroupMove() method in the owner of the bBrowser. The bBrowser calls this automatically.

 

METHOD CellGroupMove(oCellGroupMoveEvent) CLASS myDataWindow
   // Callback method for moving a cell group
   LOCAL ocgiTemp     AS bCellGroupItem
   LOCAL oStartCell   AS bCell
   LOCAL oEndCell     AS bCell
   LOCAL iColumn      AS INT
   LOCAL rPercentage  AS REAL8
   LOCAL iHours       AS INT
   LOCAL iMinutes     AS INT
 
   // Check the mode
   IF oCellGroupMoveEvent:Mode = BCGMM_START
      IF oCellGroupMoveEvent:CellGroupItem:PropertyGet(#Fixed)
         // It is not allowed to move the cell group.
         // -> Moving is not permitted by the return of BCGMR_INVALID.
         RETURN BCGMR_VALID
      ENDIF
   ELSEIF oCellGroupMoveEvent:Mode = BCGMM_CHECKCELL
      // Return the position of the cell as info text.
      // The info text is shown below the cursor.
      oStartCell := oCellGroupMoveEvent:CellGroupItem:GetStartCell(BCGIGCO_ABSOLUTE)
      oEndCell := oCellGroupMoveEvent:CellGroupItem:GetEndCell(BCGIGCO_ABSOLUTE)
 
      ocgiTemp := bCellGroupItem{oStartCell, oEndCell}
      ocgiTemp:Move(oCellGroupMoveEvent:Cell, BCGIMO_ABSOLUTEPOSITION)
 
      iColumn := ocgiTemp:StartCell:Column
      rPercentage := ocgiTemp:StartCell:ColumnPercentage
 
      iHours := iColumn - 2
      IF iColumn <= 0 .OR. iColumn > 23
         iHours := 0
      ELSE
         iHours := iColumn - 2
      ENDIF
      iMinutes := 60 * (rPercentage / 100.00)
 
      oCellGroupMoveEvent:InfoText := StrZero(iHours, 2) + ":" + StrZero(iMinutes, 2)
   ENDIF
   RETURN BCGMR_UNDEFINED

See Also

bBrowser:MoveCellGroup()

bCellGroupMoveEvent

bSample - CellGroups

 


Page url: http://www.YOURSERVER.com/index.html?bbrowser_cellgroupmove.htm