Solved

TMemo Question

Posted on 1998-01-24
11
332 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
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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 100 total points
ID: 1357516
OK...
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PDF library for Delphi 2 121
Newbie Thread Programming 1 151
Find and Replace Stream with 0s 8 62
Wincontrol not (correctly) drawn 15 38
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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

770 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