ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Controls, pages and windows / Diagram editor functions
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
<diagLibrary variable>.LoadLibrary (Function)
In french: <Variable diagBibliothèque>.ChargeBibliothèque
Loads a diagram file and creates a library of preset shapes from it.
Example
// Add a new library
MyLibrary is diagLibrary
MyLibrary.LoadLibrary("Furniture01.wddiag")
MyLibrary.Name = "Furniture"
DIAGEDT_Diagram.Library.Add(MyLibrary)
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
TempLibrary.Save(sFile)
 
// Load the diagram as a library
MyLibrary is diagLibrary
MyLibrary.LoadLibrary(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
<Result> = <Library>.LoadLibrary(<File>)
<Result>: Boolean
  • True if the library has been loaded,
  • False otherwise. ErrorInfo returns more details about the error.
<Library>: diagLibrary variable
Name of the diagLibrary variable into which the file corresponding to the library must be imported.
<File>: Character string
Full path of the diagram file corresponding to the library to be imported. This file corresponds to a diagram previously saved with <Diagram editor>.Save.
Remarks
  • A library corresponds to a diagram file created with <Diagram editor>.Save (".wddiag" file).
  • <diagLibrary variable>.LoadLibrary transforms a diagram into a library of preset shapes that can be displayed in the left panel of the Diagram Editor control.
  • To use only your custom libraries, delete the default libraries. To do so, use <Array>.DeleteAll on the array of libraries of the diagram. Example:
    DIAGEDT_Diagram.Library.DeleteAll()
Component: wd290mdl.dll
Minimum version required
  • Version 27
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 06/19/2023

Send a report | Local help