Jump to content
Sign in to follow this  
Squirrely1

Englarge an Edit control's Undo queue - Solved

Recommended Posts

Squirrely1

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

Share this post


Link to post
Share on other sites
jdelaney

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.

Share this post


Link to post
Share on other sites
Squirrely1

Maybe what I'm asking for look too much looking like a vicious key-logger.


Das Häschen benutzt Radar

Share this post


Link to post
Share on other sites
kylomas

Squirrely1,

This thread may interest you...it will certainly hint at why there is little response to your post.

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites
Squirrely1

jdelaney, Thank-you for your help.

kylomas, Thank-you.


Das Häschen benutzt Radar

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.