Skip to main content
Apr 7, 2009 7:14 PM UTC
Answered

interactionManager alwaysShowSelection?

Is there anything in the TextFlow.interactionManager (EditManager or SelectionManager) similar to the old TextField.alwaysShowSelection (to keep showing the selected/highlighted text even after loss of focus)?

This topic is closed to new replies. Start a new post to keep the conversation going.
robin_briggsCorrect answer
Adobe Employee
Apr 7, 2009 11:11 PM UTC

There are three different selection states in TLF, and you can set a different display format for each one. The three states are: focus, no focus, and inactive. Focus is when the text has key focus. No focus means it does not have key focus, but it is in the active window. Inactive means that the window the text is in is not the active window.You can specify a different SelectionFormat for each state (see ISelectionManager focusSelectionFormat, inactiveSelectionFormat, and noFocusSelectionFormat). If you want the selection to be highlight but grey when it is not in focus, just set the noFocusSelectionFormat to grey.

Here's some example code that uses custom SelectionFormats, given a SelectionManager or a TextFlow:

     var selectionManager:ISelectionManager = textFlow.interactionManager;

     selectionManager.noFocusSelectionFormat = new SelectionFormat(0xa8c6ee, 1.0, BlendMode.NORMAL, 0xa8c6ee, 1.0, BlendMode.NORMAL, 0);

   selectionManager.noFocusSelectionFormat =  new SelectionFormat(0xe8e8e8, 1.0, BlendMode.NORMAL, 0xe8e8e8, 1.0, BlendMode.NORMAL, 0);

I hope this helps,

- robin

1 reply

robin_briggsCorrect answer
Adobe Employee
Apr 7, 2009 11:11 PM UTC

There are three different selection states in TLF, and you can set a different display format for each one. The three states are: focus, no focus, and inactive. Focus is when the text has key focus. No focus means it does not have key focus, but it is in the active window. Inactive means that the window the text is in is not the active window.You can specify a different SelectionFormat for each state (see ISelectionManager focusSelectionFormat, inactiveSelectionFormat, and noFocusSelectionFormat). If you want the selection to be highlight but grey when it is not in focus, just set the noFocusSelectionFormat to grey.

Here's some example code that uses custom SelectionFormats, given a SelectionManager or a TextFlow:

     var selectionManager:ISelectionManager = textFlow.interactionManager;

     selectionManager.noFocusSelectionFormat = new SelectionFormat(0xa8c6ee, 1.0, BlendMode.NORMAL, 0xa8c6ee, 1.0, BlendMode.NORMAL, 0);

   selectionManager.noFocusSelectionFormat =  new SelectionFormat(0xe8e8e8, 1.0, BlendMode.NORMAL, 0xe8e8e8, 1.0, BlendMode.NORMAL, 0);

I hope this helps,

- robin

Translate