PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | French EN
  • Use example
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Runs an action (defined by programming) with support for Undo/Redo. This function is linked to the "UI modification by end user" feature.
This function is mainly used when creating an editor by programming (see "Remarks").
Example
WinEdDo(WIN_MyEditor, ProcCreateCap, "New")
INTERNAL PROCÉDURE ProcCreateCap(sCap)
pNew is Control
pNew <- ControlCreate("STC_" + GetIdentifier(), typText, 150, 150, 80, 20)
pNew..Caption = sCap
WinEdDeclareUndo(ProcCancel)
INTERNAL PROCÉDURE ProcCancel()
ControlDelete(pNew)
END
END
Syntax
WinEdDo(<Window> , <WLanguage procedure> [, <Parameter 1> [... [, <Parameter N>]]])
<Window>: Window name
Name of window or internal window to use. This window must be in modification mode (WinEdActive).
<WLanguage procedure>: Procedure name
Name of WLanguage procedure to run. The code of this procedure must call WinEdDeclareUndo. The actions of this procedure will be taken into account in Undo/Redo.
Remark: 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.
<Parameter N>: Any optional type
Nth optional parameter that will be passed to the procedure.
Remarks

Use example

WinEdDo is used to create custom actions (control creation for example) that support the undo/redo.
Let's take a simple example: creating an editor of graphic objects.
A button is used to create a shape. The user must have the ability to cancel the shape creation. The following operations are performed:
  • Switching the window to modification mode (WinEdActive).
  • Calling 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 user cancelation.
  • Switching the window to normal mode (WinEdActive).
The end user can cancel this action (Ctrl + Z or call to WinEdUndo) and eventually redo it (Ctrl + Y or call to WinEdRedo).
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 : wd250obj.dll
Minimum version required
  • Version 21
This page is also available for…
Comments
Click [Add] to post a comment