Jump to content

Englarge an Edit control's Undo queue - Solved


Recommended Posts

I would be thankful for any scripts that can enlarge the undo queue

Or any good idea for a strategy for implementing undo's and redo's.

I found this script on the web but I do use AutoIt3 ...

case WM_CHAR:
         switch (wParam)
         {
             case 0x08:
                 // Process a backspace.
                 break;
             case 0x0A:
                 // Process a linefeed.
                 break;
             case 0x1B:
                 // Process an escape.
                 break;
             case 0x09:
                 // Process a tab.
                 break;
             case 0x0D:
                 // Process a carriage return.
                 break;
             default:
                 // Process displayable characters.
                 break;
         }

It seems so far that this is a kind of a difficult project.

Edited by Squirrely1

Das Häschen benutzt Radar

Link to comment
Share on other sites

Best I could think of is to house an array of all changes:

#include <GUIConstantsEx.au3>
#include <Array.au3>
    Local $file, $btn, $msg
 Local $array[1]
 $iStart = 1
 $iUbound = 1
 $iCurrent = 0
    GUICreate(" My GUI input acceptfile", 320, 120, @DesktopWidth / 2 - 160, @DesktopHeight / 2 - 45, -1, 0x00000018); WS_EX_ACCEPTFILES
    $input = GUICtrlCreateInput("", 10, 35, 300, 20) ; will not accept drag&drop files
    $btn = GUICtrlCreateButton("Undo", 40, 75, 60, 20)
 $btn2 = GUICtrlCreateButton("Redo", 100, 75, 60, 20)
    GUISetState()
 $sPrevious = ""
    $msg = 0
    While $msg <> $GUI_EVENT_CLOSE
        $msg = GUIGetMsg()
  If $sPrevious <> GUICtrlRead($input) Then
   $iCurrent+=1
   ConsoleWrite("$sPrevious " & $sPrevious & @CRLF)
   $sPrevious = GUICtrlRead($input)
   _ArrayInsert($array, $iCurrent, $sPrevious)
   $iUbound = UBound($array)
  EndIf
        Select
            Case $msg = $btn
    $iCurrent-=1
    ConsoleWrite("btn1 " & $iCurrent & @CRLF)
    If $iCurrent >= $iStart Then
     GUICtrlSetData($input, $array[$iCurrent])
     $sPrevious =  $array[$iCurrent]
    Else
     GUICtrlSetData($input, "")
     $sPrevious =  ""
     $iCurrent+=1
    EndIf
   Case $msg = $btn2
    $iCurrent+=1
    ConsoleWrite("btn2 " & $iCurrent & @CRLF)
    If $iCurrent < $iUbound Then
     GUICtrlSetData($input, $array[$iCurrent])
     $sPrevious =  $array[$iCurrent]
    Else
     $iCurrent-=1
    EndIf
        EndSelect
    WEnd
 _ArrayDisplay($array)
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...