ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Diagram editor functions / Types of variables
  • Properties specific to Diagram variables
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
The Diagram type is used to define all the advanced characteristics of a diagram that can be edited in the Diagram Editor control. The characteristics of this diagram 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.
Example
// Create a rectangle shape
MyShape is diagRectangle
 
// Set the dimensions, position and background color
MyShape.X = 100
MyShape.Y = 100
MyShape.Width = 350
MyShape.Height = 150
MyShape.Background.Color = PastelRed
MyShape.Comment = "Rectangle"
 
// Reference the displayed diagram
MyDiagram is Diagram <- DIAGEDT_MyDiagram
 
// Add the rectangle shape to the diagram
Add(MyDiagram.Shape, MyShape)
 
// Display the comment of the shape
Trace(MyDiagram.Shape[1].Comment)
// Move all shapes down
MyDiagram is Diagram <- DIAGEDT_MyDiagram.Value
FOR EACH ShapeInDiagram OF MyDiagram.Shape
ShapeInDiagram.Y += 10
END
Remarks

Properties specific to Diagram variables

The following properties can be used to handle a diagram:
Property nameType usedEffect
BackgroundColorIntegerBackground color of the diagram.
This property can correspond to:
  • an RGB color (returned by RGB),
  • an HSL color (returned by HSL),
  • a WLanguage preset color.
  • a variable of type Color. In this case, the opacity specified in the variable is taken into account.
RealSpacing between gridlines.
PageLayoutdiagLayoutDiagram layout. This layout is used for printing the diagram.
ShapeArray of diagShapeArray that contains the different shapes in the diagram.
This property is read-only.
ValueString, Buffer, etc.Value of the diagram. This property can correspond to:
  • a Diagram Editor control,
  • the path of a Diagram file,
  • a variable of type Buffer containing a diagram.
Related Examples:
The Diagram control Unit examples (WINDEV): The Diagram control
[ + ] Simplified use of a Diagram control
Minimum version required
  • Version 27
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/23/2023

Send a report | Local help