Solved

AutoIndents in RichEdit - Delphi 4.0

Posted on 2000-02-21
7
254 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
Comment Utility
Just a crazy top of my head idea but could you use tabs instead?

The Neil
0
 

Author Comment

by:Orca
Comment Utility
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
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 8

Accepted Solution

by:
ZifNab earned 100 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks Orca. Happy hunting to specific source code strips :-)

Zif.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Strange message in Delphi 10 Seattle 1 463
Working with hours 3 31
Convert a string into a TDateTime 5 44
Base1 Encode/Decode 3 21
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now