Board index » off-topic » TStatusBar text limited to 127 or 157 characters?

TStatusBar text limited to 127 or 157 characters?


2006-10-14 06:28:32 PM
off-topic13
Hi all,
Once in a while, I run into this issue. It is not extremely important,
so I ususally ignore it, but, it remains a bit frustrating.
I've seen it reported before, e.g. by Thomas Schulz in Nov 2000.
(using Google: search google newsgroups with the search text
"*delphi* tstatusbar length text")
However, I could not find an entry in QC about this.
Curiously enough, Thomas reported a limit of 157 characters, and Rudy
Velthuis answered that he didn't have this problem, so it seems not 100%
reproducible.
Here are steps to reproduce:
Create a Form with a StatusBar and a Button.
Set the StatusBar's SimplePanel property to True.
Set the Form's Width to at least 900.
Then attach the following handler to the Botton's OnClick handler:
procedure TForm1.TestButtonClick(Sender: TObject);
var
s: string;
Letter: Char;
i: Integer;
begin
s := '';
for Letter := 'A' to 'Z'
do begin
s := s + Letter;
for i := 1 to 9
do begin
s := s + IntToStr(i);
end;
end;
StatusBar.SimpleText := s;
end;
When I run this, what's shown in the statusbar terminates at
"...M123456" and then there is some empty space left
(if the form was wide enough, it should end with: "...Z123456789")
Do more people see this behaviour?
Is there an explanation or workaround for this?
Cheers,
Reinier Sterkenbu(r)g
 
 

Re:TStatusBar text limited to 127 or 157 characters?

"Reinier Sterkenburg" < XXXX@XXXXX.COM >wrote
Quote
I've seen it reported before, e.g. by Thomas Schulz in Nov 2000.
(using Google: search google newsgroups with the search text
"*delphi* tstatusbar length text")
However, I could not find an entry in QC about this.
Reinier, This seems like a question more suited to groups
borland.public.delphi.language.delphi.general, or
borland.public.delphi.vcl.components.using.general
After discussing there, you may wish to file a report in
the QualityCentral system. This group is more for issues
related to the QC system itself. Rgds, JohnH
 

Re:TStatusBar text limited to 127 or 157 characters?

At 16:59:33, 14.10.2006, John Herbster wrote:
Quote
Reinier, This seems like a question more suited to groups
borland.public.delphi.language.delphi.general, or
borland.public.delphi.vcl.components.using.general
After discussing there, you may wish to file a report in
the QualityCentral system. This group is more for issues
related to the QC system itself. Rgds, JohnH
John,
Please do not set followup-to to two or more groups (which would make any
replies be cross-posted). And if you set followup-to, please tell the
reader that you have done so, to avoid confusion.
I overruled it, since this message does not belong in any of the groups
you linked to, and I don't want to cross-post.
FWIW, only the vcl.components.using.general group is appropriate for his
question, not the language group.
--
Rudy Velthuis [TeamB] rvelthuis.de/
"All are lunatics, but he who can analyze his delusion is called
a philosopher." -- Ambrose Bierce (1842-1914)
 

{smallsort}

Re:TStatusBar text limited to 127 or 157 characters?

"Rudy Velthuis [TeamB]" < XXXX@XXXXX.COM >wrote
Quote
Please do not set Followup-to to two or more groups
That was a big accident; sorry! --JohnH
 

Re:TStatusBar text limited to 127 or 157 characters?

At 12:28:32, 14.10.2006, Reinier Sterkenburg wrote:
Quote
var
s: string;
Letter: Char;
i: Integer;
begin
s := '';
for Letter := 'A' to 'Z'
do begin
s := s + Letter;
for i := 1 to 9
do begin
s := s + IntToStr(i);
end;
end;
StatusBar.SimpleText := s;
I can see the same now. Max 127 characters (ends on M123456). In the VCL
source, SimpleText is set to the status bar using:
if FSimpleText <>'' then
SendMessage(Handle, SB_SETTEXT, 255, Integer(PChar(FSimpleText)));
The help for SB_SETTEXT says:
The text for each part is limited to 127 characters.
So this is a Windows limitation, not a Delphi one. I doubt there can be
done anything about it (except making the status bar userdraw, but that
is IMO something the user should do).
--
Rudy Velthuis [TeamB] rvelthuis.de/
"The concept is interesting and well-formed, but in order to
earn better than a 'C', the idea must be feasible."
-- A Yale University management professor in response to student
Fred Smith's paper proposing reliable overnight delivery
service (Smith went on to found Federal Express Corp.)