Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-08

TStringGrid Orientation

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jürgen Hestermann

I am struggling with a 90 degree text output in a TStringGrid cell. So far I have got it working with the following OnPrepareCanvas event procedure:

-------------------------------------------------
procedure TForm1.GridPrepareCanvas(Sender : TObject; aCol,aRow : Integer; aState : TGridDrawState);
begin // TForm1.GridPrepareCanvas
if (aCol=0) and ((aRow mod 5)=0) then
    begin
    with StringGrid1, Canvas, Font do
       begin
       Orientation := 900;
       Brush.Color := clGray;
       Color       := clYellow;
       end;
    end;
end; // TForm1.GridPrepareCanvas
-------------------------------------------------

but there is lots of (unnecessary) white space before and after the text as shown in http://image-upload.de/image/es9ThD/cf9fc08cfd.png

Any ideas how to avoid this?

Reply by email

Jürgen Hestermann
to Jürgen Hestermann
J?rgen Hestermann wrote 7 lines
I am struggling with a 90 degree text output in a TStringGrid cell. So far I have got it working with the following OnPrepareCanvas event procedure: ... but there is lots of (unnecessary) white space before and after the text as shown in http://image-upload.de/image/es9ThD/cf9fc08cfd.png Any ideas how to avoid this?

It seems nobody has an idea how it can be done.
I already fought quite a lot with grids before but got it reasonable working when doing fundamental
things only. It seems that grids in Lazarus are very rudimentarily implemented. There are quite a lot of things missing to make them usable (i.e. AutoSizeRow()). Too bad.

Do any alternatives exist?
Or do I have to do it all from cratch myself?

Reply by email

Maxim Ganetsky
to Jürgen Hestermann

12.08.2012 16:43, J?rgen Hestermann ?????:

Show quoted text 21 lines
Am 2012-08-11 16:40, schrieb J?rgen Hestermann: > I am struggling with a 90 degree text output in a TStringGrid cell. > So far I have got it working with the following OnPrepareCanvas event > procedure: > ... > but there is lots of (unnecessary) white space before and after the > text as shown in > http://image-upload.de/image/es9ThD/cf9fc08cfd.png > Any ideas how to avoid this? > It seems nobody has an idea how it can be done. I already fought quite a lot with grids before but got it reasonable working when doing fundamental things only. It seems that grids in Lazarus are very rudimentarily implemented. There are quite a lot of things missing to make them usable (i.e. AutoSizeRow()). Too bad. Do any alternatives exist? Or do I have to do it all from cratch myself?

Why from scratch? You can create a patch and/or bug report. ;)

Best regards, Maxim Ganetsky mailto:

Reply by email

Mark Morgan Lloyd
to Jürgen Hestermann: It seems nobody has an idea how it can be done. I already fought quite a lot with grids…
J?rgen Hestermann wrote 21 lines
Am 2012-08-11 16:40, schrieb J?rgen Hestermann: > I am struggling with a 90 degree text output in a TStringGrid cell. > So far I have got it working with the following OnPrepareCanvas event > procedure: > ... > but there is lots of (unnecessary) white space before and after the > text as shown in > http://image-upload.de/image/es9ThD/cf9fc08cfd.png > Any ideas how to avoid this? > It seems nobody has an idea how it can be done. I already fought quite a lot with grids before but got it reasonable working when doing fundamental things only. It seems that grids in Lazarus are very rudimentarily implemented. There are quite a lot of things missing to make them usable (i.e. AutoSizeRow()). Too bad. Do any alternatives exist? Or do I have to do it all from cratch myself?

It's not so much grids that are rudimentary as labels. Being able to have labels at 45deg so as to remain readable whilst not inflating narrow columns would be similarly useful.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email