Sign in Join

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

Mailing lists / lazarus / 2010-10

StringGrid header row is always blank at runtime?

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Graeme Geldenhuys

Hi,

In the tiOPF project we have an Model-GUI-Mediator implementation. Something like Model-View-Presenter. Anyway, list objects can be represented in a GUI via ListView or StringGrid component.

Today when I retested the LCL demos of tiOPF, I found that all StringGrid mediators don't have the header (fixed row) anymore. The line is there, but it's totally blank. All the correct data is displayed, so the line count is correct. I double checked and the column headers are created, captions are set, alignment is set, but at runtime it is just blank. See attached image.

At design time, I can see FixedRow = 1, there is a gray shaded header row painter with the default 4 empty rows. But at runtime this is all different.

Can anybody shed some light on what has recently been changed in TStringGrid to cause this behaviour. More importantly, what must I change to get it to work like it used to work in 0.9.28?

Regards, ? - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net:8080/fpgui/ -------------- next part -------------- A non-text attachment was scrubbed... Name: Selection_001.png Type: image/png Size: 13742 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20101005/c0a23960/attachment-0001.png>

Reply by email

Jesus Reyes

--- El mar 5-oct-10, Graeme Geldenhuys escribi?:

Show quoted text 36 lines
De: Graeme Geldenhuys Asunto: [Lazarus] StringGrid header row is always blank at runtime? A: "Lazarus mailing list" Fecha: martes, 5 de octubre de 2010, 3:36 Hi, In the tiOPF project we have an Model-GUI-Mediator implementation. Something like Model-View-Presenter. Anyway,? list objects can be represented in a GUI via ListView or StringGrid component. Today when I retested the LCL demos of tiOPF, I found that all StringGrid mediators don't have the header (fixed row) anymore. The line is there, but it's totally blank.? All the correct data is displayed, so the line count is correct. I double checked and the column headers are created, captions are set, alignment is set, but at runtime it is just blank. See attached image. At design time, I can see FixedRow = 1, there is a gray shaded header row painter with the default 4 empty rows. But at runtime this is all different. Can anybody shed some light on what has recently been changed in TStringGrid to cause this behaviour. More importantly, what must I change to get it to work like it used to work in 0.9.28?

There have been many changes in grid, and still need to be checked if there are regressions, this could be the case here because it seems when grid is cleared it doesn't 'remember' the number of fixed rows there was previous to being cleared.

Easy to fix in tiOPF and if we find this is a regression in grids code, tiOPF2 should not need posterior amendment. Take a look at the attached patch. BTW, included also is a way to make the last column resizeable at run time using grids features instead of doing calcs with grids internals.

Jesus Reyes A.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: tiListMediators.diff
Type: text/patch
Size: 1761 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20101005/bfeeeb26/attachment.bin>

Reply by email

Graeme Geldenhuys
to Jesus Reyes

Hi Jesus,

That's for taking the time to look at tiOPF too, and for the patch.

2010/10/5 Jesus Reyes :

There have been many changes in grid, and still need to be checked if there are regressions, this could be the case here because it seems when grid is cleared it doesn't 'remember' the number of fixed rows there was previous to being cleared.

OK, I'll file a bug report for that.

Clearing the columns also looses the rowcount. Is this a bug too?

Easy to fix in tiOPF and if we find this is a regression in grids code, tiOPF2 should not need posterior amendment. Take a look at the attached patch. BTW, included also is a way to make the last column resizeable at run time using grids features instead of doing calcs with grids internals.

I tried your suggested patch, but that isn't the behaviour I was looking for. But thanks for that, I found another bug in the StringGrid mediator. The last column should only fill the remainder of the grid if the grid content is smaller than the grid width. So if the content is large, a scrollbar must appear. The "auto sizing of last column" feature you mentioned (and the bug I spotted) resized the column, ignoring the developers preferred size and makes sure no scrollbar appears. This was wrong - developers preferred column size takes preference.

Another new bahavour in the grid which wasn't there before (so not sure if it is a bug too). When you scroll horizontally in the stringgrid. Just before you reach the end of the last column, the grid jumps to the left, leaving a large gap after the last column. This doesn't look right, so i think this is a bug too?

Regards, ? - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net:8080/fpgui/

Reply by email

Jesus Reyes
to Graeme Geldenhuys

--- El mi? 6-oct-10, Graeme Geldenhuys escribi?:

Clearing the columns also looses the rowcount. Is this a bug too?

Initially it supposed to work that way so in this case grid's mental lapses are not a bug, but I'm open to change it if people need it.

Show quoted text 18 lines
I tried your suggested patch, but that isn't the behaviour I was looking for. But thanks for that, I found another bug in the StringGrid mediator. The last column should only fill the remainder of the grid if the grid content is smaller than the grid width. So if the content is large, a scrollbar must appear. The "auto sizing of last column" feature you mentioned (and the bug I spotted) resized the column, ignoring the developers preferred size and makes sure no scrollbar appears. This was wrong - developers preferred column size takes preference.

oh, then I misunderstood the purpose.

Show quoted text 11 lines
Another new bahavour in the grid which wasn't there before (so not sure if it is a bug too). When you scroll horizontally in the stringgrid. Just before you reach the end of the last column, the grid jumps to the left, leaving a large gap after the last column. This doesn't look right, so i think this is a bug too?

That I remember it works this way since the beginning so it's not a bug, but recently the grid was improved to do not scroll unnecessarily (http://bugs.freepascal.org/view.php?id=16102) and I think this can be improved too.

Show quoted text 5 lines
-- Regards, ? - Graeme -

Jesus Reyes A.

Reply by email