View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0017407||Lazarus||LCL||public||2010-09-14 11:39||2010-09-17 12:12|
|Reporter||Juha Manninen||Assigned To||Jesus Reyes|
|Product Version||0.9.29 (SVN)||Product Build|
|Target Version||0.9.30||Fixed in Version||0.9.29 (SVN)|
|Summary||0017407: TStringGrid doesn't show column titles when they are written directly to Cells|
|Description||This time there are no column objects created but the title is written directly to cells, like|
This error happens always, the related issue 0017372 happened only when OnDrawCell handler was assigned.
This issue affects also some Lazarus IDE grids.
|Tags||No tags attached.|
|Fixed in Revision||27373|
StringGridTitle.tar.gz (1,727 bytes)
||Tested on Linux with both GTK2 and QT bindings.|
Yeah, actually this bug was created by the same commit 27294 that solved the related issue.
Found using git bisect.
I also can't change font color in OnDrawCell since this commit. Maybe same reason.
Tested with GTK2 only. Can do more tests if needed.
I'm prepared to commit my changes to grids and fix this and some unreported issues, but if I can get additional tests to try here, I would like to do it.
@Ingo: can you please post the code you are using on OnDrawCell and OnPrepareCanvas (in case it's used), of course it would be better a sample application.
I wish to report the same problem.
Laz 0.9.30 built from svn trunk 27368
FPC 2.4.0 first release
If you populate cells that are fixed, no text. If you populate the same cells while they are not fixed, the text appears.
No change in behaviour if I assign OnDrawCell or not
** Forgot to add: GTK2 target
test_stringgrid_color.zip (2,364 bytes)
||OK, simple test application attached.|
@Ingo, I'm sorry this will not work anymore, the reason is that previously the grid would always paint the text, for example suppose you want to draw an icon before the text so in OnDrawCell you draw the text a little more to the right to make space for the icon, well the grid will anyway paint the text over your icon ruining the appearance. With the new changes you still have to paint the icon and the text but the grid will not paint over your work. For this case there is a simple solution: OnPrepareCanvas, just create an event for this and move the code there. Using OnPrepareCanvas you can change any canvas property so you don't have to actually draw anything.
The current changes should not affect code that was already using OnPrepareCanvas.
You're right, it works!
Thank you for your detailed answer. I didn't knew OnPrepareCanvas before.
|2010-09-14 11:39||Juha Manninen||New Issue|
|2010-09-14 11:39||Juha Manninen||File Added: StringGridTitle.tar.gz|
|2010-09-14 11:39||Juha Manninen||LazTarget||=> -|
|2010-09-14 11:40||Juha Manninen||Relationship added||related to 0017372|
|2010-09-14 12:20||Juha Manninen||Note Added: 0041059|
|2010-09-14 13:04||Juha Manninen||Note Added: 0041062|
|2010-09-14 19:29||Jesus Reyes||Status||new => assigned|
|2010-09-14 19:29||Jesus Reyes||Assigned To||=> Jesus Reyes|
|2010-09-14 23:12||Ingo Steiniger||Note Added: 0041087|
|2010-09-15 06:17||Jesus Reyes||Note Added: 0041090|
|2010-09-15 06:17||Jesus Reyes||Status||assigned => feedback|
|2010-09-15 06:17||Jesus Reyes||LazTarget||- => 0.9.30|
|2010-09-15 11:26||Desmond C||Note Added: 0041103|
|2010-09-15 11:27||Desmond C||Note Edited: 0041103|
|2010-09-15 14:37||Ingo Steiniger||File Added: test_stringgrid_color.zip|
|2010-09-15 14:39||Ingo Steiniger||Note Added: 0041115|
|2010-09-15 21:13||Jesus Reyes||Note Added: 0041126|
|2010-09-15 23:10||Jesus Reyes||Fixed in Revision||=> 27373|
|2010-09-15 23:10||Jesus Reyes||Status||feedback => resolved|
|2010-09-15 23:10||Jesus Reyes||Fixed in Version||=> 0.9.29 (SVN)|
|2010-09-15 23:10||Jesus Reyes||Resolution||open => fixed|
|2010-09-15 23:10||Jesus Reyes||Target Version||=> 0.9.30|
|2010-09-16 01:00||Ingo Steiniger||Note Added: 0041128|
|2010-09-17 12:12||Juha Manninen||Status||resolved => closed|
|2010-09-17 12:12||Juha Manninen||Note Added: 0041160|