BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Richedit controls

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Development)
View previous topic :: View next topic  
Author Message
James Peterson
Guest





PostPosted: Fri May 21, 2004 7:34 pm    Post subject: Richedit controls Reply with quote



where or what are the richedit controls to change text attibutes to specific
letters being typed or selected and not the entire RichEdit pannel
for example This is bold : where the is is bolded but the This and bold
is not.


Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Fri May 21, 2004 9:11 pm    Post subject: Re: Richedit controls Reply with quote




"James Peterson" <jpeterson (AT) romanmealmilling (DOT) com> wrote


Quote:
where or what are the richedit controls to change text attibutes
to specific letters being typed or selected and not the entire
RichEdit pannel for example This is bold : where the is is bolded
but the This and bold is not.

Use the SelStart and SelLength properties to highlight the desired text and
then change the SelAttributes subproperties to apply your desired characters
to the selected text.


Gambit



Back to top
James Peterson
Guest





PostPosted: Tue May 25, 2004 12:56 pm    Post subject: Re: Richedit controls Reply with quote



Remy how do you get yoru current Cursor postion?

"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote

Quote:

"James Peterson" <jpeterson (AT) romanmealmilling (DOT) com> wrote in message
news:40ae5994 (AT) newsgroups (DOT) borland.com...

where or what are the richedit controls to change text attibutes
to specific letters being typed or selected and not the entire
RichEdit pannel for example This is bold : where the is is bolded
but the This and bold is not.

Use the SelStart and SelLength properties to highlight the desired text
and
then change the SelAttributes subproperties to apply your desired
characters
to the selected text.


Gambit





Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Tue May 25, 2004 5:47 pm    Post subject: Re: Richedit controls Reply with quote


"James Peterson" <jpeterson (AT) romanmealmilling (DOT) com> wrote


Quote:
Remy how do you get yoru current Cursor postion?

The SelStart property. If that is not what you are referring to, then
please elaborate.


Gambit



Back to top
James Peterson
Guest





PostPosted: Tue May 25, 2004 7:14 pm    Post subject: Re: Richedit controls Reply with quote

well I have a richedit1. and I have some speedbuttons. I want to be able to
click on the speedbutton and and have the proptier set like bold, italic,
underline, or font style and size. So the very next charactor typed has the
new propertes which are set by the speedbuttons. And what is happening now
is that it when I click the speedbutton to set the property it changes the
entire richedit and not the current charactor.

"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote

Quote:

"James Peterson" <jpeterson (AT) romanmealmilling (DOT) com> wrote in message
news:40b34259$2 (AT) newsgroups (DOT) borland.com...

Remy how do you get yoru current Cursor postion?

The SelStart property. If that is not what you are referring to, then
please elaborate.


Gambit





Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Tue May 25, 2004 8:44 pm    Post subject: Re: Richedit controls Reply with quote


"James Peterson" <jpeterson (AT) romanmealmilling (DOT) com> wrote


Quote:
well I have a richedit1. and I have some speedbuttons. I want
to be able to click on the speedbutton and and have the proptier
set like bold, italic, underline, or font style and size. So the very
next charactor typed has the new propertes which are set by the
speedbuttons.

The SelStart property reflects where the edit caret is at all times. Simply
use the SelAttributes property to change the characteristics at the current
location specified by the SelStart.

Quote:
And what is happening now is that it when I click the
speedbutton to set the property it changes the entire richedit
and not the current charactor.

You are probably not using the SelAttributes property at all.


Gambit



Back to top
James Peterson
Guest





PostPosted: Wed May 26, 2004 12:03 pm    Post subject: Re: Richedit controls Reply with quote

I think I am missing selstart: here is my code of SelAtttributes
with this how do I use SelStart...?
if (SpeedButton6->Flat == true)
RichEdit4->SelAttributes->Style = RichEdit4->Font->Style <<
fsUnderline;
if (SpeedButton6->Flat == false)
RichEdit4->SelAttributes->Style = RichEdit4->Font->Style >>
fsUnderline;
if (SpeedButton5->Flat == true)
RichEdit4->Font->Style = RichEdit4->Font->Style << fsItalic;
if (SpeedButton5->Flat == false)
RichEdit4->Font->Style = RichEdit4->Font->Style >> fsItalic;
if (SpeedButton4->Flat == true)
RichEdit4->Font->Style = RichEdit4->Font->Style << fsBold;
if (SpeedButton4->Flat == false)
RichEdit4->Font->Style = RichEdit4->Font->Style >> fsBold;

"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote

Quote:

"James Peterson" <jpeterson (AT) romanmealmilling (DOT) com> wrote in message
news:40b39ac5$1 (AT) newsgroups (DOT) borland.com...

well I have a richedit1. and I have some speedbuttons. I want
to be able to click on the speedbutton and and have the proptier
set like bold, italic, underline, or font style and size. So the very
next charactor typed has the new propertes which are set by the
speedbuttons.

The SelStart property reflects where the edit caret is at all times.
Simply
use the SelAttributes property to change the characteristics at the
current
location specified by the SelStart.

And what is happening now is that it when I click the
speedbutton to set the property it changes the entire richedit
and not the current charactor.

You are probably not using the SelAttributes property at all.


Gambit





Back to top
James Peterson
Guest





PostPosted: Wed May 26, 2004 6:08 pm    Post subject: Re: Richedit controls Reply with quote

oh remmy I got it thanx for your directions again...
"James Peterson" <jpeterson (AT) romanmealmilling (DOT) com> wrote

Quote:
I think I am missing selstart: here is my code of SelAtttributes
with this how do I use SelStart...?
if (SpeedButton6->Flat == true)
RichEdit4->SelAttributes->Style = RichEdit4->Font->Style
fsUnderline;
if (SpeedButton6->Flat == false)
RichEdit4->SelAttributes->Style = RichEdit4->Font->Style
fsUnderline;
if (SpeedButton5->Flat == true)
RichEdit4->Font->Style = RichEdit4->Font->Style << fsItalic;
if (SpeedButton5->Flat == false)
RichEdit4->Font->Style = RichEdit4->Font->Style >> fsItalic;
if (SpeedButton4->Flat == true)
RichEdit4->Font->Style = RichEdit4->Font->Style << fsBold;
if (SpeedButton4->Flat == false)
RichEdit4->Font->Style = RichEdit4->Font->Style >> fsBold;

"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote in
message
news:40b3b14a$1 (AT) newsgroups (DOT) borland.com...

"James Peterson" <jpeterson (AT) romanmealmilling (DOT) com> wrote in message
news:40b39ac5$1 (AT) newsgroups (DOT) borland.com...

well I have a richedit1. and I have some speedbuttons. I want
to be able to click on the speedbutton and and have the proptier
set like bold, italic, underline, or font style and size. So the very
next charactor typed has the new propertes which are set by the
speedbuttons.

The SelStart property reflects where the edit caret is at all times.
Simply
use the SelAttributes property to change the characteristics at the
current
location specified by the SelStart.

And what is happening now is that it when I click the
speedbutton to set the property it changes the entire richedit
and not the current charactor.

You are probably not using the SelAttributes property at all.


Gambit







Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Wed May 26, 2004 6:24 pm    Post subject: Re: Richedit controls Reply with quote


"James Peterson" <jpeterson (AT) romanmealmilling (DOT) com> wrote


Quote:
I think I am missing selstart: here is my code
of SelAtttributes

What EXACTLY are you trying to accomplish in the first place?

Quote:
with this how do I use SelStart...?

Simply set the SelStart to the 0-based character index within the text where
you want to set your characteristics, if it is not already there to begin
with.

Quote:
if (SpeedButton6->Flat == true)
RichEdit4->SelAttributes->Style = RichEdit4->Font->Style
fsUnderline;
if (SpeedButton6->Flat == false)
RichEdit4->SelAttributes->Style = RichEdit4->Font->Style
fsUnderline;

You can shorten that code:

if( SpeedButton6->Flat )
RichEdit4->SelAttributes->Style = RichEdit4->Font->Style <<
fsUnderline;
else
RichEdit4->SelAttributes->Style = RichEdit4->Font->Style >>
fsUnderline;

However, you are not taking the current SelAttributes values into account at
all, you are overwriting them each time. You probably meant to do the
following instead:

if( SpeedButton6->Flat )
RichEdit4->SelAttributes->Style = RichEdit4->SelAttributes->Style <<
fsUnderline;
else
RichEdit4->SelAttributes->Style = RichEdit4->SelAttributes->Style >>
fsUnderline;

The same applies to the other values that you are trying to set as well.


Gambit



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Development) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.