4D v13

SVG_New_group

Home

 
4D v13
SVG_New_group

SVG_New_group 


 

SVG_New_group ( parentSVGObject {; id {; url {; target}}} ) -> Function result 
Parameter Type   Description
parentSVGObject  SVG_Ref in Reference of parent element
id  String in Name of group
url  String in External link
target  String in Target of link
Function result  SVG_Ref in Reference of group

The SVG_New_group command creates a group in the SVG container designated by parentSVGObject and returns its reference. If parentSVGObject is not an SVG document, an error is generated.

The group ('g' element) can be used to group together several linked graphic elements, which will inherit the properties of the group.

The optional id parameter can be used to assign a name to the group. Named groups are necessary for several purposes such as animation and reusable objects.

The optional url parameter can be used to associate an external link. Group objects are then clickable (similar to the 'a' element of HTML).

The optional target parameter specifies the name of the target where the document will open when the link is activated. The values expected are those of the HTML specification to which are added the 'new' value for opening a new window and the 'none' value which is equivalent to not processing this attribute.

Note: External links are ignored when the SVG is displayed in a picture object (variable or field) of a 4D form. Management of external references is handled by the rendering engine. Under these conditions, the result may depend on the platform and the viewing software.

A group of lines, all the same color:

 $SVG:=SVG_New
 $group:=SVG_New_group($SVG)
  `Assign a color to the group elements
 SVG_SET_STROKE_BRUSH($group;"firebrick")
 $newobject:=SVG_New_line($group;100;300;300;100;"";5)
 $newobject:=SVG_New_line($group;300;300;500;100;"";10)
 $newobject:=SVG_New_line($group;500;300;700;100;"";15)
 $newobject:=SVG_New_line($group;700;300;900;100;"";20)
 $newobject:=SVG_New_line($group;900;300;1100;100;"";25)

Clickable text:

 $SVG:=SVG_New
 $group:=SVG_New_group($SVG;"w3Link";"http://www.w3.org";"new")
 $newobject:=SVG_New_text($group;"www.w3.org";10;10;"arial";12;Underline;Align left;"blue")

 
PROPERTIES 

Product: 4D
Theme: Structure and Definitions
Number: 65990

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: Composant 4D SVG v11.3