Skip to main content
Known Participant
November 7, 2008
Question

Deselect a Text ??

  • November 7, 2008
  • 3 replies
  • 790 views
Why a text object can't be deselect after insert string using ITextRange?

Thanks for the help in advance.

hanyang
This topic has been closed for replies.

3 replies

A. Patterson
Inspiring
November 7, 2008
[Edit] Apparently I was wrong -- never mind!
jdyyzAuthor
Known Participant
November 7, 2008
I found if the text object was created by using menuitem, it wouldn't be selected, but if it created by using filter, the text object would be selected, even if it has be deselected.
jdyyzAuthor
Known Participant
November 7, 2008
Here is the sample code:

////////////////////////////////////////////////////////////

AIArtHandle textHandle = NULL;
AIRealPoint location = { 10, 10 };

TextRangeRef textRangeReference = nil;

sAITextFrame->NewPointText( kPlaceInsideOnTop,
MotherPath,
kHorizontalTextOrientation,
location, &textHandle );


sAITextFrame->GetATETextRange( textHandle, &textRangeReference );

ITextRange textRange( textRangeReference );

textRange.InsertAfter( "anything" );

sAIArt->SetArtUserAttr ( textHandle, kArtSelected | kArtFullySelected, 0 ); // can't work!!

////////////////////////////////////////////////////////////