|
|
|
|
<Window>.EdDo (Window) In french: <Fenêtre>.EdDo Runs an action (defined programmatically) and enables Undo/Redo operations on this action. 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"). WIN_MyEditor.EdDo(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
<Window>.EdDo(<WLanguage procedure> [, <Parameter 1> [... [, <Parameter N>]]])
<Window>: Window name Name of the window or internal window to be used. This window must be in edit mode (<Window>.EdActive). <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 <Window>.EdDo is used to create custom actions (control creation for example) that support the undo/redo. Let's take a simple example: creating a graphic 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 (<Window>.EdActive).
- Calling <Window>.EdDo. 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 cancellation.
- The window switches to standard mode (<Window>.EdActive).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|