ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Diagram Editor functions / Types of variables
  • Properties specific to diagLibrary variables
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
diagLibrary (Variable type)
In french: diagBibliothèque
The diagLibrary type is used to define all the advanced characteristics of a library of preset shapes used by a Diagram Editor control. You can define and change the characteristics of this library using different WLanguage properties.
Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Example
sFile is string = fTempDir() + [ fSep ] + "custom_library.wddiag"

// Creates a library entirely programmatically
TempLibrary is Diagram

D1 is diagOval
D1.Width = 50
D1.Height = 50
D1.Background.Color = DarkRed
Add(TempLibrary.Shape, D1)

D2 is diagOval
D2.Width = 50
D2.Height = 70
D2.Background.Color = DarkGreen
Add(TempLibrary.Shape, D2)

// Use the shapes of the temporary diagram to create the library
// Saves the diagram to the disk
DiagramSave(TempLibrary, sFile)

// Load the diagram as a library
MyLibrary is diagLibrary
DiagramLoadLibrary(MyLibrary, sFile)
MyLibrary.Name = "Custom"

// Adds the library to the Diagram Editor control
Add(DIAGEDT_Diagram.Library, MyLibrary)

ToastDisplay("The custom library has been added to the list.")
MyDiagram is Diagram
// Populate a Looper control with all the shapes from all the libraries
FOR EACH Lib OF MyDiagram.Library
FOR EACH Shape OF Lib
imgShape is Image = DiagramShapeToImage(Shape)
LooperAddLine(LOOP_MyLooper, Lib.Name, imgShape, Shape.Name)
END
END
Properties

Properties specific to diagLibrary variables

The following properties can be used to handle diagLibrary variables:
Property nameType usedEffect
NameCharacter stringName of the shape library.
ShapeArray of diagShapeArray of preset shapes.
Remarks
  • By default, shape libraries are displayed in the left panel of the Diagram Editor control.
  • The Library property of the Diagram Editor control corresponds to an array of variables of type diagLibrary.
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: 09/26/2024

Send a report | Local help