Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RichEdit98 tab alignment for decimals

119 views
Skip to first unread message

Kerin

unread,
Jul 22, 2002, 2:13:05 PM7/22/02
to
Hi,

Using RichEdit98 I need to be able to vertically align currency fields, so
that the decimal points are all in a line.
I notice that there seems to be a provision for this (tbaDecimal), but I
can't seem to get it to work.

I am setting tabs as follows:-
RichEdit.Paragraph.SetTab(k,tp, tbaDecimal, tblNone)
for the columns containing the decimal numbers, but they don't align.

Should they?

Any help would be appreciated.

Running WinNT SP5, Delphi 5 Pro.

Thanks
Kerin O'Brien

Iain Macmillan

unread,
Jul 22, 2002, 8:27:17 AM7/22/02
to

In article <3d3bda56$1_1@dnews>, "Kerin" <ker...@bigfoot.com> wrote:


> Hi,
>
> Using RichEdit98 I need to be able to vertically align currency fields, so
> that the decimal points are all in a line.
> I notice that there seems to be a provision for this (tbaDecimal), but I
> can't seem to get it to work.
>
> I am setting tabs as follows:-
> RichEdit.Paragraph.SetTab(k,tp, tbaDecimal, tblNone)
> for the columns containing the decimal numbers, but they don't align.
>
> Should they?


Check that you actually have a Class 3 Richedit being created, not a Class 1
or 2 which does not support decimal tabs. Which you get will depend on the
RichEd20.DLL version.

Check that you are actually getting the tabs into the text. (Save it and
look at it as PlainText). The tabs in the raw RTF should read
\tqdec\tx{nnn}, the tqdec bit means decimal tabs.

With both of these in place - Yes they should align!

-Iain.

Aurélien Dellieux

unread,
Jul 22, 2002, 9:53:59 AM7/22/02
to
Hi Iain,

sorry for not responding to your last mail, but I have a lot of work these
days (we work two times more than in normal days... great summer holidays
:-(

IMHO, it seems that you forgot this :

Activate the advanced typography options with :
Perform(EM_SETTYPOGRAPHYOPTIONS, TO_ADVANCEDTYPOGRAPHY,
TO_ADVANCEDTYPOGRAPHY or TO_SIMPLELINEBREAK);

with the following constants :

const
EM_SETTYPOGRAPHYOPTIONS = WM_USER + 202;
TO_ADVANCEDTYPOGRAPHY = 1;
TO_SIMPLELINEBREAK = 2;

in a new class derivated from TCustomRichEdit98, for example...

Aurélien


Iain Macmillan

unread,
Jul 22, 2002, 11:18:59 AM7/22/02
to

In article <3d3c0e78_2@dnews>, "Aurélien Dellieux"
<a.del...@nospam.corwin.fr> wrote:


> Hi Iain,
Salut, mon ami!
- I trust you saw that this is not my problem, but Kerin's, (whose clock is
badly wrong!)


> sorry for not responding to your last mail,

No problem, the programming is going well now.
Just the conversion of all the files to RTF that worries me it will not be
finished. I have spent a lot of time basically just advising my colleague
how to use a word processor properly, where to use tabs, where to use
indent..


> but I have a lot of work these
> days (we work two times more than in normal days... great summer holidays

I have 'summer' holidays in October... and another in April if I can.
Why go for sun when we have (a little) sun here...


>
> IMHO, it seems that you forgot this :
>
> Activate the advanced typography options with :
> Perform(EM_SETTYPOGRAPHYOPTIONS, TO_ADVANCEDTYPOGRAPHY,
> TO_ADVANCEDTYPOGRAPHY or TO_SIMPLELINEBREAK);
>
> with the following constants :
>
> const
> EM_SETTYPOGRAPHYOPTIONS = WM_USER + 202;
> TO_ADVANCEDTYPOGRAPHY = 1;
> TO_SIMPLELINEBREAK = 2;

Kerin:
------
Aurelien is Right!
You need this statement, in addition to what I said, to make the decimal
tabs work.
And I found that in the FormCreate can be too early to do it, possibly a
timing issue, try to find somewhere else that ensures that it will
definitely get done.

Kerin

unread,
Jul 22, 2002, 10:57:55 PM7/22/02
to
Hi Iain,

Firstly apologies for emailing you directly - I pressed the wrong button -
oops.

Thank you for your advice (BTW - My clock is correct - running on BST)
I am however, still having problems which may be because I am
misunderstanding something.
Here is the program snip I am using to test this:-


procedure SetStartOfLine(re: TRichEdit98; LNum: integer);
begin
re.SelLength := 0;
re.SelStart := re.Perform(EM_LINEINDEX, LNum, 0);
end;

procedure SelectLine(re: TRichEdit98; LNum: integer);
begin
SetStartOfLine(re, LNum);
re.SelLength := length(re.Lines[LNum])+2;
end;

procedure TForm1.FormShow(Sender: TObject);
var i: integer;
begin


Perform(EM_SETTYPOGRAPHYOPTIONS, TO_ADVANCEDTYPOGRAPHY,
TO_ADVANCEDTYPOGRAPHY or TO_SIMPLELINEBREAK);

RichEdit1.Clear;
RichEdit1.Lines.Add(#9+'1.2'+#9+'2.3'+#9+'3.4'+#9+'4.5');
RichEdit1.Lines.Add(#9+'11.2'+#9+'12.3'+#9+'13.4'+#9+'14.5');
RichEdit1.Lines.Add(#9+'11.25'+#9+'12.36'+#9+'13.47'+#9+'14.58');
RichEdit1.Lines.Add(#9+'211.256'+#9+'2.368'+#9+'1253.7'+#9+'32514.8');

for i := 0 to 3 do
begin
SelectLine(RichEdit1, i);
RichEdit1.Paragraph.SetTab(0, 30, tbaDecimal, tblNone); //
Set tab stops
RichEdit1.Paragraph.SetTab(1, 80, tbaDecimal, tblNone);
RichEdit1.Paragraph.SetTab(2,150, tbaDecimal, tblNone);
RichEdit1.Paragraph.SetTab(3,220, tbaDecimal, tblNone);
end;

RichEdit1.Lines.SaveToFile('rtfOut.rtf');
end;

This almost works - and gives the following output:-
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0
Courier New;}}
\viewkind4\uc1\pard\tx0\tx0\tx0\f0\fs20\tab 1.2\tab 2.3\tab 3.4\tab 4.5\par
\pard\tqdec\tx600\tqdec\tx1600\tqdec\tx3000\tab 11.2\tab 12.3\tab 13.4\tab
14.5\par
\tab 11.25\tab 12.36\tab 13.47\tab 14.58\par
\tab 211.256\tab 2.368\tab 1253.7\tab 32514.8\par
\par
}

which looks like not all the tabs are being defined correctly.
Any ideas please?

Many thanks
Kerin O'Brien

"Iain Macmillan" <he...@ariesps.co.uk> wrote in message
news:3d3c23f9_1@dnews...

Aurélien Dellieux

unread,
Jul 22, 2002, 3:48:05 PM7/22/02
to
Hi Kerin,

> Perform(EM_SETTYPOGRAPHYOPTIONS, TO_ADVANCEDTYPOGRAPHY,
> TO_ADVANCEDTYPOGRAPHY or TO_SIMPLELINEBREAK);

That should be :
RichEdit1.Perform...

Like Iain said before, ensure you have the latest ms riched.dll.
If you have any error when you make the "perform" call, then you have an
older version.
Here is a link to a little text editor which provides the dll update :
http://www.student.tue.nl/u/t.a.v.roermund/notepadex/

http://www.student.tue.nl/u/t.a.v.roermund/notepadex/download/riched30.exe

The "Perform" call needs to be called again if you programmaticaly make
changes to the tichedit component, using wordwrap, scrollbars booleans or
any function that need to recreate the window (there are approx. 4 or 5 of
them in riched98 or rxrichedit).
That's why it's better to embed that code in a new component, which is
derived from tcustomrichedit, or another already enhanced one (like the two
above).

hope this will help you...


Iain Macmillan

unread,
Jul 22, 2002, 4:06:07 PM7/22/02
to

In article <3d3c5557_1@dnews>, "Kerin" <ker...@bigfoot.com> wrote:

> Firstly apologies for emailing you directly - I pressed the wrong button -

No prob. It happens <g>.


>
> Thank you for your advice (BTW - My clock is correct - running on BST)

- well the newsreader shows your last post as having been posted at 3.57 a.m
tomorrow! Something definitely wrong here unless you own a time machine.
Mine broke down next week; they don't make them like they will do soon. <g>

> This almost works - and gives the following output:-

<snip>


> \pard\tqdec\tx600\tqdec\tx1600\tqdec\tx3000\tab

> which looks like not all the tabs are being defined correctly.
Looks to me as if they are all OK except for the last one is not defined.
Just the last column doesn't align, yes?

- Don't worry about there being only one definition of the tabstops when you
put in 4 - the component is smart enough to realise that it only needs to
write a new \pard when the next paragraph is in a *different* format, one
reason why just loading and saving a file written by a word processor
shrinks it quite a lot!

> Any ideas please?
Yes.. it rings a bell, vaguely. There's some kind of bug about tabs being
'off by one'.

.. anyway it looks like you need to insert one extra tab - any value greater
than 220 should do!
RichEdit1.Paragraph.SetTab(4,221, tbaDecimal, tblNone);

(or more generically, one more than you think you need,with a value anything
greater than the last one you think you need)
RichEdit1.Paragraph.SetTab(
RichEdit1.Paragraph.Tabcount,
RichEdit1.Paragraph.Tab[RichEdit1.Paragraph.Tabcount-1] + 1
,tbaDecimal, tblNone);

any good?

btw you don't *need* to select the whole line to set paragraph properties,
just set selstart to anywhere within the paragraph - although I see how it
might be useful in debugging to have it selected while you are
single-stepping.


-Iain.

Iain Macmillan

unread,
Jul 22, 2002, 4:59:16 PM7/22/02
to

In article <3d3c6143_1@dnews>, "Aurélien Dellieux" <a.del...@corwin.fr>
wrote:

>> Perform(EM_SETTYPOGRAPHYOPTIONS, TO_ADVANCEDTYPOGRAPHY,
>> TO_ADVANCEDTYPOGRAPHY or TO_SIMPLELINEBREAK);
> That should be :
> RichEdit1.Perform...

Once again you are right, I didn't notice this mistake, which sends a
message to the form, not the richedit!

> Like Iain said before, ensure you have the latest ms riched.dll.

This looks likely now, as we see from Kerin's latest that at least *some*
tqdec values are being written.


> If you have any error when you make the "perform" call, then you have an
> older version.

Note that (as I told you before) perform does not raise exception, if the
receiver does not understand the message, (as Form1 would not!) it will just
ignore it.

> The "Perform" call needs to be called again if you programmaticaly make
> changes to the tichedit component, using wordwrap, scrollbars booleans or

booleans ???


> any function that need to recreate the window (there are approx. 4 or 5 of
> them in riched98 or rxrichedit).

Odd thing actually.. when I put one of my REs into the Delphi Demo program
in place of the standard RE there I found that if I settypog.. before the
call to getfontnames, it didn't work, but did if I put it after. Since
getfontnames does not access the RE at all, that's why I thought it might be
a matter of timing.
- and also wondered whether Kerin putting it in FormShow would work (without
realising it wasn't actually being called there <g>).

> That's why it's better to embed that code in a new component

probably; but I guess Kerin may not be ready to try this yet.. To prove that
the stuff actually works, as he has now got a few dec tabs on file;
RichEdit1.Lines.LoadFromFile('rtfOut.rtf');
RichEdit1.Perform(EM_SETTYPOGRAPHYOPTIONS,
TO_ADVANCEDTYPOGRAPHY,TO_ADVANCEDTYPOGRAPHY or TO_SIMPLELINEBREAK);
looks like it has a chance!

I'm sticking some calls like that into my app - a bit defensively - so that
even if the Wnd has been recreated and the setting somehow lost I'll still
get my tabs!

-Iain.

Iain Macmillan

unread,
Jul 22, 2002, 5:39:46 PM7/22/02
to

I said:
> Odd thing actually.. when I put one of my REs into the Delphi Demo program
> in place of the standard RE there I found that if I settypog.. before the
> call to getfontnames, it didn't work, but did if I put it after. Since
> getfontnames does not access the RE at all

I've just been back to take another look at that: I put the call down to the
end of the proc
*after* SelectionChange(Self);
Now that *does* access the RE, and since it is the first time that anything
is done that needs a handle, a window handle will get created now.
Before this the Window handle was 0, so the perform got lost.
Another piece of the puzzle fits into place. %-).

-So Kerin, to be sure, before Richedit1.Perform(EM_SETTYPOG....
call
RichEdit1.HandleNeeded;

Aurélien Dellieux

unread,
Jul 23, 2002, 3:54:46 AM7/23/02
to
Hi Iain,

> > If you have any error when you make the "perform" call, then you have an
> > older version.
> Note that (as I told you before) perform does not raise exception, if the
> receiver does not understand the message, (as Form1 would not!) it will
just
> ignore it.

I have made some tests on a w98 machine and a message appears telling me
that em_settypography function does not exist, before I apply the riched 3.0
update...

> > That's why it's better to embed that code in a new component

> probably; but I guess Kerin may not be ready to try this yet...
Yes, you are right, making the perform call inside the form is not a
problem...
I already tried this to make tests, that works...
it seems that MS didn't include the settypography option in the
createparams, or other setup parameters of the richedit class.
I really wonder how to do that automatically without calling
settypography_options manually each time the richedit window is recreated...
In the riched98 sourcecode, I have located the settypography in the
createwnd, just at the end of the procedure, and that's where I make the
<bad> try...except test ;-)
Do you know if there is a better way of doing the settypography call, Iain ?

Riched 3.0 dlls are already present on W2k, Wxp, and maybe Wme...
Which os do you have, Kerin ?


Aurélien Dellieux

unread,
Jul 23, 2002, 3:45:32 AM7/23/02
to
Hi Iain, Hi Kerin,

there is a bug in the richedit sourcecode itself, in :
procedure TParaAttributes.SetTab(Index: Byte; Value: Longint);

// original code
// if cTabCount < Index then cTabCount := Index;

// modified code
if cTabCount <= Index then cTabCount := Index + 1;

Iain : I already corrected this in riched98, but I didn't remember that,
sorry ;-)

hope this will help you, both...

Aurélien


Kerin

unread,
Jul 23, 2002, 11:49:54 AM7/23/02
to
Hi Iain and Aurélien,

Many thanks for all your advice. Almost there :-)
I have just one problem remaining now - I can't get the first line to tab
properly.
My new code is:-

begin
RichEdit1.HandleNeeded;
RichEdit1.Perform(EM_SETTYPOGRAPHYOPTIONS, TO_ADVANCEDTYPOGRAPHY,
TO_ADVANCEDTYPOGRAPHY or TO_SIMPLELINEBREAK);

RichEdit1.Clear;
RichEdit1.Lines.Add(#9+'1.2'+#9+'2.3'+#9+'3.4'+#9+'4.5');
RichEdit1.Lines.Add(#9+'11.2'+#9+'12.3'+#9+'13.4'+#9+'14.5');
RichEdit1.Lines.Add(#9+'11.25'+#9+'12.36'+#9+'13.47'+#9+'14.58');

RichEdit1.Lines.Add(#9+'211.256'+#9+'2.368'+#9+'1253.7'+#9+'32514.8'); //
dummy

for i := 0 to 3 do
begin
SelectLine(RichEdit1, i);
RichEdit1.Paragraph.SetTab(0, 30, tbaDecimal, tblNone); //
Set tab stops

RichEdit1.Paragraph.SetTab(1, 90, tbaDecimal, tblNone);


RichEdit1.Paragraph.SetTab(2,150, tbaDecimal, tblNone);
RichEdit1.Paragraph.SetTab(3,220, tbaDecimal, tblNone);

RichEdit1.Paragraph.SetTab(4,360, tbaDecimal, tblNone);
end;

RichEdit1.Lines.SaveToFile('rtfOut.rtf');
end.

Other code as before.
The output from this is:-

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0
Courier New;}}

\viewkind4\uc1\pard\tx0\tx0\tx0\tx0\f0\fs20\tab 1.2\tab 2.3\tab 3.4\tab
4.5\par
\pard\tqdec\tx600\tqdec\tx1800\tqdec\tx3000\tqdec\tx4400\tab 11.2\tab


12.3\tab 13.4\tab 14.5\par
\tab 11.25\tab 12.36\tab 13.47\tab 14.58\par
\tab 211.256\tab 2.368\tab 1253.7\tab 32514.8\par
\par
}

All tabs now align except the first line. Any suggestions please?

Many Thanks
Kerin O'Brien


"Iain Macmillan" <he...@ariesps.co.uk> wrote in message

news:3d3c642d_2@dnews...

Aurélien Dellieux

unread,
Jul 23, 2002, 4:06:53 AM7/23/02
to
> Which os do you have, Kerin ?
sorry Kerin, re-read your original post, seen the winnt sp5 ;-)


Aurélien Dellieux

unread,
Jul 23, 2002, 4:26:11 AM7/23/02
to
Kerin,

your source code works perfectly with my version of richedit98, no decimal
tab bugs...


Aurélien Dellieux

unread,
Jul 23, 2002, 4:08:23 AM7/23/02
to
Hi Kerin,

have you tried making a simple test rtf file using word ?
it worked for me (just for tests purpose, though)...
(do not try wordpad, it is a 1.0/2.0 richedit..., it does not handle new
typography options, and when loading then saving such an "enhanced" rtf
file, changes are lost...)

> RichEdit1.Paragraph.SetTab(0, 30, tbaDecimal, tblNone);
what is this settab function ?
the original one does not have those parameters...
and it's in the private section of the richedit sourcecode, so you can't
call it outside the component...
do miss something Iain ?


Aurélien Dellieux

unread,
Jul 23, 2002, 4:21:34 AM7/23/02
to
Hi Kerin,

I saw in a previous post that you are using TRichEdit98...
The Tab bug is also in it, just put the following correction in the
following procedure :

procedure TParaAttributes98.SetTab(Index: Integer; Value: Double;
Alignment: TTabAlignment; Leader:
TTabLeader);

and apply the following change :

// if cTabCount < Index then cTabCount := Index;

if cTabCount <= Index then cTabCount := Index + 1;

you can do this in the riechedit2.pas file.

that may be the reason of the problem you encounter...

I have added a missing settabcount procedure to the richedit2.pas sourcecode
too, if you need it, simply tell me...


Kerin

unread,
Jul 23, 2002, 8:24:47 PM7/23/02
to
Hi Aurélien & Iain,

I needed to apply the mod. to RichEdit2 re the tabs on the first line, and
now my test program woks perfectly (as yours).

Many thanks to you both for helping me out with this problem; much
appreciated.

I seem now to be having a bit of trouble with the line breaks not being
processed correctly. It seems that RichEdit981.Lines[i] statements now don't
always give the correct results in that they overrun into the next line, and
contain embedded #13 characters.
This problem is since I enabled the advanced text formatting.

I am gathering some more information, and will start a new thread if I can't
work out what the problem is.

Thanks again
Kerin O'Brien

"Aurélien Dellieux" <a.del...@nospam.corwin.fr> wrote in message
news:3d3d1323$1_2@dnews...

Kerin

unread,
Jul 23, 2002, 10:12:00 PM7/23/02
to
Hi Aurélien,

I don't know what the problem is with the jumbled lines - but I have
simplified my code and programmed round the problem - so it's not a problem
any more.

Thanks
Kerin

"Aurélien Dellieux" <a.del...@nospam.corwin.fr> wrote in message
news:3d3d1323$1_2@dnews...

Iain Macmillan

unread,
Jul 23, 2002, 12:27:28 PM7/23/02
to

In article <3d3d0a44_1@dnews>, "Kerin" <ker...@bigfoot.com> wrote:


> Hi Iain and Aurélien,
> Many thanks for all your advice.

I've found it interesting and instructive to look at it from a slightly
different angle. And you can see there's been some useful spin-off.

> {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0
> Courier New;}}
> \viewkind4\uc1\pard\tx0\tx0\tx0\tx0\f0\fs20\tab 1.2\tab 2.3\tab 3.4\tab
> 4.5\par

Weird. Four Left tabs all at position zero!


> \pard\tqdec\tx600\tqdec\tx1800\tqdec\tx3000\tqdec\tx4400\tab 11.2\tab

Good, that's what it should be!

> All tabs now align except the first line.

Especially as Aurelien says your code works perfectly this looks like its
down to something silly now. Code looks good to me, too.
Like RU sure the code posted is an exact copy of the code that created the
output!
Sure the first line got done?
Sure the SelStart is Zero when doing the first line? (it should be I
reckon).


> Any suggestions please?
If you really can't find anything silly, there's a few things you could try.
Like seeing what happens if you loop i from 3 downto 0 and seeing if it is
now the bottom line that is wrong!

Or for a quick fix, add a blank line at the top and take it out afterwards!
But you're so close now I'm sure you don't need to resort to this kind of
hack.

-Iain.

Iain Macmillan

unread,
Jul 23, 2002, 12:27:39 PM7/23/02
to

In article <3d3d099b_1@dnews>, "Aurélien Dellieux"
<a.del...@nospam.corwin.fr> wrote:

> there is a bug in the richedit sourcecode itself, in :
> procedure TParaAttributes.SetTab(Index: Byte; Value: Longint);
> // original code
> // if cTabCount < Index then cTabCount := Index;
> // modified code
> if cTabCount <= Index then cTabCount := Index + 1;
>
> Iain : I already corrected this in riched98, but I didn't remember that,

I did spot your correction - but this < instead of <= is also in the
corresponding VCL code, .. and in other similar components.
One wonders why. How much have you tested your fix.. if there are
MAX_TABSTOP tabs can you get range errors?
So I suggested a different fix from outside - and according to Kerin it
works too %-).


----------
In article <3d3d0bc5_1@dnews>, "Aurélien Dellieux"
<a.del...@nospam.corwin.fr> wrote:


> I have made some tests on a w98 machine and a message appears telling me
> that em_settypography function does not exist, before I apply the riched 3.0
> update...

I have just tried using the W95 DLLs. The version test I showed you worked
but I was then able to proceed. There was no message at em_set.. call.
I wouldn't want one either; I told the user at startup that the DLLs needed
upgrading, and if they chose to continue my philosophy is to let them do so,
not to continually pester them with messages that they already know about.
You can get stuck in loops that give the same message forever, I hate apps
that do that.
Anyway this means I will have to protect my em_set calls from this.
<sigh> C'est dur, la vie du programmeur. </sigh>.
But my test confirms that you certainly cannot rely on this to detect v3
richedit.

> it seems that MS didn't include the settypography option in the
> createparams, or other setup parameters of the richedit class.

I would be nice if it was on as default - I can't really see any reason why
someone would want to switch it off....


> I really wonder how to do that automatically without calling
> settypography_options manually each time the richedit window is recreated...
> In the riched98 sourcecode, I have located the settypography in the
> createwnd, just at the end of the procedure, and that's where I make the
> <bad> try...except test ;-)

... your version switches it on every time!


> Do you know if there is a better way of doing the settypography call, Iain ?

I haven't really decided the best place. But CreateWnd does look good. As I
say I have put some extra calls into the app just to be really sure it gets
done!

---------


>> RichEdit1.Paragraph.SetTab(0, 30, tbaDecimal, tblNone);
> what is this settab function ?
> the original one does not have those parameters...
> and it's in the private section of the richedit sourcecode, so you can't
> call it outside the component...
> do miss something Iain ?

Yes <g>.
If you see it as private with only 2 params you may be reading the VCL or
the RxLib component code.
It is public in riched98!

Iain Macmillan

unread,
Jul 23, 2002, 2:42:18 PM7/23/02
to

In article <3d3d82f2$1_2@dnews>, "Kerin" <ker...@bigfoot.com> wrote:


> I seem now to be having a bit of trouble with the line breaks not being
> processed correctly. It seems that RichEdit981.Lines[i] statements now don't
> always give the correct results in that they overrun into the next line, and
> contain embedded #13 characters.

I have noticed that RE.text in a Trichedit contains #13#10 separators but in
a richedit v3 it contains only the #13.
(This caused me to have to change some routines that expected or adjusted
for chr(10)! )

> This problem is since I enabled the advanced text formatting.

.. but I don't think it is affected by this. You could try playing with the
TO_ADVANCEDTYPOGRAPHY or TO_SIMPLELINEBREAK parameter to see if the
simplelinebreak affects it.

-Iain.

Aurélien Dellieux

unread,
Jul 23, 2002, 4:33:59 PM7/23/02
to
Hi Iain,

> How much have you tested your fix.. if there are
> MAX_TABSTOP tabs can you get range errors?

I tried with 32 tabs, which is the value defined by default.
The max value check is done in another component of mine : a ruler (like in
word), in which the right click add a tab.
Before I implement the max value check, I of course had errors...

> But my test confirms that you certainly cannot rely on this to detect v3
> richedit.

Yes, as soon as I have time, I will change this version test.
I coded all those changes inside riched98 in a hurry...

> It is public in riched98!

It seem that I have not even read the thread title ;-)


Aurélien Dellieux

unread,
Jul 23, 2002, 4:37:24 PM7/23/02
to
Hi Iain,

> TO_ADVANCEDTYPOGRAPHY or TO_SIMPLELINEBREAK
I will check the msdn about to_simplelinebreak tomorrow morning, and tell
you about it...


Aurélien Dellieux

unread,
Jul 24, 2002, 3:21:56 AM7/24/02
to
Hi Iain, Hi Kerin,

here is the msdn link to the richedit control help :
http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/richedit/r
icheditcontrols.asp
and particularly the em_settypography message :
http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/richedit/r
icheditcontrols/richeditcontrolreference/richeditmessages/em_settypographyop
tions.asp

the two links above will surely be broken by my email tool so <copy/paste>
will surely be needed...
I will make a short test program to see if changing the "to_advancedtypo or
to_normalline" should be changed to a single "to_advanced", in order not to
modify the normal line breaking setting...


Kerin

unread,
Jul 24, 2002, 11:31:08 AM7/24/02
to
Hi Iain,

It's good that everybody seems to be leaning something here .
The incorrect tabs on the first line was 'fixed' by the code change to
RichEdit2 code as suggested by Aurelien. The test program now works as
expected.

Thanks for all the advice
Kerin

"Iain Macmillan" <he...@ariesps.co.uk> wrote in message

news:3d3d9de7_2@dnews...

Aurélien Dellieux

unread,
Jul 24, 2002, 3:49:42 AM7/24/02
to
Hi Kerin,

The settab bug is still here in delphi 6 richedit.
It seems that Borland's developpers can't remove bugs as easily as they want
to (ascending compatibility ?),
or simply nobody has taken the time to mention this bug ?


Iain Macmillan

unread,
Jul 24, 2002, 1:25:16 PM7/24/02
to

In article <3d3e5593$1_1@dnews>, "Aurélien Dellieux"
<a.del...@nospam.corwin.fr> wrote:


> I will make a short test program to see if changing the "to_advancedtypo or
> to_normalline" should be changed to a single "to_advanced", in order not to
> modify the normal line breaking setting...

I have been using it without the or.
The computer hasn't exploded yet. <g>
I'm not at all sure what choosing a 'simple line break' affects but
apparently not anything that is crucial to me - (yet).

-Iain.

0 new messages