PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN

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 Library property allows you to handle the different preset libraries associated with a Diagram Editor control. This property accesses the array of libraries of the Diagram Editor control.
Example
sFile is string = fTempDir() + [ fSep ] + "custom_library.wddiag"
 
// Creates a library entirely through programming
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.")
Syntax

Getting the characteristics of a library Hide the details

<Result> = <Diagram Editor control>.Library[<Library index>]
<Result>: diagLibrary variable
diagLibrary variable. All the properties of variables of type diagLibrary can be used.
<Diagram Editor control>: Control name
Name of the Diagram Editor control.
<Library index>: Integer
Index of the library to be used.

Changing a library Hide the details

<Diagram Editor control>.Library[<Library index>] = <New value>
<Diagram Editor control>: Control name
Name of the Diagram Editor control.
<Library index>: Integer
Index of the library to be used.
<New value>: diagLibrary variable
Name of the diagLibrary variable to be associated.
Minimum version required
  • Version 27
This page is also available for…
Comments
Click [Add] to post a comment