Solved

AutoIndents in RichEdit - Delphi 4.0

Posted on 2000-02-21
7
259 Views
Last Modified: 2013-11-22
I'm creating an editor using a TRichEdit component in Delphi 4.0.  I want to emulate the AutoIndent feature from the Delphi code editor.  I've had no luck so far.  I've been able to read the number of blanks from the last line typed but haven't been able to do anything with that information.  Also, how to get the backspace key to go back incrementally through the indents?

Basically I don't think my approach is working so I'm looking for a ground up solution to this if possible.  Any help would be greatly appreciated.

Thanks in advance.
0
Comment
Question by:Orca
  • 3
  • 2
  • 2
7 Comments
 
LVL 5

Expert Comment

by:TheNeil
ID: 2543156
Just a crazy top of my head idea but could you use tabs instead?

The Neil
0
 

Author Comment

by:Orca
ID: 2543185
That's one of the things I tried.  I pulled the number of blank spaces from the line previously typed and then tried to set the value of Tab[0] to the number of spaces multiplied by the width of either a space (which was something like 3 pixels) or a letter (such as 'w' which is like 8 pixels).  Since the tab stops have to be in pixels and not characters, that got me a value.  When I set that tab stop to that value, I could tab over, but it never lined up quite right with the line above it.  Granted, I could have been doing something wrong but it just didn't seem like the best way to go.  Which brings me to my original post.

Thanks though...
0
 
LVL 5

Expert Comment

by:TheNeil
ID: 2543204
Why not skip back up to the line above, delete the spaces, and insert your new tab then? It'll all line up correctly

The Neil
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 8

Accepted Solution

by:
ZifNab earned 100 total points
ID: 2543302
Orca,

have a look at the FWS mwEdit components.... It got all what you need and is a new editor from ground-up... It is also comming with full-source.

http://www.eccentrica.org/gabr/mw/mwedit.htm

Let us know if this is what you want or if you still prefer to write it yourself

Regards, Zif.
0
 

Author Comment

by:Orca
ID: 2543579
TheNeil: I'm not sure I follow what you're saying there...

ZifNab: I'll check out the components and let you know.  Thanks.
0
 

Author Comment

by:Orca
ID: 2546435
Zif,

Thanks for the link to those components.  They'll do everything I need and then some.  I should be able to tease out how they're doing it from their source.

I accepted your answer so you'll get the points.

Thanks.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 2546454
Thanks Orca. Happy hunting to specific source code strips :-)

Zif.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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…

777 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