Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 12 of 12
  1. #1
    Join Date
    Mar 2007
    Posts
    452

    Input Undo - Redo Help

    is it possible to undo and redo for input object ???

    Input.Undo("Input1");
    this code doesnt undo when i add code
    Last edited by GoOgLe; 03-23-2007 at 03:56 PM.

  2. #2
    Join Date
    May 2006
    Posts
    5,380
    Input.Undo has always worked for me, how are you useing it, are you sure its assigned to the right input object
    Open your eyes to Narcissism, Don't let her destroy your life!!

  3. #3
    Join Date
    Mar 2007
    Posts
    452
    it works for me too when i type something but if i add a code to the text i wrote it doesnt work...

    example:

    works : google

    doesnt work : [FONT="Arial"]google[/FONT] or [color="#FFFFFF"]google[/color] or any other code

  4. #4
    Join Date
    Mar 2007
    Posts
    452
    is it possible with ams or i am wasting time ?????

  5. #5
    Join Date
    May 2006
    Posts
    5,380
    works : google

    doesnt work : google or google or any other code
    i think thats because there was no actual keystroke in the input object, try useing worms keystroke dll to force a keystroke while the code is being added.....it might work....it might not
    Open your eyes to Narcissism, Don't let her destroy your life!!

  6. #6
    Join Date
    Mar 2007
    Posts
    452
    will u help me with ordered and unordered list Rizlauk ???
    Last edited by GoOgLe; 03-24-2007 at 11:23 AM.

  7. #7
    Join Date
    May 2006
    Posts
    5,380
    ok, heres my code,

    orderd list
    PHP Code:
    strText Input.GetText(MainInput);
    cPos GetCaretPos(MainInput)

        
    BeforCaret String.Mid(strText1cPos);
        
    AfterCaret String.Mid(strTextcPos+1, -1);    
        
        
    count=1
        ListItem 
    Dialog.Input("Ordered List""Enter Item: 1"""MB_ICONNONE);
            if 
    ListItem ~= "" and ListItem ~= "CANCEL" then
            tbList 
    = {}
            
    Table.Insert(tbList1"\r\n[LIST=1]");
            
    Table.Insert(tbList2"[*]"..ListItem);
            
            while (
    ListItem ~= "") do
            
    count=count+1
            ListItem 
    Dialog.Input("Ordered List""Enter Item: "..count.." , Leave Blank or Click Cancel To End The List"""MB_ICONNONE);
                    if 
    ListItem ~= "" and ListItem ~= "CANCEL" then
                    tbCount 
    Table.Count(tbList);
                    
    tbCount=tbCount+1
                    Table
    .Insert(tbListtbCount"[*]"..ListItem);
                    else
                    break
                    
    end
            end
        
    if tbCount == nil then
        tbCount
    =2
        end
        Table
    .Insert(tbListtbCount+1"[/LIST]");
        
    strList Table.Concat(tbList"\r\n"1TABLE_ALL);
        
    Input.SetText(MainInputBeforCaret..strList..AfterCaret);
        
    strCount String.Length(strList);
        
    reloc=cPos+strCount+1
        Input
    .SetSelection(MainInputrelocreloc+2);
        
    Input.SetText("Input1"strCount);
    end 

    unorderd list
    PHP Code:
    strText Input.GetText(MainInput);
    cPos GetCaretPos(MainInput)

        
    BeforCaret String.Mid(strText1cPos);
        
    AfterCaret String.Mid(strTextcPos+3, -1);    
        
        
    count=1
        ListItem 
    Dialog.Input("Ordered List""Enter Item: 1"""MB_ICONNONE);
    if 
    ListItem ~= "" and ListItem ~= "CANCEL" then
        tbList 
    = {}
        
    Table.Insert(tbList1"\r\n[LIST]");
        
    Table.Insert(tbList2"[*]"..ListItem);
        while (
    ListItem ~= "") do
        
    count=count+1
        ListItem 
    Dialog.Input("Unordered List""Enter Item: "..count.." , Leave Blank or Click Cancel To End The List"""MB_ICONNONE);
            if 
    ListItem ~= "" and ListItem ~= "CANCEL" then
            unCount 
    Table.Count(tbList);
            
    unCount=unCount+1
            Table
    .Insert(tbListunCount"[*]"..ListItem);
            else
            break
            
    end
        end
        
    if unCount == nil then
        unCount
    =2
        end
        Table
    .Insert(tbListunCount+1"[/LIST]");
        
    strList Table.Concat(tbList"\r\n"1TABLE_ALL);
        
    Input.SetText(MainInputBeforCaret..strList..AfterCaret);
        
    strCount String.Length(strList);
        
    reloc=cPos+strCount+1
        Input
    .SetSelection(MainInputrelocreloc+2);
        
    Input.SetText("Input1"strCount);

    end 
    Open your eyes to Narcissism, Don't let her destroy your life!!

  8. #8
    Join Date
    Mar 2007
    Posts
    452
    do i have to cahnge all maininputs to input1 ????? when i change like that then it puts a number in input1 why ???

    Code:
    strText = Input.GetText("Input1"); 
    cPos = GetCaretPos("Input1") 
    
        BeforCaret = String.Mid(strText, 1, cPos); 
        AfterCaret = String.Mid(strText, cPos+3, -1);     
         
        count=1 
        ListItem = Dialog.Input("Ordered List", "Enter Item: 1", "", MB_ICONNONE); 
    if ListItem ~= "" and ListItem ~= "CANCEL" then 
        tbList = {} 
        Table.Insert(tbList, 1, "\r\n
    • "); Table.Insert(tbList, 2, "
    • "..ListItem); while (ListItem ~= "") do count=count+1 ListItem = Dialog.Input("Unordered List", "Enter Item: "..count.." , Leave Blank or Click Cancel To End The List", "", MB_ICONNONE); if ListItem ~= "" and ListItem ~= "CANCEL" then unCount = Table.Count(tbList); unCount=unCount+1 Table.Insert(tbList, unCount, "
    • "..ListItem); else break end end if unCount == nil then unCount=2 end Table.Insert(tbList, unCount+1, "
    "); strList = Table.Concat(tbList, "\r\n", 1, TABLE_ALL); Input.SetText("Input1", BeforCaret..strList..AfterCaret); strCount = String.Length(strList); reloc=cPos+strCount+1 Input.SetSelection("Input1", reloc, reloc+2); Input.SetText("Input1", strCount); end
    and if i dont change the input names then i get this error
    Attached Images
    Last edited by GoOgLe; 03-24-2007 at 01:09 PM.

  9. #9
    Join Date
    May 2006
    Posts
    5,380
    delete that line off the end

    " Input.SetText("Input1", strCount); "

    i was useing that for the overall post length, its not needed, my test object was called input1, look at the code, the last 2 lines you are setting the text twice

    strList = Table.Concat(tbList, "\r\n", 1, TABLE_ALL);
    Input.SetText("Input1", BeforCaret..strList..AfterCaret);
    strCount = String.Length(strList);
    reloc=cPos+strCount+1
    Input.SetSelection("Input1", reloc, reloc+2);

    Input.SetText("Input1", strCount); --DELETE THIS LINE

    dude, if you are not taking the time to even look at the code then im afraid you are not going to get very far with this or any other project

    remember, this code is stright from my project, you will have to edit the names to suit your project

    and as for the error you posted, line 1 arg 1 must be a string, relates to the name of your input object on line 1, check your code
    Last edited by RizlaUK; 03-24-2007 at 01:25 PM.
    Open your eyes to Narcissism, Don't let her destroy your life!!

  10. #10
    Join Date
    Mar 2007
    Posts
    452
    that worked Rizlauk Thanks and sorry
    i changed the input names but i got error again thats why i tried without changing the name... but i got error again

  11. #11
    Join Date
    May 2006
    Posts
    5,380
    it pays, when someone gives you code to take a little time to examin it line by line (as thats what i do) as most of the time code is from someones project/example and can contain lines of code that were only there for testing or typed out at the forum and contains a small typo that the forum isent able to pick up on like ams dose, and most of the time the code is incompatable with your project with out minor editing

    that way you get a little understanding of how it works and makes it easy to reproduce at a later time

    but anyway, glad you got it working
    Open your eyes to Narcissism, Don't let her destroy your life!!

  12. #12
    Join Date
    Mar 2007
    Posts
    452
    can someone help me please ???

    Code:
    Input.Redo("Input1");
    Code:
    Input.Undo("Input1");

Similar Threads

  1. Input Box Wierdness
    By Roboblue in forum AutoPlay Media Studio 6.0
    Replies: 9
    Last Post: 11-18-2005, 01:20 PM
  2. Input object graying out
    By dthompson16 in forum AutoPlay Media Studio 5.0
    Replies: 7
    Last Post: 07-28-2004, 07:28 PM
  3. Lorne’s two great input validation scripts
    By csd214 in forum AutoPlay Media Studio 5.0
    Replies: 2
    Last Post: 06-09-2004, 09:13 AM
  4. Function: Test Whether An Input Object Is Empty
    By Lorne in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 06-08-2004, 02:18 PM
  5. multiline input table apocalypse
    By dulux1309 in forum AutoPlay Media Studio 5.0
    Replies: 1
    Last Post: 04-09-2004, 05:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts