| View previous topic :: View next topic |
| Author |
Message |
James Peterson Guest
|
Posted: Fri May 21, 2004 7:34 pm Post subject: Richedit controls |
|
|
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
|
Posted: Fri May 21, 2004 9:11 pm Post subject: Re: Richedit controls |
|
|
"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
|
Posted: Tue May 25, 2004 12:56 pm Post subject: Re: Richedit controls |
|
|
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
|
Posted: Tue May 25, 2004 5:47 pm Post subject: Re: Richedit controls |
|
|
"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
|
Posted: Tue May 25, 2004 7:14 pm Post subject: Re: Richedit controls |
|
|
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
|
Posted: Tue May 25, 2004 8:44 pm Post subject: Re: Richedit controls |
|
|
"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
|
Posted: Wed May 26, 2004 12:03 pm Post subject: Re: Richedit controls |
|
|
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
|
Posted: Wed May 26, 2004 6:08 pm Post subject: Re: Richedit controls |
|
|
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
|
Posted: Wed May 26, 2004 6:24 pm Post subject: Re: Richedit controls |
|
|
"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 |
|
 |
|