This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v19
VP SHOW CELL
|
VP SHOW CELL ( rangeObj {; vPos ; hPos} ) | ||||||||
Parameter | Type | Description | ||||||
rangeObj | Object |
![]() |
Range object of cells | |||||
vPos | Longint |
![]() |
Vertical view position of cell or row | |||||
hPos | Longint |
![]() |
Horizontal view position of cell or row | |||||
The VP SHOW CELL command vertically and horizontally repositions the view of the rangeObj.
In rangeObj, pass a range of cells as an object to designate the cells to be viewed. The view of the rangeObj will be positioned vertically or horizontally (i.e., where rangeObj appears) based on the vPos and hPos parameters.
The vPos parameter defines the desired vertical position to display the rangeObj. The following selectors are available:
Constant | Value | Comment |
vk position top | 0 | Vertical alignment to the top of cell or row |
vk position bottom | 2 | Vertical aligment to the bottom of cell or row |
The hPos parameter defines the desired horizontal position to display the rangeObj. The following selectors are available:
Constant | Value | Comment |
vk position left | 0 | Horizontal alignment to the left of the cell or column |
vk position right | 2 | Horizontal alignment to the right of the cell or column |
Both vPos and hPos accept the following selectors:
Constant | Value | Comment |
vk position center | 1 | Alignment to the center. The alignment will be to the cell, row, or column limit according to the view position indicated:
|
vk position nearest | 3 | Alignment to the closest limit (top, bottom, left, right, center). The alignment will be to the cell, row, or column limit according to the view position indicated:
|
Note: This command is only effective if repositioning the view is possible. For example, if the rangeObj is in cell A1 (the first column and the first row) of the current sheet, repositioning the view will make no difference because the vertical and horizontal limits have already been reached (i.e., it is not possible to scroll any higher or any more to the left). The same is true if rangeObj is in cell C3 and the view is repositioned to the center or the bottom right. The view remains unaltered.
You want to view the cell in column AY, row 51 in the center of the 4D View Pro area. The following code:
$displayCell:=VP Cell("myVPArea";50;50)
// Move the view to show the cell
VP SHOW CELL($displayCell;vk position center;vk position center)
will display:
The same code with the vertical and horizontal selectors changed to show the same cell positioned at the top right of the 4D View Pro area:
$displayCell:=VP Cell("myVPArea";50;50)
// Move the view to show the cell
VP SHOW CELL($displayCell;vk position top;vk position right)
will display:
VP ADD SELECTION
VP Get active cell
VP Get selection
VP RESET SELECTION
VP SET ACTIVE CELL
VP SET SELECTION
Product: 4D
Theme: 4D View Pro Language
Number:
905259
Created: 4D v17 R5
4D View Pro Reference ( 4D v19)