Board index » cppbuilder » Important! Inserting new text in RichEdit

Important! Inserting new text in RichEdit

I have Builder 3.0 Pro...
I am trying to make a simple text editor which MUST
support at least the most basic Text Editor functions...

I find that when a file is loaded into the RE (builder 3.0)
I can not always insert a New FIRST line !!
You would expect that a new blank line would appear,
and the current text in its entirety would be moved down!
If this has to be done programmatically, then I need to see
some suggestions how to go about it. PLEASE && thanks.

Another problem I find is if a new line of text is Inserted
into the RE control using the TStrings interface,
then editing THAT line again RESTRICTS the length
of THAT line to be whatever the PASTED/INSERTED
length of characters was!!  What the hell is this stupidity
about ?!?!?!?

HOW DO I FIX THIS, it is important!

Another problem:
I although selecting (highlighting) text,
copying and pasting to the clipboard is NOT;
UNLIKE the Tmemo control which DOES have
built-in native Copy/Paste/Selectall,undo, etc!

I have MS-Speech-SDK 4.0aAPI installed with this
Text Editor.  It is needed for a friend of mine with
minor disabilities.  We were hoping we could come up
with a SIMPLE, easy-to-learn program for him to do
text editing, AND HAVE the required special Speech
support.  The MSSpeech interface is functional;
BORLAND's TRichEdit control is NOT FUNCTIONAL
enough to be practical!  

If you have code snippets for Builder 3.0 Pro and
TRichEdit that makes SIMPLE and ESSENTIAL
Text-Editor functions available, then I really need to
hear from you.
Thank you so much!

email: radsm...@juno.com
http://members.tripod.com/~RadSurfer/

Join us on Yahoo at:
http://groups.yahoo.com/group/BorlandCPPBuilder
for informal discussions about all versions of C++Builder...

 

Re:Important! Inserting new text in RichEdit


Working with an EMPTY space seems to provide the "proper"
behavior expected...HOWEVER loading in a file and then
trying to work with RichEdit THAT WAY produces entirely
rediculous restrictions ...  WHAT IS IT that I missed in the
help files and books that restores the RichEdit to behave
as it does when NO FILES are pre-loaded?
If you "select" a length of text to be "edited" you can only
replace characters EQUAL TO the original length of the
line!  Sheesh... not what I'd expect.... the RichEdit control
does not allow "TRUE" editing at all it seems
(unless its an EMPTY work space to begin with, WHICH IS WHERE I GET
CONFUSED BY the totally radically different behavior AFTER a file
is loaded in)...sheesh!

NEXT PROBLEM:
I want to be able to INSERT TEXT from a file INTO what
text is already present in the RichEdit control....
do I have no choice but to do this by inserting line by line
new lines as I read in each individual line from the Text File
to be inserted... ?!?!?

QUES:
What is available for Builder 3.0 Pro, that would be vastly
more superior then the TRichEdit control....?  I need something
BCB 3.0 compatible!

Thanks!

On Fri, 02 Feb 2001 16:26:05 -0500, Radical NetSurfer

Quote
<radsm...@juno.com> wrote:
>I have Builder 3.0 Pro...
>I am trying to make a simple text editor which MUST
>support at least the most basic Text Editor functions...

>I find that when a file is loaded into the RE (builder 3.0)
>I can not always insert a New FIRST line !!
>You would expect that a new blank line would appear,
>and the current text in its entirety would be moved down!
>If this has to be done programmatically, then I need to see
>some suggestions how to go about it. PLEASE && thanks.

>Another problem I find is if a new line of text is Inserted
>into the RE control using the TStrings interface,
>then editing THAT line again RESTRICTS the length
>of THAT line to be whatever the PASTED/INSERTED
>length of characters was!!  What the hell is this stupidity
>about ?!?!?!?

>HOW DO I FIX THIS, it is important!

>Another problem:
>I although selecting (highlighting) text,
>copying and pasting to the clipboard is NOT;
>UNLIKE the Tmemo control which DOES have
>built-in native Copy/Paste/Selectall,undo, etc!

>I have MS-Speech-SDK 4.0aAPI installed with this
>Text Editor.  It is needed for a friend of mine with
>minor disabilities.  We were hoping we could come up
>with a SIMPLE, easy-to-learn program for him to do
>text editing, AND HAVE the required special Speech
>support.  The MSSpeech interface is functional;
>BORLAND's TRichEdit control is NOT FUNCTIONAL
>enough to be practical!  

>If you have code snippets for Builder 3.0 Pro and
>TRichEdit that makes SIMPLE and ESSENTIAL
>Text-Editor functions available, then I really need to
>hear from you.
>Thank you so much!

>email: radsm...@juno.com
>http://members.tripod.com/~RadSurfer/

>Join us on Yahoo at:
>http://groups.yahoo.com/group/BorlandCPPBuilder
>for informal discussions about all versions of C++Builder...

Re:Important! Inserting new text in RichEdit


I managed to get Text Block INSERT to work!
A block of text can be inserted whether it is Typed in manually,
or loaded in from a file...  and its rather SLOW for a "karge" insert,
but it does work!

...and now for my next trick...
Finding a superior replacement to RichEdit BCB3 Style...
On Fri, 02 Feb 2001 16:26:05 -0500, Radical NetSurfer

Quote
<radsm...@juno.com> wrote:
>I have Builder 3.0 Pro...
>I am trying to make a simple text editor which MUST
>support at least the most basic Text Editor functions...

>I find that when a file is loaded into the RE (builder 3.0)
>I can not always insert a New FIRST line !!
>You would expect that a new blank line would appear,
>and the current text in its entirety would be moved down!
>If this has to be done programmatically, then I need to see
>some suggestions how to go about it. PLEASE && thanks.

>Another problem I find is if a new line of text is Inserted
>into the RE control using the TStrings interface,
>then editing THAT line again RESTRICTS the length
>of THAT line to be whatever the PASTED/INSERTED
>length of characters was!!  What the hell is this stupidity
>about ?!?!?!?

>HOW DO I FIX THIS, it is important!

>Another problem:
>I although selecting (highlighting) text,
>copying and pasting to the clipboard is NOT;
>UNLIKE the Tmemo control which DOES have
>built-in native Copy/Paste/Selectall,undo, etc!

>I have MS-Speech-SDK 4.0aAPI installed with this
>Text Editor.  It is needed for a friend of mine with
>minor disabilities.  We were hoping we could come up
>with a SIMPLE, easy-to-learn program for him to do
>text editing, AND HAVE the required special Speech
>support.  The MSSpeech interface is functional;
>BORLAND's TRichEdit control is NOT FUNCTIONAL
>enough to be practical!  

>If you have code snippets for Builder 3.0 Pro and
>TRichEdit that makes SIMPLE and ESSENTIAL
>Text-Editor functions available, then I really need to
>hear from you.
>Thank you so much!

>email: radsm...@juno.com
>http://members.tripod.com/~RadSurfer/

>Join us on Yahoo at:
>http://groups.yahoo.com/group/BorlandCPPBuilder
>for informal discussions about all versions of C++Builder...

Re:Important! Inserting new text in RichEdit


Quote
Radical NetSurfer wrote:
> NEXT PROBLEM:
> I want to be able to INSERT TEXT from a file INTO what
> text is already present in the RichEdit control....
> do I have no choice but to do this by inserting line by line
> new lines as I read in each individual line from the Text File
> to be inserted... ?!?!?

Load the text file into a separate TRichEdit component, then
copy it to the clipboard and paste it back into your original
TRichEdit.

RichEdit1->SelectAll();
RichEdit1->CopyToClipboard();
RichEdit1->PasteFromClipboard();

************************************
*      Blueprint Software          *
************************************
Thomas Oeser
Blueprint Software
http://www.blueprintsoftware.com.au

Re:Important! Inserting new text in RichEdit


Hello Radical,

"Radical NetSurfer" <radsm...@juno.com> schreef in bericht
news:cghm7tk48uitafjo0gbg5683iul22c7vso@4ax.com...

Quote
> NEXT PROBLEM:
> I want to be able to INSERT TEXT from a file INTO what
> text is already present in the RichEdit control....

Hmm, did you look at the SelText property. You can assign any text,
including CRLF to this and it gets inserted at the SelStart position.
If the text comes from a file you have to load it in first in a TStringList
for instance, or in another temporary TRichEdit if you need rtf
formatting...

Quote
> Thanks!

Hope this helps...;-))

--
Greetings from rainy Amsterdam

         Jan

email: bijs...@worldonline.nl
http://home.worldonline.nl/~bijster

Other Threads