?
Solved

AutoIndents in RichEdit - Delphi 4.0

Posted on 2000-02-21
7
Medium Priority
?
269 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
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!

 
LVL 8

Accepted Solution

by:
ZifNab earned 400 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

765 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