ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Controls, pages and windows / Windows functions that can be handled by the end user
  • Use example
  • Error
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Declares how to cancel an action that was added by WinEdDo. This function is linked to the "Allow end users to modify the UI" feature.
This function is mainly used when creating an editor through programming (see "Remarks").
Example
WinEdDo(FEN_MonEditeur, ProcCréeLib, "Nouveau")
INTERNAL PROCEDURE ProcCréeLib(sLib)
	pNouveau is Control
	pNouveau <- ControlCreate("LIB_" + GetIdentifier(), typText, 150, 150, 80, 20)
	pNouveau.Libellé = sLib 
	WinEdDeclareUndo(ProcAnnuler)
	INTERNAL PROCEDURE ProcAnnuler()
		ControlDelete(pNouveau)
	END
END
WinEdDeclareUndo(AnnulerOperation, CLIENT.IDClient)
// Gestion du Undo
INTERNAL PROCEDURE AnnulerOperation(nIDClient)
	IF HReadSeekFirst(CLIENT, IDClient, nIDClient) THEN
		SourceToScreen()
	END
END
Syntax
WinEdDeclareUndo(<WLanguage procedure> [, <Parameter 1> [... [, <Parameter N>]]])
<WLanguage procedure>: Procedure name
Name of WLanguage procedure to run. The code of this procedure must allow to cancel the action created by WinEdDo.
Using an internal procedure provides a direct access to the local variables.
<Parameter 1>: Any optional type
First optional parameter that will be passed to the procedure.
In most cases, these parameter are values used to restore the previous status.
<Parameter N>: Any optional type
Nth optional parameter that will be passed to the procedure.
In most cases, these parameter are values used to restore the previous status.
Remarks

Use example

WinEdDo is used to create custom actions (control creation for example) that support the undo/redo feature.
Let's take a simple example: creating a graphical object editor.
A button is used to create a shape. The user must have the ability to undo the shape creation. The following operations are performed:
  • The window switches to edit mode (WinEdActive).
  • Call function WinEdDo. The procedure called by this function is used to create the shape. This procedure also contains the call to WinEdDeclareUndo. WinEdDeclareUndo is used to define the behavior in case of cancellation by the user.
  • The window switches to standard mode (WinEdActive).
The end user can then cancel this action (Ctrl + Z or function WinEdUndo): the <Procédure WLangage> procedure will then be called up..

Error

A WLanguage error occurs if WinEdDeclareUndo is called outside a procedure added by WinEdDo.
Related Examples:
WD Graphic Objects Training (WINDEV): WD Graphic Objects
[ + ] This example illustrates the power of WLanguage in object oriented programming.
This example is a graphic object editor.

It is possible to:
- move, resize objects
- make selections with a lasso or a mouse
- cut/copy/paste objects
- delete/duplicate objects
- save the created documents and print them.

The main technical features presented and documented are:
- management of an object clipboard
- UNDO/REDO management
- serialization and deserialization of objects
- algorithms for managing graphic objects (proportional resizing, management of move rules, etc...)
Component: wd300obj.dll
Minimum version required
  • Version 21
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/28/2025

Send a report | Local help