Solved

TMemo Question

Posted on 1998-01-24
11
321 Views
Last Modified: 2010-04-04
Is there a way to convert the Rect.Left, Rect.Top values to the SelStart value of the TMemo??

PS: The Rect value is the position of the character in the TMemo

Thanks in Advance
0
Comment
Question by:test031097
  • 5
  • 5
11 Comments
 
LVL 5

Expert Comment

by:ronit051397
Comment Utility
Rect.Left of what?
0
 

Author Comment

by:test031097
Comment Utility
Ronit...

The Rect.Left is the X position of the character from the Memo itself and Rect.Top is the Y position


0
 
LVL 4

Expert Comment

by:itamar
Comment Utility
Perhaps, if you explain the objective of that we could help you further. It seems to me that Experts are having some trouble to understand your question.
Dou you want to change the selected area of a memo, or smth like that... ?

Bye,
Itamar
0
 

Author Comment

by:test031097
Comment Utility
Ok...

Actually, I'm using the TColorMemo (Version 2.0) component from Baltic Solutions and I used it to highlight some HTML Tags

Here's the problem...
I need to highlight the keywords (eg. FACE=, SIZE=) only if it's inside a HTML tag

The component has a DrawKey event that is called whenever a keyword needs to be highlighted and that event only provides the pointer to the keyword and the rectangular area that the keyword occupies...

What I need to do is to get the position of the keyword so that I can used it to check whether it is inside the HTML Tags and then do the necessary stuff

I hope it is clear enough





0
 
LVL 5

Expert Comment

by:ronit051397
Comment Utility
Is this control descent from TMemo?
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:test031097
Comment Utility
Ronit...

I don't know whether this control is a descendant of TMemo
but it does have most properties of it (Eg, SelStart, SelLength, GetTextLen)


0
 
LVL 5

Expert Comment

by:ronit051397
Comment Utility
I really don't understand what you mean. This is all I can help:

to get the character index by coordinates, call:
lo(ColorMemo1.perform(EM_CHARFROMPOS,0, makelparam(Rect.Left, Rect.Top)));

to get the line index by coordinates, call:
hi(ColorMemo1.perform(EM_CHARFROMPOS,0, makelparam(Rect.Left, Rect.Top)));

0
 

Author Comment

by:test031097
Comment Utility
What I need is the Position of the character from the text in the Memo.. (Eg, 0 - First character)


0
 
LVL 5

Expert Comment

by:ronit051397
Comment Utility
the character index is the position of the character. See API's help.
0
 

Author Comment

by:test031097
Comment Utility
ronit...
Your previous answer works! :-)

Could you please repost the answer so that I can give u the points?

Thanks


0
 
LVL 5

Accepted Solution

by:
ronit051397 earned 100 total points
Comment Utility
OK...
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now