×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Mar 2006
    Location
    Pune, India
    Posts
    75

    How to identify position displayed in RichTextEditor

    Hi,

    Can some one help in how to identify the position of RichText that is displayed on screen?

    Let me elaborate it further. I have a text with say 100 characters. But at a time, because of screen size or editor size only say 25 (just an assumption) characters is displayed. Now if i Scroll down then my visible range would change.

    I am interested in this visible range, that is start character position and end character position of visible range.

    If there aren't any direct API's than can some one suggest me some work around or some references.

    Thanks in Advance
    Ashfaq Ghori
    Ashfaq Ghori
    Symbian Developer
    Mumbia - India

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Smile Re: How to identify position displayed in RichTextEditor

    Hello Ashfaq,

    I don't know whether it's appropriate to yr requirement or not.
    But i have found following for u.

    From Symbian Development Library:
    Use CRichText::CharPosOfParagraph() to find the document position of the first character in the second paragraph. The second argument to this function is the offset number of the paragraph so that. paragraph number 1 indicates the second paragraph. Note that when applying paragraph formatting, any character position within the paragraph is equally valid.
    pos=iRichText->CharPosOfParagraph(1,1); // get start of second para
    Regards.
    Kiran.

  3. #3
    Regular Contributor
    Join Date
    Mar 2006
    Location
    Pune, India
    Posts
    75

    Re: How to identify position displayed in RichTextEditor

    Thank you Kiran,
    Actually at runtime I don't know which paragraph is displayed, Hence what i require is in the Visible area which positions are displayed (start and end pos).

    Regards,
    Ashfaq Ghori
    Ashfaq Ghori
    Symbian Developer
    Mumbia - India

  4. #4
    Regular Contributor
    Join Date
    Mar 2006
    Location
    Pune, India
    Posts
    75

    Re: How to identify position displayed in RichTextEditor

    Hi,
    I have got a way around. what I have done is used XyPosToDocPosL of CTextView passing top-left cootdinates ie TPoint(0,2), and bottom - right coordinates ie. TPoint(176,143). (Taken some margin so that position returned are in visible area)

    This gave me doc positions that are in visible range.

    Ashfaq Ghori
    Ashfaq Ghori
    Symbian Developer
    Mumbia - India

Similar Threads

  1. RichTextEditor problem
    By ninidotnet in forum Symbian User Interface
    Replies: 2
    Last Post: 2006-05-19, 04:51
  2. how to get the position of a cascaded item in a menu?
    By GeKI in forum Symbian User Interface
    Replies: 1
    Last Post: 2006-05-18, 15:47
  3. dialog position control...
    By platinnum in forum Symbian
    Replies: 1
    Last Post: 2005-04-28, 06:02
  4. Custom item not displayed correctly
    By kakoskin in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2004-10-11, 21:50
  5. How to get the Cursor Position?
    By yuva69 in forum Symbian
    Replies: 1
    Last Post: 2002-09-03, 05:09

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×