?
Solved

TMemo Question

Posted on 1998-01-24
11
Medium Priority
?
356 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
11 Comments
 
LVL 5

Expert Comment

by:ronit051397
ID: 1357506
Rect.Left of what?
0
 

Author Comment

by:test031097
ID: 1357507
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
ID: 1357508
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:test031097
ID: 1357509
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
ID: 1357510
Is this control descent from TMemo?
0
 

Author Comment

by:test031097
ID: 1357511
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
ID: 1357512
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
ID: 1357513
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
ID: 1357514
the character index is the position of the character. See API's help.
0
 

Author Comment

by:test031097
ID: 1357515
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 400 total points
ID: 1357516
OK...
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

801 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