Hi again,
I want users to be able to highlight some words in a text field, but I have no idea how to do it. I have been reading the User guide and some of the entries in this forum but nothing is working. I tried with some like this:
on mouseEnter
set the backgroundcolor of selectedChunk to red
end mouseEnter
I also tried
on mouseEnter
set the linkHiliteColor to red
end mouseEnter
The dictionary says:
Use the linkHiliteColor property to make grouped text look and behave like links in a web browser.
Probably I am oversimplifying, I dont even know if my text is already groped. I would like users to have the option o highliting single words and chunks of text.
Marta
Higlighting text
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Hi Marta,
Any editable text in any application, including Revolution, can be hilited, simply by clicking in the field and dragging he mouse while keeping the mouse button pressed.
What exactly is your problem and why do you want this?
Best,
Mark
Any editable text in any application, including Revolution, can be hilited, simply by clicking in the field and dragging he mouse while keeping the mouse button pressed.
What exactly is your problem and why do you want this?
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 Mark,
It seems that I didn't explain what I want correctly. I want the user, not me, to be able to highlight the text. So I write write the text in a label field, and I want to program the possibility of my user to highlight certain words when (s)he puts the mouse over the words. I am in the field of foreign language education, so, in some situations I just want to use a highlighting tool as a study technique, in others, I want to provide the user with interactive glosses.
Marta
It seems that I didn't explain what I want correctly. I want the user, not me, to be able to highlight the text. So I write write the text in a label field, and I want to program the possibility of my user to highlight certain words when (s)he puts the mouse over the words. I am in the field of foreign language education, so, in some situations I just want to use a highlighting tool as a study technique, in others, I want to provide the user with interactive glosses.
Marta
Dear Marta,
Do you want to hilite text when the mouse hovers over/clicks on/moves away from/<fill in here> the text? Why do you use a label field and why can't you use a normal editable field?
You might want to check out the backColor property. You can set this property for idividual characters and word (actually in combinationw ith all chunk expressions). Read more bout the backColor property in the documentation.
Best,
Mark
Do you want to hilite text when the mouse hovers over/clicks on/moves away from/<fill in here> the text? Why do you use a label field and why can't you use a normal editable field?
You might want to check out the backColor property. You can set this property for idividual characters and word (actually in combinationw ith all chunk expressions). Read more bout the backColor property in the documentation.
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
-
- VIP Livecode Opensource Backer
- Posts: 4036
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Marta,
put this code into a text fieldand see what it does. It works on locked an unlocked text fields.
regards
Bernd
put this code into a text field
Code: Select all
local myOldWord
on mouseWithin
put the mouseCharChunk into aChar
put the number of words of char 1 to (word 4 of aChar) of me into myWord
if myOldWord is not "" then set the textColor of word myOldWord of me to ""
set the textColor of word myWord of me to red
put myWord into myOldWord
end mouseWithin
on mouseLeave
if myOldWord is not "" then set the textColor of word myOldWord of me to ""
end mouseLeave
regards
Bernd