4D v13

PV SET STYLE PROPERTY

Home

 
4D View v13
PV SET STYLE PROPERTY

PV SET STYLE PROPERTY 


 

PV SET STYLE PROPERTY ( area ; style ; property ; value ) 
Parameter Type   Description
area  Longint in 4D View area
style  Longint in Stylesheet ID
property  Longint in Property number
value  Longint in Property value

The PV SET STYLE PROPERTY command sets the value of property for the style sheets whose number is style.

Use the PV Style properties constants theme to define the property parameter and the PV Style values constants theme to define the value parameter. The choice of constant to assign to the value parameter depends on the property chosen:

Constant Type Value Comment
pv style automatic word wrap Longint 33 Allows enabling the automatic word wrap function when the contents of a cell exceed its width. Associated values: constants of the PV Style values theme.
  • pv value on: cell contents automatically move to the next line if necessary.
  • pv value off: cell contents run over into the adjacent cells if necessary.
pv style based on Longint 4 The cell uses, as a model, the style sheet whose number is passed in the value parameter. Associated values: style sheet numbers or constants of the PV Style special values theme.
pv style color back even Longint 11 Allows setting of the cell background color if it is located on an even-numbered line. Associated values: color numbers (see the PV RGB to color and PV Index to color commands) or pv value none (PV Style values theme) to set no color.
pv style color back odd Longint 12 Allows setting of the cell background color if it is located on an odd-numbered line. Associated values: color numbers (see the PV RGB to color and PV Index to color commands) or pv value none (PV Style values theme) to set no color.
pv style color minus even Longint 17 Allows setting of cell text color if it is located on an even-numbered line and its value is negative. Associated values: color numbers (see the PV RGB to color and PV Index to color commands).
pv style color minus odd Longint 18 Allows setting of cell text color if it is located on an odd-numbered line and its value is negative. Associated values: color numbers (see the PV RGB to color and PV Index to color commands).
pv style color text even Longint 13 Allows setting of cell text color if it is located on an even-numbered line. Associated values: color numbers (see the PV RGB to color and PV Index to color commands).
pv style color text odd Longint 14 Allows setting of cell text color if it is located on an odd-numbered line. Associated values: color numbers (see the PV RGB to color and PV Index to color commands).
pv style color zero even Longint 15 Allows setting of cell text color if it is located on an even-numbered line and its value is 0 (zero). Associated values: color numbers (see the PV RGB to color and PV Index to color commands).
pv style color zero odd Longint 16 Allows setting of cell text color if it is located on an odd-numbered line and its value is 0 (zero). Associated values: color numbers (see the PV RGB to color and PV Index to color commands).
pv style format alpha Longint 6 The cell uses the text display format whose number is passed in the value parameter. Associated values: display format numbers.
pv style format bool Longint 8 The cell uses the Boolean display format whose number is passed in the value parameter. Associated values: display format numbers.
pv style format date time Longint 9

The cell uses the date and time display format whose number is passed in the value parameter. Associated values: constants of the PV Style format date time theme.

  • pv Short: 02/21/02
  • pv Abbreviated: Thu 21 Feb 2002
  • pv Long: Thursday 21 February 2002
  • pv Short2: 02/21/2002
  • pv Month Day Year: 21 February, 2002
  • pv Abbr Month Day Year: 21 Feb, 2002
  • pv Day Name: Thursday
  • pv Day Number: 21
  • pv Month Name: February
  • pv Month Number: 2
  • pv Year Number: 2002
  • pv Long H MM AM PM: Thursday 21 February 2002 at 12:30 PM
  • pv Abbreviated H MM AM PM: Thu 21Feb 2002 at 12:30 PM
  • pv Short HH MM SS: 02/21/02 at 12:30:00
  • pv Month Day Year H MM AM PM: 21 February, 2002 at 12:30 PM
  • pv Short2 Hour Min Sec: 21/02/2002 and 12 hours 30 minutes 0 second
  • pv HH MM SS: 12:30:00
  • pv HH MM: 12:30
  • pv Hour Min Sec: 12 hours 30 minutes 0 second
  • pv Hour Min: 12 hours 30 minutes
  • pv HH MM AM PM: 12:30 PM

Note: Depending on your current System settings, the resulting display can be different.

pv style format forced text Longint 32 Allows “forcing” the cell display in raw text, i.e. without the automatic display format applied by 4D View based on the cell contents (number, date, text, etc.). Associated values: constants of the PV Style values theme.
  • pv value on: cell contents are displayed without automatic format.
  • pv value off (default): cell contents are displayed with automatic format.
pv style format num Longint 7 The cell uses the number display format whose number is passed in the value parameter. Associated values: display format numbers.
Note:
Default display format numbers correspond to their position in the menu used for selecting formats in the cell Format dialog box.
pv style format picture Longint 10 Allows definition of the picture display format associated with the cell. Associated values: constants of the PV Picture mapping mode theme.
  • pv mapping trunc non-centered
  • pv mapping truncated centered
  • pv mapping replicated
  • pv mapping scaled to fit prop
  • pv mapping scaled to fit
  • pv mapping scaled centered prop
pv style hidden Longint 1 Allows setting of cell locking and hiding. Locked and hidden cell contents are not displayed and can no longer be modified, selected, etc. Associated values: constants of the PV Style values theme.
  • pv value on: cell locked and hidden.
  • pv value off: cell not locked or hidden.
pv style hor alignment Longint 29 Allows setting of horizontal alignment of cell content. Associated values: constants of the PV Style values theme.
  • pv value hor alignment default: applies horizontal alignment by default to the cell.
  • pv value hor alignment left: applies left horizontal alignment to the cell.
  • pv value hor alignment center: applies center horizontal alignment to the cell.
  • pv value hor alignment right: applies right horizontal alignment to the cell.
pv style locked Longint 0 Allows setting of locking for the cell user. Locked cell contents can no longer be modified, selected, etc. Associated values: constants of the PV Style values theme.
  • pv value on: cell locked.
  • pv value off: cell not locked.
pv style rotation Longint 31

Allows setting of cell content rotation. Associated values: constants of the PV Style values theme.

  • pv value rotation 0: no rotation applied to the cell.
  • pv value rotation 90: applies rotation of 90° to the left.
  • pv value rotation 180: applies rotation of 180°.
  • pv value rotation 270: applies rotation of 270° to the left.
pv style spellcheck Longint 2 Allows application of spellcheck for the cell. Associated values: constants of the PV Style values theme.
  • pv value on: a spellcheck is applied to the cell.
  • pv value offpv value off: no spellcheck is applied to the cell.
pv style text bold Longint 22 Allows setting of Bold for the cell text. Associated values: constants of the PV Style values theme.
  • pv value on: Bold applied in cell.
  • pv value off: Bold not applied in cell.
pv style text condensed Longint 27 Allows setting of Condensed for the cell text. Associated values: constants of the PV Style values theme.
  • pv value on: Condensed applied in cell.
  • pv value off: Condensed not applied in cell.
pv style text extended Longint 28 Allows setting of Extended for the cell text. Associated values: constants of the PV Style values theme.
  • pv value on: Extended applied in cell.
  • pv value off: Extended not applied in cell.
pv style text face Longint 21 Allows setting of cell style sheet. Associated values: style sheet numbers or constants of the PV Style special values theme.
pv style text font Longint 19 Allows setting of cell font. Associated values: font numbers (see the PV Add font and PV GET FONT LIST commands).
pv style text italic Longint 23 Allows setting of Italic for the cell text. Associated values: constants of the PV Style values theme.
  • pv value on: Italic applied in cell.
  • pv value off: Italic not applied in cell.
pv style text outline Longint 25 Allows setting of Outline for the cell text. Associated values: constants of the PV Style values theme.
  • pv value on: Outline applied in cell.
  • pv value off: Outline applied in cell.
pv style text shadow Longint 26 Allows setting of Shadow for the cell text. Associated values: constants of the PV Style values theme.
  • pv value on: Shadow applied in cell.
  • pv value off: Shadow not applied in cell.
pv style text size Longint 20 Allows setting of cell font size. Associated values: size in pixels.
pv style text underline Longint 24 Allows setting of Underline for the cell text. Associated values: constants of the PV Style values theme.
  • pv value on: Underline applied in cell.
  • pv value off: Underline not applied in cell.
pv style use picture height Longint 3 Allows adapting of cell size according to the picture height associated with it. Associated values: constants of the PV Style values theme.
  • pv value on: cell size is adapted to the height of the picture it contains. If there is no picture associated with it, the cell is not resized.
  • pv value off: cell size does not vary according to the picture height associated with it.
pv style vert alignment Longint 30

Allows setting of vertical alignment of cell content. Associated values: constants of the PV Style values theme.

  • pv value vert alignment top: applies top vertical alignment to the cell.
  • pv value vert alignment center: applies center vertical alignment to the cell.
  • pv value vert alignment bottom: applies bottom vertical alignment to the cell.

If you want to edit the default style sheets properties, pass one of the PV Style special values constants in the style parameter:

Constant Type Value Comment
pv style cells Longint -1 Default style sheet for cells (named “Cells”)
pv style col row headers Longint -2 Default style sheet for column and row headers (named “Columns/Rows Headers”)
pv style page footer header Longint -3 Default style sheet for printed page header and footer (named “Page Header & footer”

Note: These style sheets can be edited using the Style Sheets command in the 4D View's Style menu.

Example  

This method allows defining properties for a new style. In this example, we will set a value for each of the three style properties to customize:

  • The "horizontal alignment" property will become "to the left",
  • The "vertical alignment" property will become "center",
  • The "rotation" property will become "90 degrees".
 ARRAY LONGINT($ArrayProps;3) `Stylesheet properties array
 ARRAY LONGINT($ArrayValues;3) `Value of each property
 
 C_STRING(255;$StyleName`Name of style to add to Area
 
 ARRAY LONGINT($StyleNumArray;0) `Style numbers array
 ARRAY STRING(255;$StyleNameArray;0) `Style names array
 C_INTEGER($Index`Loop index
 C_INTEGER($Position`Position of new style in number and name arrays
 
  `Initialization
 $ArrayProps{1}:=pv style hor alignment `Corresponding properties...
 $ArrayProps{2}:=pv style vert alignment
 $ArrayProps{3}:=pv style rotation
 
 $ArrayValues{1}:=pv value hor alignment left `...and values
 $ArrayValues{2}:=pv value hor alignment center
 $ArrayValues{3}:=pv value rotation 90
 
 $StyleName:="subparagraph"
 
 PV GET STYLE LIST(Area;$StyleNumArray;$StyleNameArray`List of available styles
 
 If(Find in array($StyleNameArray;$StyleName)=-1) `Style $StyleName absent ?
    $Position:=Size of array($StyleNameArray)+1 `We will add it
    INSERT IN ARRAY($StyleNameArray;$Position`Resize arrays
    INSERT IN ARRAY($StyleNumArray;$Position)
    $StyleNameArray{$Position}:=$StyleName  `Assign name of new style
    $StyleNumArray{$Position}:=PV Add style(Area;$StyleName`Assign number of new style
 
    For($Index;1;Size of array($ArrayProps)) `For all properties to be set
       If(PV Get style property(Area;$StyleNumArray{$Position};$ArrayProps{$Index})#$ArrayValues{$Index})
          PV SET STYLE PROPERTY(Area;$StyleNumArray{$Position};$ArrayProps{$Index};$ArrayValues{$Index})
       End if `Property doesn't have the desired value?
    End for `Review array $ArrayProps of stylesheet properties
 
 Else
    ALERT("The style'"+$StyleName+"' is already present in the area.")
 End if

 
PROPERTIES 

Product: 4D
Theme: PV Style
Number: 15891

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: 4D View 6.8

 
SEE ALSO 

PV Get style property