TdrawGrid - Colums resize problem (adding columns in object inspector only)
Original Reporter info from Mantis: honzin_
-
Reporter name: honzin_
Original Reporter info from Mantis: honzin_
- Reporter name: honzin_
Description:
platform:win32
os: winxp
laz:0.9.10
DrawGrid columns are displayed in wrong way (gaps between...).
Columns to DrawGrid have to be added only! in object inspector. Columns must be resized somewhere in programme. {whatewer}.Canvas.textWidth or TextHeight (maybe something else) must be called before! col. width(s) change.
This will produce a bug.
Steps to reproduce:
- insert DrawGrid object to form
- Add Colums in object inspector only (adding by Columns.Add in programme works fine! and "kills" the bug)
in programme:
3) call {whatever}.Canvas.TextWidth('{whatever}') or {whatever}.Canvas.TextHeight('{whatever}')
4) Change Width of DrawGrid columns in programme: drawGrid.Colwidths[{some column number}]:=XXX or/and drawGrid.Columns.Items[{some column number}].width:=XXX
example (5 columns added in object inspector, none in programme):
********************************
procedure TForm1.FormCreate(Sender:TObject);
var j:longint;
begin
j:=DrawGrid1.Canvas.TextWidth('_a'); //{whatever}.canvas must be called to produce bug
//j:=10; //here can be any code - it does not matter
DrawGrid1.ColWidths[1]:=j;
DrawGrid1.Colwidths[2]:=15; //i does not matter whather j is used
DrawGrid1.Columns.Items[1].Width:=j; //can be deleted - it doe not influence bug
DrawGrid1.Columns.Items[2].Width:=j; //can be deleted - ...
end;
*********************************
Additional information:
calling DrawGrid.Columns.Add or DrawGrid.Columns.Delete({column index}) cause that bug "fixes"!!!
It seems to be object inspector columns edit procedure problem.
(project files added)
Mantis conversion info:
- Mantis ID: 1367
- OS: winXP
- Platform: win32
- Version: 0.9.10
- Fixed in version: 0.9.11 (SVN)
- Fixed in revision: 7988 (#0235d8ac)
- Target version: 1.0.0
- LazTarget: 1.0