is it possible to undo and redo for input object ???
this code doesnt undo when i add codeInput.Undo("Input1");
Professional Software Development Tools
is it possible to undo and redo for input object ???
this code doesnt undo when i add codeInput.Undo("Input1");
Last edited by GoOgLe; 03-23-2007 at 03:56 PM.
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!!
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
is it possible with ams or i am wasting time ?????
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 notworks : google
doesnt work : google or google or any other code
Open your eyes to Narcissism, Don't let her destroy your life!!
will u help me with ordered and unordered list Rizlauk ???
Last edited by GoOgLe; 03-24-2007 at 11:23 AM.
ok, heres my code,
orderd list
PHP Code:strText = Input.GetText(MainInput);
cPos = GetCaretPos(MainInput)
BeforCaret = String.Mid(strText, 1, cPos);
AfterCaret = String.Mid(strText, cPos+1, -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[LIST=1]");
Table.Insert(tbList, 2, "[*]"..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(tbList, tbCount, "[*]"..ListItem);
else
break
end
end
if tbCount == nil then
tbCount=2
end
Table.Insert(tbList, tbCount+1, "[/LIST]");
strList = Table.Concat(tbList, "\r\n", 1, TABLE_ALL);
Input.SetText(MainInput, BeforCaret..strList..AfterCaret);
strCount = String.Length(strList);
reloc=cPos+strCount+1
Input.SetSelection(MainInput, reloc, reloc+2);
Input.SetText("Input1", strCount);
end
unorderd list
PHP Code:strText = Input.GetText(MainInput);
cPos = GetCaretPos(MainInput)
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[LIST]");
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, "[/LIST]");
strList = Table.Concat(tbList, "\r\n", 1, TABLE_ALL);
Input.SetText(MainInput, BeforCaret..strList..AfterCaret);
strCount = String.Length(strList);
reloc=cPos+strCount+1
Input.SetSelection(MainInput, reloc, reloc+2);
Input.SetText("Input1", strCount);
end
Open your eyes to Narcissism, Don't let her destroy your life!!
do i have to cahnge all maininputs to input1 ????? when i change like that then it puts a number in input1 why ???
and if i dont change the input names then i get this errorCode: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"); 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
- "); 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, "
Last edited by GoOgLe; 03-24-2007 at 01:09 PM.
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!!
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
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!!
can someone help me please ???
Code:Input.Redo("Input1");Code:Input.Undo("Input1");