View Issue Details

IDProjectCategoryView StatusLast Update
0017407LazarusLCLpublic2010-09-17 12:12
ReporterJuha ManninenAssigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.29 (SVN)Product Build 
Target Version0.9.30Fixed in Version0.9.29 (SVN) 
Summary0017407: TStringGrid doesn't show column titles when they are written directly to Cells
DescriptionThis time there are no column objects created but the title is written directly to cells, like
  Cells[1,0]:='Header';

This error happens always, the related issue 0017372 happened only when OnDrawCell handler was assigned.

This issue affects also some Lazarus IDE grids.
TagsNo tags attached.
Fixed in Revision27373
LazTarget0.9.30
Widgetset
Attached Files

Relationships

related to 0017372 closedJesus Reyes TStringGrid doesn't show column titles when OnDrawCell handler is assigned 

Activities

2010-09-14 11:39

 

StringGridTitle.tar.gz (1,727 bytes)

Juha Manninen

2010-09-14 12:20

developer   ~0041059

Tested on Linux with both GTK2 and QT bindings.

Juha Manninen

2010-09-14 13:04

developer   ~0041062

Yeah, actually this bug was created by the same commit 27294 that solved the related issue.
Found using git bisect.

Ingo Steiniger

2010-09-14 23:12

reporter   ~0041087

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.

Jesus Reyes

2010-09-15 06:17

developer   ~0041090

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.

Desmond C

2010-09-15 11:26

reporter   ~0041103

Last edited: 2010-09-15 11:27

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

2010-09-15 14:37

 

test_stringgrid_color.zip (2,364 bytes)

Ingo Steiniger

2010-09-15 14:39

reporter   ~0041115

OK, simple test application attached.

Jesus Reyes

2010-09-15 21:13

developer   ~0041126

@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.

Ingo Steiniger

2010-09-16 01:00

reporter   ~0041128

You're right, it works!
Thank you for your detailed answer. I didn't knew OnPrepareCanvas before.

Juha Manninen

2010-09-17 12:12

developer   ~0041160

Works...

Issue History

Date Modified Username Field Change
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