From dc870e19bf48049725b76e0fd74d82ba1b76a5d8 Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Mon, 11 Jun 2018 00:47:47 -0300 Subject: [PATCH] Tweaked Undo/Redo behavior. --- InForm/UiEditor.bas | 6 ++---- InForm/UiEditorPreview.bas | 11 +++++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/InForm/UiEditor.bas b/InForm/UiEditor.bas index 14ce5fb..1ab1a40 100644 --- a/InForm/UiEditor.bas +++ b/InForm/UiEditor.bas @@ -595,11 +595,9 @@ SUB __UI_Click (id AS LONG) Control(FileList).Value = 0 Control(FileList).LastVisibleItem = 0 'Reset it so it's recalculated CASE EditMenuUndo - b$ = MKI$(0) - SendData b$, 214 + SendSignal 214 CASE EditMenuRedo - b$ = MKI$(0) - SendData b$, 215 + SendSignal 215 CASE EditMenuCopy b$ = MKI$(0) SendData b$, 217 diff --git a/InForm/UiEditorPreview.bas b/InForm/UiEditorPreview.bas index 0977d08..b852da5 100644 --- a/InForm/UiEditorPreview.bas +++ b/InForm/UiEditorPreview.bas @@ -343,22 +343,22 @@ SUB __UI_BeforeUpdateDisplay IF __UI_IsDragging THEN IF NOT WasDragging THEN - SaveUndoImage WasDragging = True END IF ELSE IF WasDragging THEN + SaveUndoImage WasDragging = False END IF END IF IF __UI_IsResizing THEN IF NOT WasResizing THEN - SaveUndoImage WasResizing = True END IF ELSE IF WasResizing THEN + SaveUndoImage WasResizing = False END IF END IF @@ -451,6 +451,10 @@ SUB __UI_BeforeUpdateDisplay END IF ELSEIF TempValue = -7 THEN __UI_RestoreImageOriginalSize + ELSEIF TempValue = 214 THEN + RestoreUndoImage + ELSEIF TempValue = 215 THEN + RestoreRedoImage END IF LOOP @@ -970,8 +974,7 @@ SUB __UI_BeforeUpdateDisplay NEXT IF CVL(b$) > 0 THEN Control(CVL(b$)).ControlIsSelected = True - CASE 214 TO 221 - b$ = ReadSequential$(Property$, 2) + CASE 216 TO 221 __UI_KeyPress TempValue CASE 222 'New textbox control with the NumericOnly property set to true b$ = ReadSequential$(Property$, 2)