Enable "overwrite" in text field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Enable "overwrite" in text field
Hello,
how can I enable "overwrite" in a text field?
Thank you!
how can I enable "overwrite" in a text field?
Thank you!
Dear ale870,
What do you mean exactly?
It is always possible to use the put command to put data into a field.
You can set the lockText to false to type in a field directly. You can do this in the property inspector or by script.
Please, make sure to read the users manual, which is included with Revolution as a pdf file.
Best,
Mark
What do you mean exactly?
It is always possible to use the put command to put data into a field.
You can set the lockText to false to type in a field directly. You can do this in the property inspector or by script.
Please, make sure to read the users manual, which is included with Revolution as a pdf file.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Hi,
If you want to handle the insert key (which my keyboard currenty doesn't have), your field might need a rawKeyDown handler:
on rawKeyDown thekey
put theKey
end rawKeyDown
Suppose that this puts 12345 into the message box, then you need to write the following script replacing the one above:
This might do what you want. Let me know how it goes.
Best,
Mark
If you want to handle the insert key (which my keyboard currenty doesn't have), your field might need a rawKeyDown handler:
on rawKeyDown thekey
put theKey
end rawKeyDown
Suppose that this puts 12345 into the message box, then you need to write the following script replacing the one above:
Code: Select all
on rawKeyDown thekey
if theKey is 12345 then
if the hilite of btn "Toggle" then
delete the selection
else
select before the selectedChunk
end if
end if
pass rawKeyDown
end rawKeyDown
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Thank you.
Yes I want to manage "insert" and "overwrite". But I want to manage those properties not using the keyboard (neither my keyboard has that button!), but via code. Something like:
(not real code, just an example!)
Yes I want to manage "insert" and "overwrite". But I want to manage those properties not using the keyboard (neither my keyboard has that button!), but via code. Something like:
Code: Select all
set the overwrite of field "x" to true
Dear ale870,
Jeff and I have made a few guesses about what exactly you want, but apparently we're not entirely correct. Can you give an exact description of what you want to happen?
Best,
Mark
Jeff and I have made a few guesses about what exactly you want, but apparently we're not entirely correct. Can you give an exact description of what you want to happen?
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
I'm sorry, I'm sure I was not clear (furthermore my english is not "perfect").
Basically I want to enable "INSERT/OVERWRITE" features (as @massung said), but not using key on the keyboard.
Well, when you open a text editor, you start to write something, and if you press OVERWRITE key on the keyboard, typed letters overwrite existing ones. See this example:
If I put my cursor between the words "this is", when I start to type on the keyboard in overwrite mode, the remaining text ("is my text") will be over-written by the new text I'm typying:
As you can see, text "elephant" has overwritten old text.
I want to enable this features (enable INSERT or OVERWRITE) not using the right key on the keyboard but using a function in RunRev (some property like "the overwrite of field..."). Obviously, this property does not exist (I think), so I "invented" it just to make an example.
[/code]
Basically I want to enable "INSERT/OVERWRITE" features (as @massung said), but not using key on the keyboard.
Well, when you open a text editor, you start to write something, and if you press OVERWRITE key on the keyboard, typed letters overwrite existing ones. See this example:
Code: Select all
this is my text
Code: Select all
this is my text
^
PUT CURSOR HERE:
THEN I START TYPING (I will write "elephant")...
this elephantxt
I want to enable this features (enable INSERT or OVERWRITE) not using the right key on the keyboard but using a function in RunRev (some property like "the overwrite of field..."). Obviously, this property does not exist (I think), so I "invented" it just to make an example.
[/code]
Hi ale870,
Put the following into the script of a field.
This should get you started.
Best,
Mark
Put the following into the script of a field.
Code: Select all
on keyDown
if length(the selectedText) is 0 then
delete char (word 2 of the selectedChunk) of me
else
delete the selectedChunk
end if
pass keyDown
end keyDown
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode