Solved

AutoIndents in RichEdit - Delphi 4.0

Posted on 2000-02-21
7
264 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
[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
  • 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
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!

 
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

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
drawing animated level bar based on numbers 3 113
Delphi: ForceDirectory plain function 7 50
Base1 Encode/Decode 3 90
Delphi and Access based Enumeration 9 78
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…

730 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