Command PV SET COLUMNS WIDTH

4D View

PV SET COLUMNS WIDTH

version 6.8


PV SET COLUMNS WIDTH (area; first; last; width)

ParameterTypeDescription
areaLongint4D View area
firstLongintFirst column number
lastLongintLast column number
widthIntegerColumn width in pixels

Description

The PV SET COLUMNS WIDTH command allows modifying the width (in pixels) of area columns located between the first and last included columns.

Note : If you pass 0 (zero) in the first and last parameters, the defined width will be applied to all the columns of the area and will become the new default column width for the area. The default width is applied notably when the user double-clicks on the right-hand separator of a column.

Example

This example illustrates a resizing of rows and columns:

   C_LONGINT($Column;$Row)  `Principle loop index
   C_LONGINT($Width;$Height)  `Index of the column and row enlargement loop
   C_LONGINT($StartWidth)  `Original width of the Xth column
   C_LONGINT($RequestWidth)  `Requested width of the Xth column

      `Let's initialize
   $StartWidth:=5  `Set the original width
   $RequestWidth:=$StartWidth+5  `10 point width for the first column

   For ($Column;1;5)  `Taken care of for the first 5 columns
      $Row:=$Column  `Only for the first five lines
      For ($Width;$StartWidth;$RequestWidth;2)  `For the column "$Column"...
         $Height:=$Width-5  `Update height
         PV SET ROWS HEIGHT (area;$Row;$Row;PV Get row height (area;$Row)+$Height)  `1 row
         PV SET COLUMNS WIDTH (area;$Column;$Column;PV Get column width(area;$Row)+$Width)  `1 column
           PV REDRAW (area)  `Refresh
      End for 
      $StartWidth:=$RequestWidth  `To not start at the beginning
      $RequestWidth:=$RequestWidth+5  `Increase for the next column
   End for 

See Also

PV Get column width, PV SET ROWS HEIGHT.