Purpose
A callback method for resizing a cell group.
Class
Type
Method
Syntax
<oBrowser>:CellGroupResize(
<iMode>,
<oCellGroupItem>,
<iTouchedEdge>,
<oStartCell>,
<oEndCell>,
<oStartCellNew>,
<oEndCellNew>,
[<cInfoText>]
) Æ iResult
Arguments
<iMode> | The mode of the cell group resizing process. The following modes are supported: |
Mode |
Description |
Return Value |
BCGRM_START |
The process for resizing of the cell group is started. |
The return value BCGRR_VALID results in that the cell group being able to be resized. The return value BCGRR_INVALID prevents resizing the cell group. |
BCGRM_CHECKCELL |
The new size of the cell group can be checked. |
The return value BCGRR_VALID results in that the size of the cell group is changed. The return value BCGRR_INVALID prevents that the size of the cell group may be changed. The return value BCGRR_UNDEFINED results in that the bBrowser examining, whether the new size of the cell group conflict with another cell group. In this case the size of the cell group may not be changed. |
BCGRM_GETINFOTEXT |
The text which is displayed during resizing can be defined. |
The return value BCGRR_VALID results in that the text is displayed. The return value BCGRR_UNDEFINED results in that the bBrowser show a default text. |
BCGRM_FINISHREQUEST |
The process for resizing of the cell group was finished. The new size of the cell group can be accepted or rejected. |
The return value BCGRR_VALID or BCGRR_UNDEFINED results in that the size of the cell group is changed. The return value BCGRR_INVALID prevents that the size of the cell group is changed. |
BCGRM_FINISH |
The process for resizing of the cell group was finished and the cell group was adapted to the new size. |
The return value is not used. |
BCGRM_ABORT |
The process for resizing of the cell group was canceled and the size of the cell group is unchanged. |
The return value is not used. |
Data Type: | Integer |
<oCellGroupItem> | The cell group which is resized. |
Data Type: | bCellGroupItem |
<iTouchedEdge> | The edge of the cell group at which the size is changed. The following values are supported: |
Value |
Description |
BCGRTE_LEFT |
The size of the cell group is changed on the left edge. |
BCGRTE_TOP |
The size of the cell group is changed on the top edge. |
BCGRTE_RIGHT |
The size of the cell group is changed on the right edge. |
BCGRTE_BOTTOM |
The size of the cell group is changed on the bottom edge. |
Data Type: | Integer |
<oStartCell> | The start cell of the cell group. The cell defines an absolute position. |
Data Type: | bCell |
<oEndCell> | The end cell of the cell group. The cell defines an absolute position. |
Data Type: | bCell |
<oStartCellNew> | The new start cell of the cell group. The cell defines an absolute position. |
Data Type: | bCell |
<oEndCellNew> | The new end cell of the cell group. The cell defines an absolute position. |
Data Type: | bCell |
<cInfoText> | An info text which should to be displayed during resizing the cell group. The argument must be passed by reference. |
Data Type: | String |
Return Value
iResult | A numeric value that indicates whether the mode was correctly processed. The following values are supported: |
Value |
Description |
BCGRR_UNDEFINED |
The mode was not processed.
The bBrowser processes the mode. |
BCGRR_VALID |
Resizing the cell group is supported for the mode. |
BCGRR_INVALID |
Resizing the cell group is not supported for the mode. |
Data Type: | Integer |
Description
bBrowser:CellGroupResize() is a callback method that is called by the bBrowser whenever a cell group is resized 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 bCellGroupResizeEvent as argument.
The entire resizing process of a cell group is divided into several steps. For each step the bBrowser calls the method CellGroupResize() with the appropriate mode. The owner of the bBrowser can react to these modes by the definition of its own CellGroupResize() method.
Samples
The following sample shows the definition of its own CellGroupResize() method in the owner of the bBrowser. The bBrowser calls this automatically.
METHOD CellGroupResize(oCellGroupResizeEvent) CLASS myDataWindow
// Callback-Method for resizing a cell group
LOCAL iResult AS INT
LOCAL oStartCellNew AS bCell
LOCAL oEndCellNew AS bCell
// Check the mode
iResult := BCGRR_UNDEFINED
IF oCellGroupResizeEvent:Mode = BCGRM_GETINFOTEXT
// Set size of cell as info text in event.
// -> The info text is displayed during the resizing process.
IF InList(oCellGroupResizeEvent:TouchedEdge, BCGRTE_LEFT, BCGRTE_RIGHT)
oStartCellNew := oCellGroupResizeEvent:StartCellNew
oEndCellNew := oCellGroupResizeEvent:EndCellNew
oCellGroupResizeEvent:InfoText := self:GetTimeFromColumnPercentage(oStartCellNew:Column, iif(oStartCellNew:ColumnPercentage = BCELL_PERCENTAGE_UNDEFINED, BCELL_PERCENTAGE_NULL, oStartCellNew:ColumnPercentage));
+ " / ";
+ self:GetTimeFromColumnPercentage(oEndCellNew:Column, iif(oEndCellNew:ColumnPercentage = BCELL_PERCENTAGE_UNDEFINED, BCELL_PERCENTAGE_MAX, oEndCellNew:ColumnPercentage))
iResult := BCGRR_VALID
ENDIF
ENDIF
RETURN iResult
METHOD GetTimeFromColumnPercentage(iColumn AS INT, rPercentage AS REAL8) AS STRING PASCAL CLASS myDataWindow
// Convert column no (hours) and percentage (minutes) in time
LOCAL cTime AS STRING
LOCAL iHours AS INT
LOCAL iMinutes AS INT
// Determine time
iHours := iColumn - 2
IF iColumn <= 0 .OR. iColumn > 23
iHours := 0
ELSE
iHours := iColumn - 2
ENDIF
iMinutes := Integer(Round(60.00 * (rPercentage / BCELL_PERCENTAGE_MAX), BCELL_PERCENTAGE_PRECISION))
cTime := StrZero(iHours, 2) + ":" + StrZero(iMinutes, 2)
RETURN cTime
See Also
Page url: http://www.YOURSERVER.com/index.html?bbrowser_cellgroupresize.htm