Unhiliting selected text in a field
Posted: Fri May 22, 2009 3:01 pm
Hi again, another noob question.
I have a field of text a user is working on. I have two problems.
1. I can't seem to find a field property that lets the user drag (mouseDown) across a phrase and visibly hilite it (like using a hiliter pen). Instead it sets the foreground color to the background color (making the text invisible) and underlines the selection with whatever color I have set the Hilite property to while they are dragging. I can't seem to find the right combination of properties in the Object Properties window to make this happen. I can set it after the fact using a script of course, but that doesn't help while they are dragging.
My question here is "Is it possible through Object Properties to make a field act like it is being hilited while the action is occuring?"
2. Then when the user is done, I want to reset all the hilites in the field by using:
set the backgroundcolor of field fInField to "white"
set the foregroundcolor of field fInField to "black"
This only sets the backgroundcolor in areas that don't already have text in them. I am using different color hilites to mark different contexts in a document, so the field gets quite messy in the process.
My question here is "Is there a simple way, without going word to word, to reset the various hilites I have in a field?"
3. So I tried using a "repeat for each word" but this returns the word, not it's chunk description. This brings on my third question, which I am sure is in the documents but I just can't find it.
"Is there a way to use repeat for each word and return the chunk description ("char 132 to char 168 of field 4" for example) rather than the chunk contents, so I can test or reset the text properties of that chunk?"
Or even better, go through and return each chunk hilited a certain way, as in:
repeat for each chunk with backcolor "255,255,0"
Thanks again.
I have a field of text a user is working on. I have two problems.
1. I can't seem to find a field property that lets the user drag (mouseDown) across a phrase and visibly hilite it (like using a hiliter pen). Instead it sets the foreground color to the background color (making the text invisible) and underlines the selection with whatever color I have set the Hilite property to while they are dragging. I can't seem to find the right combination of properties in the Object Properties window to make this happen. I can set it after the fact using a script of course, but that doesn't help while they are dragging.
My question here is "Is it possible through Object Properties to make a field act like it is being hilited while the action is occuring?"
2. Then when the user is done, I want to reset all the hilites in the field by using:
set the backgroundcolor of field fInField to "white"
set the foregroundcolor of field fInField to "black"
This only sets the backgroundcolor in areas that don't already have text in them. I am using different color hilites to mark different contexts in a document, so the field gets quite messy in the process.
My question here is "Is there a simple way, without going word to word, to reset the various hilites I have in a field?"
3. So I tried using a "repeat for each word" but this returns the word, not it's chunk description. This brings on my third question, which I am sure is in the documents but I just can't find it.
"Is there a way to use repeat for each word and return the chunk description ("char 132 to char 168 of field 4" for example) rather than the chunk contents, so I can test or reset the text properties of that chunk?"
Or even better, go through and return each chunk hilited a certain way, as in:
repeat for each chunk with backcolor "255,255,0"
Thanks again.