View Issue Details

IDProjectCategoryView StatusLast Update
0017692LazarusLCLpublic2010-10-24 21:20
ReporterMiroslav NyameshchukAssigned ToJesus Reyes 
PrioritynormalSeverityminorReproducibilityrandom
Status closedResolutionfixed 
Product Version0.9.29 (SVN)Product Build 
Target VersionFixed in Version0.9.29 (SVN) 
Summary0017692: Don't save parameter StringGrid.DefaultRowHeight
DescriptionIn Object Inspector StringGrid.DefaultRowHeight=20.
But execute program in same computer in Windows XP, this parameter have change to other.
I think, this parameter has depends from System Font Propeties in Screen.
TagsNo tags attached.
Fixed in Revision27819
LazTarget-
WidgetsetWin32/Win64
Attached Files

Activities

Jesus Reyes

2010-10-22 22:22

developer   ~0042005

Last edited: 2010-10-22 22:24

DefaultRowHeight *is not* stored by default and yes initially it's based on the current font size, only if user manually change the value in object inspector it is stored. Once it value is stored the grid should not ignore it but use the stored value.

If there is something not working according to this (logic), it could be an issue, and in this case, please describe how to reproduce the problem.

Miroslav Nyameshchuk

2010-10-22 22:31

reporter   ~0042006

1. New Project.
2. Put StringGrid on Form
3. Put Label on Form.

procedure TForm1.FormCreate(Sender: TObject);
begin
Label1.Caption:=IntToStr(StringGrid1.DefaultRowHeight);
end;

4.Build
5. Exit From Lazarus.
6. Run.
Label value is 20

7. Close Program.
8. Change Size of Font in Screen Parameters (Screen Propeties). Exmple "big".
9. Run program.
Label value is 23.

Jesus Reyes

2010-10-22 22:40

developer   ~0042007

That is correct, as I said it depends on current font (which probably depends on screen resolution).

As it conforms the logic I mentioned I don't see what is the problem.

Miroslav Nyameshchuk

2010-10-22 22:47

reporter   ~0042008

Before build this parameter has value 20.
After compile (in exe-file) this parameter has values 20 or not?

Is values on Object Inspector must not be saved on program?

Jesus Reyes

2010-10-22 23:09

developer   ~0042011

"After compile (in exe-file) this parameter has values 20 or not?"

The object inspector shows the current value, but it doesn't necessarily mean it's a fixed value, also it allows you to change it if you want and in this case it becomes a fixed value. Only if it's a fixed value it is stored with the exe other way it's a calculated value.

"Is values on Object Inspector must not be saved on program?

Not necessarily. And in fact if the value was defined as "default" it's not saved in form's lfm file. Even if you change it to a different value and then return it to original value.

For DefaultRowHeight it works a little different, for example if original value is 20 and you change it to 21 and then change it again to 20, the value become fixed the first time it was changed to 21, and there is not way to restore it status to "unfixed" so the value will be stored.

Miroslav Nyameshchuk

2010-10-23 12:16

reporter   ~0042015

I am change value in Object inspector from 20 to 21, again from 21 to 20 - no effect. After run program Label value "23".

Jesus Reyes

2010-10-23 20:34

developer   ~0042033

I checked the implementation and you are right, it should be now fixed, please try again and if it's ok please close this report.

Miroslav Nyameshchuk

2010-10-23 22:11

reporter   ~0042036

After change value in Object inspector from 20 to 21 and again - all work good. Thanks.

But how to know when the parameter will change in run-time, and when - no?

Jesus Reyes

2010-10-24 21:06

developer   ~0042065

Make a derived TStrinGrid to access GridFlags property or use an access class:

type
 TGridAcces=class(TStringGrid);

...

if gfDefRowHeightChanged in TGridAccess(Grid).GridFlags then
  Default Row has been modified, so it's now fixed
else
  Default Row is still calculated.

Miroslav Nyameshchuk

2010-10-24 21:20

reporter   ~0042066

Close report.

Issue History

Date Modified Username Field Change
2010-10-22 21:53 Miroslav Nyameshchuk New Issue
2010-10-22 21:53 Miroslav Nyameshchuk Widgetset => Win32/Win64
2010-10-22 22:14 Jesus Reyes Status new => assigned
2010-10-22 22:14 Jesus Reyes Assigned To => Jesus Reyes
2010-10-22 22:22 Jesus Reyes LazTarget => -
2010-10-22 22:22 Jesus Reyes Note Added: 0042005
2010-10-22 22:22 Jesus Reyes Status assigned => feedback
2010-10-22 22:24 Jesus Reyes Note Edited: 0042005
2010-10-22 22:31 Miroslav Nyameshchuk Note Added: 0042006
2010-10-22 22:40 Jesus Reyes Note Added: 0042007
2010-10-22 22:47 Miroslav Nyameshchuk Note Added: 0042008
2010-10-22 23:09 Jesus Reyes Note Added: 0042011
2010-10-23 12:16 Miroslav Nyameshchuk Note Added: 0042015
2010-10-23 20:34 Jesus Reyes Fixed in Revision => 27819
2010-10-23 20:34 Jesus Reyes Status feedback => resolved
2010-10-23 20:34 Jesus Reyes Fixed in Version => 0.9.29 (SVN)
2010-10-23 20:34 Jesus Reyes Resolution open => fixed
2010-10-23 20:34 Jesus Reyes Note Added: 0042033
2010-10-23 22:11 Miroslav Nyameshchuk Note Added: 0042036
2010-10-24 21:06 Jesus Reyes Note Added: 0042065
2010-10-24 21:20 Miroslav Nyameshchuk Status resolved => closed
2010-10-24 21:20 Miroslav Nyameshchuk Note Added: 0042066