The
diagSelection type is used to define all the advanced characteristics of a selection made in a diagram. The characteristics of this selection can be defined and changed using different WLanguage properties.
Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see
Declaring a variable.
// Retrieve the selected elements in a Diagram Editor control
MySelection is diagSélection <- DIAGEDT_MyDiagram.Selection
IF MySelection.Shape.Count > 0 THEN
// Get the shapes
FOR EACH stShape OF MySelection.Shape
STC_SELECTION_INFO = stShape.Name + "has been selected." +
" [ " + stShape.X + ", " + stShape.Y + " - " + stShape.Width +
"x" + stShape.Height + " ]"
END
ELSE
STC_SELECTION_INFO = "Click a shape in the diagram to get the selection"
END
Properties
Properties specific to diagSelection variables
The following properties can be used to handle a selection:
| | |
Property name | Type used | Effect |
---|
New in version 28Angle | Real | Angle of rotation of the selection. |
Background | | - Background color of the selected shape,
- -1 if no shape is selected or if multiple shapes are selected.
|
Border | diagBorder | Characteristics of the border of the selected shape. |
New in version 28Comment | Character string | Comment associated with the selection. |
Height | Real | - Height of the selection, expressed in pixels,
- -1 if no selection.
|
Link | diagConnector | Characteristics of the selected connector. |
Opacity | Integer | - Opacity percentage of the selected shape. This value ranges from invisible (0) to completely opaque (100).
- -1 if no shape is selected.
|
Round | Real | - Curvature of the selected shape,
- -1 if the shape has no rounded corners or if multiple shapes are selected.
|
Shadow | Boolean | - True if the shape has a shadow,
- False otherwise.
|
Shape | Array of diagShape | Shapes in the selection. |
Text | diagText | Characteristics of the text of the selected shape. |
Type | Integer constant | Type of the selected element |
Width | Real | - Width of the selection, expressed in pixels,
- -1 if no selection.
|
X | Real | - X-position of the box that contains the selection (expressed in pixels),
- -1 if no selection.
|
Y | Real | - Y-position of the box that contains the selection (expressed in pixels),
- -1 if no selection.
|
ZOrder | Integer | Z-order of the selection. |
Related Examples:
|
Unit examples (WINDEV): The Diagram control
[ + ] Simplified use of a Diagram control
|