Skip to main content
April 7, 2009
Answered

interactionManager alwaysShowSelection?

  • April 7, 2009
  • 1 reply
  • 742 views

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 has been closed for replies.
Correct answer robin_briggs

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
April 7, 2009

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